How to Enable Password Authentication in AWS ec2 Instances
Although password will be encrypted while communicating with server but it is not recommended to enable the password authentication to connect with EC2 machines using ssh. Easy and common password can be guessed easily using brute force by some malicious user.
-
Log in to the server using ssh client of your choice using the private key.
-
Set up a password for the user using passwd command along with the username.
-
Open the sshd_config file.
-
Find the Line containing "PasswordAuthentication" parameter and change its value from "no" to "yes". If you want to set up "root" login, find "PermitRootLogin" parameter and change its value from prohibit-password to "yes".
-
Now, restart the "sshd" service using the following command.
-
Now you can log out and log in using the password you set for the user.