Skip to content

Latest commit

 

History

History
44 lines (32 loc) · 864 Bytes

enable-password-ssh.MD

File metadata and controls

44 lines (32 loc) · 864 Bytes

When you first log into the EC2 instances on AWS , you can only ssh using key pairs.

so the command to log in looks something like this:

ssh -i mykey.pem [email protected] 

But what if you want to enable password ssh?

We can follow these steps :

  1. Create an EC2 instance. If you have one already , skip this step.
  2. Become the super user and open the sshd config file
sudo su
vim /etc/ssh/sshd_config
  1. Change the PasswordAuthentication no config to
PasswordAuthentication yes
  1. Restart the sshd daemon
service sshd restart
  1. set the password for the ec2 user /or create new user
passwd ec2-user
adduser bob
passwd bob
  1. Exit out and try loggin into the EC2 using the password

you should now be logged in without using the .pem file