Question

How to log in the server as root after setting PermitRootLogin to no in /etc/ssh/sshd_config

Posted April 12, 2018 1.6k views
UbuntuGetting Started

I have set the PermitRootLogin to no in /etc/ssh/sshd_config by following the tutorial Initial Server Setup with Ubuntu 14.04. Now I cannot log in as root.

How can i log in as root? Thank you.

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
1 answer

Once you’ve made and applied this change it will not be possible to connect to ssh as root. You have a couple options to use instead:

  • Log in via SSH with the new user account you created in that tutorial and use sudo to run commands as root or sudo su to launch a shell as root after you are logged in.

  • If for any reason you are not able to log in with the new account, if you are using password authentication (instead of ssh-keys) you can log into the web console in the control panel (Droplet->Access->Console) as root. The console is not powered by SSH. Instead, your droplet sees the console as it’s local keyboard and display.

Submit an Answer