为非 root 用户禁用 SSH

4 remote-access ssh

如何通过 ssh 禁用非 root 用户的远程访问?如果可能,我想按需执行此操作。

Mik*_*ike 8

每个人都在以艰难的方式这样做..他说拒绝所有非root用户..所以只需编辑

/etc/ssh/sshd_config
Run Code Online (Sandbox Code Playgroud)

添加以下内容

AllowGroups wheel root
Run Code Online (Sandbox Code Playgroud)

然后重启ssh

轮组或根组中的任何人都将被允许通过 ssh 登录