Amazon EC2 Root login Amazon EC2 Root login jenkins jenkins

Amazon EC2 Root login


Refer to the following to set root login:

sudo -s (to become root)vi /root/.ssh/authorized_keys

Delete the lines at the begining of the file until you get to the words ssh-rsa.

vi /etc/ssh/sshd_config

Set the variable PermitRootLogin to PermitRootLogin without-password (without quotes)

sudo /etc/init.d/sshd restart


You need to edit file : /etc/ssh/sshd_configand restart ssh service .

  1. If you want to login using keys change as below :

    PermitRootLogin yesRSAAuthentication yes
  2. If you want to login using password , change as below :

    PermitRootLogin yesPasswordAuthentication yes


edit /etc/ssh/sshd_config

  • Comment out the line "PermitRootLogin"
  • Comment out the line "PasswordAuthentication no"

Then restart the ssh service

/sbin/service sshd restart