How To Enable Root SSH On Ubuntu and CentOS

Share
Enable Root SSH On Ubuntu and CentOS

How To Enable Root SSH On Ubuntu and CentOS

 

By default on Ubuntu server root SSH disabled for security reasons. That means you can login as user then use sudo to became root. In this article I will show how to enable root SSH on Ubuntu and CentOS. Also you can found more information in SSH man pages.

 

Enable root login over SSH

To enable root ssh we need login as root and make some changes in /etc/ssh/sshd_config configuration file.

So open in any text editor:

# vim /etc/ssh/sshd_config

And add next line into sshd_config file

PermitRootLogin yes

Permit Root Login

After adding necessary line save and close editor.

 

Restart SSH server

For apply new settings we nwwd restart or reload SSHd.

Run:

systemctl restart sshd

or

service sshd restart

Now you will able  SSH login as root into your Linux server.

 

Read also: SSH Jump Host