amazon-web-servicessshamazon-ec2

ssh with password into AWS EC2 instance


I'm trying to set up an AWS instance for about 90 people where they can sftp in and drop files, but it appears that AWS blocks passwords for ssh and only allows in ssh keyed logins by default.

Does there exist a way to undo this behavior inside AWS and allow for normal ssh and thus sftp to occur? If I don't need to manage ssh keys along with user names and passwords that would be great.


Solution

  • First open few terminal sessions to the EC2 machine, in case modifying SSH config fails, you still have an option to restore it to its old values.

    Edit /etc/ssh/sshd_config (after saving a backup file to sshd_config.bak) and change the following lines to:

    # Change to no to disable tunnelled clear text passwords
    PasswordAuthentication yes
    

    In addition, if you want to disable key based authentication:

    PubkeyAuthentication no
    

    Save the file and restart the SSH daemon:

    sudo service ssh restart
    

    Create a new user and set a password or if a password has been already set for an existing user: open a new SSH session and you should be able to login using a password. If the solution didn't work, use any of the other open terminal sessions to restore the old sshd_config, restart the ssh service and continue debugging.