SSH 忽略密钥文件,错误地要求输入密码

rid*_*ter 5 ssh ssh-keys

对于工作,我通过 SSH 连接到服务器。我已经几个月没有这样做了,所以现在要求我输入密码的地方发生了一些变化。以前,经过身份验证后它会起作用。这是我通常写入 ssh 的内容:ssh -p2222 username@123.12.123.123

我查看了调试信息,它表明服务器甚至没有要求提供适当的密钥文件。相反,它首先提供一个我删除的公钥 (id_rsa)..然后它变成了私钥......然后它要求输入一个我不需要的密码。

debug1: Found key in /Users/myname/.ssh/known_hosts:40
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,gssapi-with-mic,password
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /Users/myname/.ssh/id_rsa
debug1: Authentications that can continue: publickey,gssapi-with-mic,password
debug1: Trying private key: /Users/myname/.ssh/id_rsa
debug1: Trying private key: /Users/myname/.ssh/id_dsa
debug1: Next authentication method: password
Run Code Online (Sandbox Code Playgroud)

但是,当我指定身份文件时,它可以工作:ssh -i ~/.ssh/correctkey username@123.12.123.123

这些错误是什么意思,如何在不提示输入密码的情况下让 ssh 正常工作? 这很重要,因为我使用名为Fugu 的GUI——唯一可用的 SCP 的 GUI——而且我不能在其中使用 -i 选项!

等式的服务器端有什么我需要修复的吗?

谢谢!

Zif*_*ion 1

只需将带有键的文件名称更改为默认值即可。

~/.ssh/correctKey --> ~/.ssh/identity (on client machine)
~/.ssh/correctKey.pub --> ~/.ssh/identity.pub (on server machine)
Run Code Online (Sandbox Code Playgroud)

那不可能吗?