ssh direct login restriction

General support questions
Post Reply
nitin.jadhav
Posts: 9
Joined: 2018/10/03 09:39:31

ssh direct login restriction

Post by nitin.jadhav » 2018/10/17 09:53:47

Hi,
How to disable direct ssh login for particular user.
for example. I have two user access, one of it should allow me to connect ssh user1@a.b.c.d and for other user i can simply su - user2.
It should not allow to me ssh user2@a.b.c.d

hunter86_bg
Posts: 2019
Joined: 2015/02/17 15:14:33
Location: Bulgaria
Contact:

Re: ssh direct login restriction

Post by hunter86_bg » 2018/10/17 10:16:11

You can edit '/etc/ssh/sshd_config' and use any of the following examples:

Code: Select all

AllowUsers user1 user2
DenyUsers user1 user2 user3
DenyGroups group1 group2
In order to verify your new configuration run one of the following:

Code: Select all

sshd -t
sshd -T
After that you can just restart/reload your sshd

Post Reply