PDA

View Full Version : blocking ssh for a particular user


jithesh
4th May 2006, 10:41
can any one tell me how to block a particular users ssh login.But when he logs in locally it should happen.
thank you

falko
4th May 2006, 12:03
If the user has a static IP address, you can add

sshd: 12.34.56.78

to /etc/hosts.deny. Replace 12.34.56.78 with the user's static IP address.

santhanamt
26th March 2009, 13:29
vim /etc/ssh/sshd_config

# To allow only certain users >> Allows only user1 and user2 to login via SSH

AllowUsers user1 user2 user3

# To block certain users >> Blocks only user5 and user6

DenyUsers user5 user6

topdog
26th March 2009, 17:27
You can use allowed group as well, that way you just add users to the group.

AllowGroups <group_name>