Howto: Prevent root user from being able to log in via SSH service
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.
E-mail this to a friend
Printable version
Related Other Helpful FAQs:
- Apache prevent hot linking or leeching of images using mod_rewrite howto
- Disable the mail alert by crontab command
- How to: Disable firewall on RHEL / CemtOS / Redhat Linux
- Linux - What defines a user account?
- Linux: Openssh (ssh server) deny root user access
Discussion on This FAQ
Leave a Reply
We encourage your comments, and suggestions. But please stay on topic, be polite, and avoid spam. Thank you very much for stopping by our site!


November 24th, 2006 at 12:33 am
how can i mount vfat with autofs