我想在标题中分享我的问题答案,我很快就找不到.
有很多主题如何禁用密码验证:
UsePam yes # it will not be used
ChallengeResponseAuthentication no
PasswordAuthentication no
kbdInteractiveAutentication no
Run Code Online (Sandbox Code Playgroud)
但没有主题如何为特定用户启用:
Match User myuser
PasswordAuthentication yes
KbdInteractiveAutentication yes
Run Code Online (Sandbox Code Playgroud)
测试sshd配置的有用命令是:
sshd -T -C user=myuser,host=127.1,addr=127.1
Run Code Online (Sandbox Code Playgroud)
请注意,"127.1"不适用于每个系统,因此您可能需要在此处粘贴127.0.0.1.
openssh ×1