2004-10-11, 07:29 AM
(This post was last modified: 2008-10-25, 09:13 AM by Dungeon-Dave.)
why would you do this ? well everyone knows that 'root' (the username) is the admin of your box, so by denying 'root' remote access to ssh into your box you are making it just a wee bit harder for the hackers to get into your box since now they will have to guess a username on your box.
1. As root,
Code:
vi /etc/ssh/sshd_config
2. In there find (or create) a line that reads
Quote:# Authentication:#LoginGraceTime 120
PermitRootLogin no
#StrictModes yes
The line PermitRootLogin no is the important one. Note there is no # in front of it.
3. Once you have made thos changes, save the file (esc then :wq).
4. Restart sshd (service sshd restart).
With this line root cannot ssh into the box. To become root, ssh in as a normal user then use su - to become root once logged in.
cheers
anyweb