Page 1 of 1

Enable Root Login via SSH In Ubuntu

Posted: 22 Nov 2019, 14:51
by hepek
Enable root login over SSH


1. Login to your server as root.
2. As the root user, edit the sshd_config file found in:

Code: Select all

/etc/ssh/sshd_config:
3. Using VIM Editor:

Code: Select all

vim /etc/ssh/sshd_config
4. Add the following line to the file, you can add it anywhere but it’s good practice to find the block about authentication and add it there.

Code: Select all

PermitRootLogin yes
5. Save and exit the file.
6. Restart the SSH server:

Code: Select all

systemctl restart sshd
or

Code: Select all

service sshd restart
And that’s it! With the new line added and the SSH server restarted, you can now connect via the root user.