- Log in to the server using ssh client of your choice using the private key.
ssh -i your-key.pem username@(public-ip-address)
- Open the sshd_config file.
sudo vi /etc/ssh/sshd_config
- Find the line containing “PasswordAuthentication” parameter and change its value from “no” to “yes“
PasswordAuthentication yes
- Setup ec2 user password using the “passwd” command.
sudo passwd ubuntu
- Now, restart the “sshd” service using the following command.
sudo service sshd restart
- Now you can log out and log in using the password you set for the user. For example,
ssh ubuntu@35.162.225.240