EC2 Ubuntu – Allow SSH root login with Password

16. August 2016 AWS 0
EC2 Ubuntu – Allow SSH root login with Password

Amazon AWS doesn’t allow root access by default on the OS level. Even though this is for recommended for security purpose, you may need to enable it for some high level operations such as conversion to OVA or VMware etc.


  • Amazon EC2
  • Ubuntu 10.X (Should work with other linux versions too)

How to

  • Open SSH port from the Security Group
  • Enable Password Authentication

 PasswordAuthentication yes

  • Change PermitRootLogin option

 PermitRootLogin without-password

 PermitRootLogin yes

  • Comment the below line  with # to Disable StrictModes

 #StrictModes yes

  • Delete authorized_keys

 mv /root/.ssh/authorized_keys /root/.ssh/authorized_keys-disabled

  • Restart SSH service

 /etc/init.d/ssh restart

  • Set root password

[[email protected] ~]# passwd
Changing password for user root.
New password:

Now you can login to the server with the root username and password
ssh -l root IP_ADDRESS -v

Leave a Reply

Your email address will not be published. Required fields are marked *