Tuesday, 25 June 2013

How to Limit SSH User Logins in linux

You have large number of user accounts on the systems, then it makes sense that we limit remote access to those users who really need it.
 

Open the config file

 # vim /etc/ssh/sshd_config

and Add an AllowUsers line at the bottom of the file with a space separated by list of usernames.

AllowUsers jeffin ctechz

Restart ssh service # service sshd restart


Note: If you are not able to login into the shell using root account after changing PermitRootLogin to YES, check AllowUsers either remove the line or add root also here.

No comments:

Post a Comment