无法再通过 sshd 登录

无法再通过 sshd 登录

我已经使用 SSH 很长时间了,但最近我需要在我的设置中添加另一个用户。我按照在网上找到的一些说明进行操作,并进行了以下操作。

adduser sam
sudo nano /etc/ssh/sshd_config
     AllowUsers michael, sam
sudo reboot

我完全设置了用户 sam,将允许用户添加到 sshd 配置并重新启动。现在 michael 是 sudoer,但有趣的是,我可以使用 Sams 凭据通过 ssh 登录,但 michaels 却不能了。

有任何想法吗?

答案1

来自man sshd_config

AllowUsers
This keyword can be followed by a list of user name patterns, separated by spaces.

然后,你的线路必须采用以下形式:

AllowUsers michael sam

相关内容