Search code examples
ubuntusshrootamazon-lightsail

how to check if root login is disabled on ubuntu server


I tried logging in lightsail instance machine as a root user using the ssh key pair.

The response I received was

Please login as the user "ubuntu" rather than user "root".

I want to know how to check whether login with root is disabled and if it is, how to enable it using ssh keys.


Solution

  • on Ubuntu, for SSH this is configured via SSH server config: /etc/ssh/sshd_config

    in there you should have a row:

    PermitRootLogin yes
    

    which is what you're looking for.