how to enable direct ssh to EC2 linux instance without keypair file
To enable the direct ssh to linux EC2 instance without using keypair file we have to edit the sshd_config file.
Follow the given below steps
Step 1 : Login into linux EC2 instance with the help of keypair. Use the user name which is related to your instance. for eg.
example: ssh -i keypar_file.pem firstname.lastname@example.org
Step 2: After login ,edit the /etc/ssh/sshd_config file and make the value of parameter called PasswordAuthentication as yes
change the PasswordAuthentication value as yes
save and exit
Step 3: Restart the ssh service.
In Debian or Ubuntu instance: sudo systemctl restart ssh In CentOS or Red Hat instance: sudo systemctl restart sshd
Step 4: Open new terminal in your PC or laptop. ( Do not take the risk,playing safe side )
Now try direct ssh without using keypair file.
That’s it. Now you can check.