是否可以禁用对用户的 PASSWORD SSH 访问,但允许基于每个用户的密钥身份验证?我的意思是,我有一个 userA,我不想给他提供基于密码的访问权限,但我不想他只使用密钥身份验证来访问服务器。谢谢
ste*_*tew 51
您可以添加“匹配”部分以匹配 sshd_config 底部的特定用户或组,例如:
Match user stew
PasswordAuthentication no
Run Code Online (Sandbox Code Playgroud)
或者
Match group dumbusers
PasswordAuthentication no
Run Code Online (Sandbox Code Playgroud)