在 Linux (Debian Squeeze) 上,我想对某些用户(选定组或除 root 之外的所有用户)禁用使用密码的 SSH 登录。但我不想为他们禁用使用证书登录。
编辑:非常感谢详细的回答!出于某种原因,这在我的服务器上不起作用:
Match User !root
PasswordAuthentication no
Run Code Online (Sandbox Code Playgroud)
...但可以很容易地替换为
PasswordAuthentication no
Match User root
PasswordAuthentication yes
Run Code Online (Sandbox Code Playgroud)