我在用着适用于 Windows 的 PuTTY连接到 dreamcompute-VPS(dreamhost)。在 dreamcompute 面板上,我创建了一个私钥并下载了它,.pem文件。使用PuTTYgen,我将此文件转换为.ppkSSH2-RSA。因此,我下载了选美比赛并添加了这个.ppk文件。在PuTTY工具,我将其作为主机名从 DreamCompute 面板获取的浮动 IP,设置用户名在Connection->Data
dhc-用户最后,加载.ppk文件位于Connection->SSH->Auth
。问题是当我打开连接时,身份验证过程不断要求我输入密码。我遗漏了什么?难道不应该只有用户名和密钥吗?
日志:
=~=~=~=~=~=~=~=~=~=~=~= PuTTY log 2015.07.21 15:08:26 =~=~=~=~=~=~=~=~=~=~=~=
Event Log: Writing new session log (SSH raw data mode) to file: C:\Users\User\Desktop\putty.log
Event Log: Looking up host "173.236.254.75"
Event Log: Connecting to 173.236.254.75 port 22
Event Log: Server version: SSH-2.0-OpenSSH_6.6.1p1 Ubuntu-2ubuntu2
Event Log: We believe remote version has SSH-2 channel request bug
Event Log: Using SSH protocol version 2
Event Log: We claim version: SSH-2.0-PuTTY_Release_0.64
Event Log: Doing Diffie-Hellman group exchange
Event Log: Initialised AES-256 SDCTR client->server encryption
Event Log: Initialised HMAC-SHA-256 client->server MAC algorithm
Event Log: Initialised AES-256 SDCTR server->client encryption
Event Log: Initialised HMAC-SHA-256 server->client MAC algorithm
Event Log: Reading private key file "C:\Users\User\Desktop\private.ppk"
Event Log: Pageant is running. Requesting keys.
Event Log: Pageant has 1 SSH-2 keys
Event Log: Pageant key #0 matches configured key file
Event Log: Trying Pageant key #0
Event Log: Server refused our key
答案1
主要问题在这里:
事件日志:服务器拒绝我们的密钥
这可能是由于 的权限不正确.ssh/authorized_keys
或密钥无效造成的。
可以使用以下方法解决权限问题:
chmod -R go-rwx ~/.ssh
另一种可能性是密钥错误。您必须将公钥附加到 ~/.ssh/authorized_keys 上,而不是私钥。检查是否存在正确的密钥。