Skip to content

Instantly share code, notes, and snippets.

@dipsywong98
Last active August 4, 2019 02:36
Show Gist options
  • Save dipsywong98/ca1ced267eaecbb483ed237690d04140 to your computer and use it in GitHub Desktop.
Save dipsywong98/ca1ced267eaecbb483ed237690d04140 to your computer and use it in GitHub Desktop.

Config root login for server

  1. add ssh public key to /root/.ssh/authorized_keys

  2. 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 service sshd restart

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment