1我已经configuration了Ubuntu密钥authentication服务器,它工作正常。 我已经禁用了密钥validation以使密钥validation正常工作。 服务器总是通过远程terminal或腻子进行访问。
现在所有用户帐户都可以使用身份validation密钥和密码login。 但是现在我只想创build一个没有密钥validation的新用户。 那么我应该怎么做呢
但另一方面,这不应妨碍正在使用密钥authentication的其他用户。
首先,在sshd_config中允许使用密码validation并不妨碍使用密钥。 两者都可以共存,没有问题。
至于只允许用户进行密码validation,您应该使用Match组部分:
Match User foo PasswordAuthentication yes
如果你的用户名为foo 。
我很好奇,为什么在configuration公钥authentication时必须禁用密码authentication。 在默认密码之前,SSH将尝试所有其他身份validation机制。 这使您可以有select地使用某些帐户的密钥和其他密码。
下面,你可以看到5个不同的身份validation方法在密码之前被尝试:
ssh -v test01 ... debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password debug1: Next authentication method: gssapi-keyex debug1: No valid Key exchange context debug1: Next authentication method: gssapi-with-mic debug1: Unspecified GSS failure. Minor code may provide more information Credentials cache file '/tmp/krb5cc_2078676' not found debug1: Unspecified GSS failure. Minor code may provide more information Credentials cache file '/tmp/krb5cc_2078676' not found debug1: Unspecified GSS failure. Minor code may provide more information debug1: Unspecified GSS failure. Minor code may provide more information debug1: Next authentication method: publickey debug1: Offering public key: /home/skohrs/.ssh/id_rsa debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password debug1: Trying private key: /home/skohrs/.ssh/identity debug1: Trying private key: /home/skohrs/.ssh/id_dsa debug1: Next authentication method: password skohrs@test01's password: debug1: Authentication succeeded (password). ...