How to Change SSH config in AWS EC2

By default when you create a new instance in AWS, you have to authenticate via the PEM files. This is the most secured way to connect to the instance. But sometimes you need to login using password based authentication. Here I have shown how you can change the Authentication process. To continue, you need to first create an EC2 instance.

Then open the sshd config file for editing using VIM.

sudo vi /etc/ssh/sshd_config

Then find this keyword: PasswordAuthentication 

It’s default value is no, so to enable password based authentication you need to set that to YES.

then run the following command to restart the SSH server.

sudo service sshd restart

In conclusion, PEM file based authentication is a very secured way of login. But sometimes you need to turn on Password based authentication, which is shown in this article.

Atiqur Rahman

I am MD. Atiqur Rahman graduated from BUET and is an AWS-certified solutions architect. I have successfully achieved 6 certifications from AWS including Cloud Practitioner, Solutions Architect, SysOps Administrator, and Developer Associate. I have more than 8 years of working experience as a DevOps engineer designing complex SAAS applications.

Leave a Reply