1. Login to your EC2 instance using your .pem
 file
ssh -i your_pem_file.pem [email protected]-________.compute-1.amazonaws.com
2. Create a new user that will access the instance using a password:
$ sudo useradd -s /bin/bash -m -d /home/USERNAME -g root USERNAME
where:
-s /bin/bash
 : useÂ/bin/bash
 as the standard shell-m -d /home/USERNAME
 : create a home directory atÂ/home/USERNAME
-g root
 : add to groupÂroot
USERNAME
 : the username of the new user
3. Create a strong password for the new user:
$ sudo passwd USERNAME
Enter new UNIX password:
Retype new UNIX password:
4. Add user to sudoers file by using sudo visudo
 and add the following line:
USERNAME ALL=(ALL:ALL) ALL
5. Enable password authentication by editing /etc/ssh/sshd_config
: change PasswordAuthentication no
to PasswordAuthentication yes
6. Restart ssh:
sudo /etc/init.d/ssh restart
Logout of your instance (exit
) and try your new login without the .pem
 file:
$ ssh [email protected]-________.compute-1.amazonaws.com
[email protected]-________.compute-1.amazonaws.com's password: