SSH 公钥认证错误

SSH 公钥认证错误

我正在尝试使用私钥文件 id_rsa ssh 到远程机器,但是,我收到了错误:

$ ssh -v -i id_rsa user@remote
[...]
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,password
debug1: Next authentication method: publickey
debug1: Offering RSA public key: id_rsa
debug1: Authentications that can continue: publickey,password
debug1: No more authentication methods to try.
Permission denied (publickey,password).

为何我的权限被拒绝?

答案1

您是否复制了公钥?根据您使用的操作系统,您可能可以使用:

ssh-copy-id -i .ssh/id_rsa.pub user@remote

当然,您需要在远程系统上提供密码验证才能执行此操作,以便您可以在那里复制您的公钥。

杰夫

相关内容