如何在 CentOS 5.7 上允许密码认证或密钥认证?

Dar*_*ren 3 ssh rsa keys

是否可以在 CentOS 5.7 中启用密码认证或密钥认证?我能找到的只是将 PasswordAuthentication 设置为 no ,这会强制使用密钥...

谢谢

Sha*_*den 7

禁用PasswordAuthentication不会强制使用密钥,它会禁用密码身份验证,正如宣传的那样。

PubkeyAuthentication 确定是否允许密钥认证。

因此,要直接回答您的问题,以下配置允许密码或密钥身份验证:

PasswordAuthentication yes
PubkeyAuthentication yes
Run Code Online (Sandbox Code Playgroud)


qua*_*nta 6

你的意思是你想要这样的东西:

Match User user1
    PasswordAuthentication no
    RSAAuthentication yes
    PubkeyAuthentication yes

Match User user2
    PasswordAuthentication yes
    RSAAuthentication no
    PubkeyAuthentication no
Run Code Online (Sandbox Code Playgroud)