How to SFTP on Amazon EC2

I installed Amazon AMI 1.0 and logged in as ec2-user with key. Then I ssh and set a password with sudo passwd ec2-user

But now when I connect via SFTP I get: Disconnected: No supported authentication methods available. I use elastic IP and username ec2-user to connect.


If your SFTP program is able to use public keys it is possible to use the service without password.

setup a passwd if run $sudo bash it will take to root #

sudo -s is permanent su, from there it is possible to use passwd.


If you absolutely need to SFTP in as root, Juan Hernandez's answer on StackOverflow will help:

The message "Please login as the ec2-user user rather than root user." is displayed because a command is executed when you login with the private key. To remove that command edit ~/.ssh/authorized_keys file and remove the command option.

Thanks Juan!