Thursday, August 31, 2017

How can I remote ssh login to the Ubuntu 16.04 LTS via root?

By default you are unable to ssh login to the Ubuntu 16.04 LTS via root, but you can enable it step by step as following:

1. Login to the system via regular user account.

2. Set password to root account (Due to root password is empty by default)
sudo passwd root
3. To modify the configuration file of sshd_config (Marked PermitRootLogin prohibit-password, and added PermitRootLogin yes )
sudo vi /etc/ssh/sshd_config
# Authentication:
LoginGraceTime 120
#PermitRootLogin prohibit-password 
PermitRootLogin yes 
StrictModes yes
4. Restart sshd
 sudo systemctl restart ssh

Done.

No comments: