By default, password ssh access is disabled, and also root ssh access is disabled. Initially we can only login into an AWS EC2 instance using a pam key. In this article we will see what we need to do to make possible ssh login for a normal user and for the root user in a AWS EC2 instance. After you have created your instance and managed to login using the pam key follow the steps bellow to enable password ssh for root and other users. For this we need to edit the /etc/sshd/ssh_config file For root login enabling
vim /etc/sshd/ssh_config
# Authentication:
#LoginGraceTime 2m
PermitRootLogin yes -- Uncomment
# Only allow root to run commands over ssh, no shell
#PermitRootLogin forced-commands-only --comment
#StrictModes yes
#MaxAuthTries 6
#MaxSessions 10
.....
.....
PasswordAuthentication yes
#PermitEmptyPasswords no
# EC2 uses keys for remote access
#PasswordAuthentication no
[root@aodba]# /etc/init.d/sshd restart
Stopping sshd: [ OK ]
Starting sshd: [ OK ]