last day (14 days later) » 

9:20 AM
0
A: how to control users login on Linux machine according to configuration file

candymanuunano /etc/ssh/sshd_config Append following names (directives): DenyUsers User1 User2 WhatEverYouLike DenyGroups root finadmin WhatEverYouLike Save, restart sshd

 
but if I have 1000 users to deny?
in this case I need to set 1000 users in one line ?
 
put all users to a group, DeniedUsersGroup or something else, and add the group name to sshd_config ... that's why I gave you both choices ... denyUsers and denyGroups ... so you can choose what is the best option for you
you only need to add the denied users (disable 0 as per your initial post). The users that are allowed, do not put them in sshd_config
 
sorry but - its not clear -:( , can you please re edit your post and described exactly waht need to set in files in order to disable user?
 
ok, let's take it one step at a time. How many users you need to allow and how many users you need to block?
 
user Uhdwe - allow and user Wfdxdswh is block
hi there - how are you
any body here?
hi
 
9:30 AM
hi
i`m here now
so, edit sshs_config file and add user Wfdxdswh
nano /etc/ssh/sshd_config
DenyUsers Wfdxdswh
save file
restart sshd
after that, user Wfdxdswh should not be able to logon via ssh
 

last day (14 days later) »