royong
20-04-2006, 00:55
Disclaimer :: While I take precaution to avoid any unnecessary errata, the reader is advised to perform his / her own backups. I accept no warranties, expressed or implied, with regards to any malfunction, damage, loss, deletion, removal etc. of any form, nor shall I be liable for any damages. This HOWTO has been tested on machines running Red Hat 7.3 - but as usual you are expected to practice due diligence.
This HOWTO disables the direct root login. You will need to login as another user first before you can "su -" to root. This other user must not be a virtual user. In this sense, it should be an OS level user - not virtual user.
Log into the server and as ROOT perform the following :-
# vi /etc/ssh/sshd_config
################################################## ##########
Find the line
#Protocol 2,1
Change it to
Protocol 2
Find the line
#PermitRootLogin Yes
Change it to
PermitRootLogin No
Find the line
#LoginGraceTime 600
Change it to
LoginGraceTime 300
Find the line
X11Forwarding yes
Change it to
X11Forwarding no
################################################## ##########
Save and Exit
:wq
We will now need to restart the SSHD service
# service sshd restart
# exit
This will log you out of the server. Now try logging in again. This time we will need to use another account other than Root to login. Direct login to the server has been disabled.
This HOWTO disables the direct root login. You will need to login as another user first before you can "su -" to root. This other user must not be a virtual user. In this sense, it should be an OS level user - not virtual user.
Log into the server and as ROOT perform the following :-
# vi /etc/ssh/sshd_config
################################################## ##########
Find the line
#Protocol 2,1
Change it to
Protocol 2
Find the line
#PermitRootLogin Yes
Change it to
PermitRootLogin No
Find the line
#LoginGraceTime 600
Change it to
LoginGraceTime 300
Find the line
X11Forwarding yes
Change it to
X11Forwarding no
################################################## ##########
Save and Exit
:wq
We will now need to restart the SSHD service
# service sshd restart
# exit
This will log you out of the server. Now try logging in again. This time we will need to use another account other than Root to login. Direct login to the server has been disabled.