linux poison RSS
linux poison Email

How to Disable Direct Root Login to SSH on Ubuntu

One security tweak you need to consider is with Open-SSH server. By default, direct log on for root is enabled, which means your just asking for trouble with hackers attempting to break into your Computer. Instead, you can easily disable root access from logging into your SSH server,

Disable Root Access
you'll need to edit the /etc/ssh/sshd_config file using your favorite editor
Once gedit or kate opens, scroll down until you see the following section…
LoginGraceTime 120
PermitRootLogin yes
StrictModes yes
Modify PermitRootLogin as shown below:
PermitRootLogin no
This will disable root's access to logon via SSH. Save the file and exit.

Now you'll need to restart the sshd service from a Terminal window using the following command:
sudo /etc/init.d/sshd restart
After restarting SSH, try to connect using the root account. Access should be disallowed and you should only be able to log on with your user account. Once you do login, you can access the root account by using the su command.


3 comments:

Anonymous said...

Instead of restarting it's better to reload; see this link
http://www.markus-gattol.name/ws/ssh.html#reload_vs_restart

Anonymous said...

Or try the slightly less restrictive alternative of ' PermitRootLogin without-password' to require key-based authentication.

Nikesh Jauhari said...

Here is, SSH login without password >> http://linuxpoison.blogspot.com/2008/05/ssh-login-without-password.html

Post a Comment

Related Posts with Thumbnails