Howto: Prevent root user from being able to log in via SSH service

by on January 6, 2006 · 1 comment· LAST UPDATED August 28, 2006

in , ,

Securing root account is one of the main tasks. Most systems have a password assigned to the root account. The first thing you do is assume that the password is always compromised. This does not mean that you should remove the password. The password is almost always necessary for console access to the machine. What it does mean is that you should not make it possible to use the password outside of the console. Direct root logins should only be allowed via the system console.

1) Login as a root user

2) Open /etc/ssh/sshd_config file
# vi /etc/ssh/sshd_config

3) Make changes to ssh server configuration find the following line or edit the line from:
PermitRootLogin yes

Change it to:
PermitRootLogin no

4) Save the changes

5) Restart sshd service
# /etc/init.d/sshd restart

The option PermitRootLogin specifies whether root can log in using ssh.

TwitterFacebookGoogle+PDF versionFound an error/typo on this page? Help us!

{ 1 comment… read it below or add one }

1 inam November 24, 2006 at 12:33 am

how can i mount vfat with autofs

Reply

Leave a Comment

Tagged as:

Previous Faq:

Next Faq: