【发布时间】:2014-06-02 11:50:14
【问题描述】:
我正在使用 PuTTY 访问我自己的云服务器。我可以使用用户名和密码登录。但是当我尝试使用我生成的公钥/私钥登录时,我收到“服务器拒绝我们的密钥”消息。以下是我使用的步骤 (https://askubuntu.com/questions/306798/trying-to-do-ssh-authentication-with-key-files-server-refused-our-key):
-Generated a key pair with puttygen.exe (length: 2048 bits)
-Loaded the private key in the PuTTY profile
-Entered the public key in ~/.ssh/authorized_keys in one line
-# chmod 700 ~/.ssh
-# chmod 600 ~/.ssh/authorized_keys
-Changed /etc/ssh/sshd_config so it contains AuthorizedKeysFile %h/.ssh/authorized_keys
-# sudo service ssh restart
当我尝试此配置时,我收到“服务器拒绝我们的密钥”消息,输入密码后,我可以登录。但是,为什么我会收到这条消息?
【问题讨论】: