当我在Gitlab上创建用户时,它会在linux上创建一个普通用户,并且可以使用与用户相同密码的常规SSH协议进行登录。
如何使用SSH禁用所需用户的SSH登录?我的所有服务器都向这些用户公开。
谢谢
答案 0 :(得分:2)
修改添加此行的sshd_config
文件
DenyUsers username1 username2 username3 username4
DenyUsers separated by spaces. Login is disallowed for user names that match one of the patterns. â*â and â?â can be used as wildcards in the patterns. Only user names are valid; a numerical user ID is not recognized. By default, login is allowed for all users. If the pattern takes the form USER@HOST then USER and HOST are separately checked, restricting logins to particular users from particular hosts.
了解详情:http://linuxpoison.blogspot.com/2008/08/how-to-deny-ssh-access-for-certain-user.html#ixzz3QkT71bsV