Showing posts with label Root. Show all posts
Showing posts with label Root. Show all posts

Tuesday, October 17, 2017

Enable SSH for root user on Ubuntu

To enable root Login, first assign the password for root user.

#sudo passwd root                -/enter new password for root user here.

Directly copy and paste this below lines in command prompt, to set ssh to allow root logins.

sed -i 's/Authentication:/#Authentication:/g' /etc/ssh/sshd_config sed -i 's/LoginGraceTime/#LoginGraceTime/g' /etc/ssh/sshd_config sed -i 's/#PermitRootLogin yes/PermitRootLogin yes/g' /etc/ssh/sshd_config sed -i 's/PermitRootLogin without-password/#PermitRootLogin without-password/g' /etc/ssh/sshd_config sed -i 's/StrictModes yes/#StrictModes yes' /etc/ssh/sshd_config service ssh restart

Or you can also configure it by manually by editing configuration file as mentioned below.

#vim /etc/ssh/sshd_config
# Authentication:
#LoginGraceTime 120
PermitRootLogin yes
#PermitRootLogin without-password
#StrictModes yes








Comment lines as mentioned above.

Save and exit the file.

Now restart ssh service

#service ssh restart

Check from the client machine.