2013年4月8日 星期一

Connect to AWS Linux Server by using putty

This article teaches you how to connect to your AWS linux server via putty.

Step 1. Download the private key from aws console.

Step 2. Download puttygen from http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html


Step 3.  Import the downloaded private key to puttygen, and then save the key in ppk format



Step 4. Open putty, type the information such as hostname as usual..
go to Connection ->SSH -> Auth, and input the path of your private key

Step 5. Successfully connect to AWS Linux server!

2013年4月4日 星期四

[Resolved] Connect to AWS Linux Server by using WinSCP

WinSCP returns "Permission Denied" when copying files to AWS Linux Server using ec2-user account. 


In order to transfer files via WinSCP using root account,
1) Go to Environment -> SCP / Shell
2) Choose "sudo su -" in the field "Shell"

System shows error: "Connection has been unexpectedly closed. Server sent command exit status 1.
Error skipping startup message. Your shell is probably incompatible with application (BASH is recommended)

In WinSCP log..

. 2013-04-04 19:21:56.661 Started a shell/command
. 2013-04-04 19:21:56.665 --------------------------------------------------------------------------
. 2013-04-04 19:21:56.665 Using SCP protocol.
. 2013-04-04 19:21:56.667 Doing startup conversation with host.
. 2013-04-04 19:21:56.672 Skipping host startup message (if any).
> 2013-04-04 19:21:56.672 echo "WinSCP: this is end-of-file:0"
! 2013-04-04 19:21:56.699 sudo: sorry, you must have a tty to run sudo
. 2013-04-04 19:21:56.699 Server sent command exit status 1
. 2013-04-04 19:21:56.700 Disconnected: All channels closed
* 2013-04-04 19:21:56.713 (ESshFatal) Connection has been unexpectedly closed. Server sent command exit status 1.
* 2013-04-04 19:21:56.713 Error skipping startup message. Your shell is probably incompatible with the application (BASH is recommended).


Login to AWS Linux Server
1) Run command visudo using root account
2) Search the line "Defaults requiretty" and add "Defaults:ec2-user !requiretty" right after it.

After the setup, you can SCP to the server.