Gitlab避免用户通过SSH登录

Gitlab avoid user login via SSH

当我在 Gitlab 上创建用户时,它会在 linux 上创建一个普通用户,并且它可以使用与用户相同的密码使用普通 SSH 协议登录。

如何禁止使用 SSH 登录所需用户的 SSH 登录?我所有的服务器都暴露给那些用户。

谢谢

编辑 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