Search This Blog

Monday, March 14, 2011

Limit user login & disable login by root

- Step 1: Create banner-ssh for all server (5 min.)
vi /etc/ssh/banner-ssh.txt
You can not acess ssh by root user to server. Please using another user


- Step 2: Config sshd_config file (1 day)
vi /etc/ssh/sshd_config
…..
#Banner
Banner /etc/ssh/banner-ssh.txt
…..
(end of sshd_config file)
###################################
# DeneyUsers modified by Your Users ##
###################################
DenyUsers ALL
###################################
# AllowUsers modified by User ########
###################################
AllowUsers User1@ipaddress User2@ipaddress User3@ipaddress UserVPN@192.168.90.0/24

save & exit sshd_config file
restart ssh: rcsshd restart

-Step5: check result
When you try ssh you will receive warning text:

You can not acess ssh by root user to this server. Please using another user

No comments:

Post a Comment