How to setup password authentication for your AWS EC2 Instances

Saurav Sharma
saurav-blog
Published in
1 min readSep 9, 2017

I want to start by mentioning that passwords are very insecure way of authenticating users. It can be brute forced easily and we do get lazy sometimes and set up easy passwords.

But sometimes you may want to have that options in situations where security isn’t very important and ease of access is required.

Here are the steps to make Password Authentication possible with EC2 Instances.

  • Change the password of your EC2 instance if you don’t know the password with command $ sudo passwd ec2-user
  • Alter /etc/ssh/sshd_config with editior of your choice. I use VIM

· Scroll down to line where it says PasswordAuthentication no and change it to yes

  • Restart the ssh server:

Sudo /etc/init.d/sshd restart

Try to login in to your EC2 instance now with command

$ ssh ec2-user@xx.xx.xx.xx

You’ll be able to enter password and login.

Here’s a video walkthrough:

Thanks for reading .

--

--