Allowing direct root login using SSH on Ubuntu

By default, both root login and the root account are usually locked on the server due to security concerns. However, sometimes it may be necessary to have the root user account enabled and the ablility to directly login onto the server. For that, follow the steps below:-

Step 1: By default, the root account password is locked in Ubuntu. So unlock it first:-

sudo -i

sudo passwd root

Step 2: Change the SSH config details as follows:-

PermitRootLogin no
PermitRootLogin yes

Step 3: Specify Which Accounts Can Use SSH

Find out if the sshd_config file has an entry as below and if there is such an entry then remove the root user from below

DenyUsers root user1 user2


If there is no DenyUsers entry then place in it an entry like below:-

AllowUsers root

Save the file and restart SSH service using the command below:-

/etc/init.d/ssh restart

That's it. After this, you will be able to login directly using root credentials.

Sachin Wednesday 14 May 2014 - 6:08 pm | | Default

No comments

(optional field)
(optional field)

Comment moderation is enabled on this site. This means that your comment will not be visible until it has been approved by an editor.

Remember personal info?
Small print: All html tags except <b> and <i> will be removed from your comment. You can make links by just typing the url or mail-address.