如果我已经在控制台上login,则仅发生ssh rsa密钥身份validation

无法解决这个问题 – 我们使用基于id_rsa密钥的身份validation到我们的服务器(大约400台Linux和UNIX服务器)。

在这种情况下,我有3个相同的服务器,最近安装了3个Ubuntu 12.04 – svr1 svr2 svr3。

他们是IBM刀片服务器,所以我有能力login到远程控制台。

对于svr1我可以很好地使用我的rsa密钥ssh – 它看起来像这样从客户端ssh -vvv:

debug3: authmethod_is_enabled publickey debug1: Next authentication method: publickey debug1: Offering RSA public key: /home/mbubb/.ssh/id_rsa debug3: send_pubkey_test debug2: we sent a publickey packet, wait for reply debug1: Server accepts key: pkalg ssh-rsa blen 279 

和环境variables设置,我在…

但对于svr2(和3),看起来像这样:

 debug3: authmethod_is_enabled publickey debug1: Next authentication method: publickey debug1: Offering RSA public key: /home/mbubb/.ssh/id_rsa debug3: send_pubkey_test debug2: we sent a publickey packet, wait for reply debug1: Authentications that can continue: publickey debug1: Offering DSA public key: /home/mbubb/.ssh/id_dsa 

它循环其他关键选项,最后:

  debug2: we did not send a packet, disable method debug1: No more authentication methods to try. Permission denied (publickey). 

奇怪的是,如果我通过Bladecenter MM进行安全控制,然后SSH服务器工作正常。

查看svr2上的/var/log/auth.log,当我得到“权限被拒绝”时,没有条目。 它似乎没有“看到”的尝试。

我检查了目录权限(homedir和sshdir)是否一致。 我比较了/ etc / ssh / sshd_config – 它们是相同的。

也许这是PAM? 或另一个级别的authentication。

我对此感兴趣 – 显然这里有一些基本的东西,我没有得到…

如果您使用的是encryption主目录,则修复方法是通过设置来设置备用authorized_keys位置

 AuthorizedKeysFile /etc/ssh/%u/authorized_keys 

在服务器的sshd_config文件,所以它看起来不是用户的文件的主目录。

该文件可以位于任何地方,但是必须有%u将用户的文件分隔到自己的目录中,这样sshd才能find目录和文件的适当权限。