How to Disable Direct Root Login to Secure Your Network
By Angsuman Chakraborty, Gaea News NetworkFriday, January 2, 2009
Root login is perhaps one of the very few vulnerabilities that Linux operating system faces. A person can hack into your system as a root user easily and can play with security settings. This guide will show you how to disable it so you can still login as root but just not directly, reducing the security issue.
This will force a hacker to have to go through a double security checks where he will have to give 2 separate passwords to gain root access. What happens is you’ll first need to login as your admin user in SSH, then switch to the super user with the su command to get root. It also forces the use of SSH protocol 2, which is a newer and more secure SSH protocol. This almost nullifies any chance of unauthorized access to your root account.
- SSH into your server as ‘admin’ and gain root access by su
- Copy and paste this line to edit the file for SSH logins
/etc/ssh/sshd_config
Protocol 2, 1
Protocol 2
PermitRootLogin yes
PermitRootLogin no
/etc/rc.d/init.d/sshd restart
Now, no one will be able to login to root with out first loggin in as admin and su - to root. You have now taken care of one serious problem of Linux. So relax.
[p.s. -> Do take care of the two passwords yourself or else you will be caught in your own net ]
[Source: ipfinity.com]
Tags: Computer Security, How to Disable Direct Root Login, Linux, prevent hackers to gain access as root
January 2, 2009: 8:23 pm
Nice information, thanks. I archived that code althought I dont have hosting company |
xHumanHealth