使用 ssh 连接远程服务器时出错

使用 ssh 连接远程服务器时出错

我正在尝试访问远程服务器:这是我的 ssh 命令,如下所示-

bitech@hdpedge01:~/.ssh$ ssh [email protected] -i ~/.ssh/id_rsa -v

我收到权限被拒绝错误:

OpenSSH_6.0p1 Debian-4+deb7u6, OpenSSL 1.0.1t  3 May 2016
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to 151.252.41.105 [151.252.41.105] port 22.
debug1: Connection established.
debug1: identity file /home/bitech/.ssh/id_rsa type -1
debug1: identity file /home/bitech/.ssh/id_rsa-cert type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.6.1p1 Ubuntu-2ubuntu2.8
debug1: match: OpenSSH_6.6.1p1 Ubuntu-2ubuntu2.8 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.0p1 Debian-4+deb7u6
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-md5 none
debug1: kex: client->server aes128-ctr hmac-md5 none
debug1: sending SSH2_MSG_KEX_ECDH_INIT
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: DSA 28:64:63:b2:91:98:78:db:f9:4f:b3:32:f1:a4:39:27
debug1: Host '151.252.41.105' is known and matches the DSA host key.
debug1: Found key in /home/bitech/.ssh/known_hosts:3
debug1: ssh_dss_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Trying private key: /home/bitech/.ssh/id_rsa
debug1: key_parse_private_pem: PEM_read_PrivateKey failed
debug1: read PEM private key done: type <unknown>
Enter passphrase for key '/home/bitech/.ssh/id_rsa':
debug1: key_parse_private_pem: PEM_read_PrivateKey failed
debug1: read PEM private key done: type <unknown>
Enter passphrase for key '/home/bitech/.ssh/id_rsa':
debug1: key_parse_private_pem: PEM_read_PrivateKey failed
debug1: read PEM private key done: type <unknown>
Enter passphrase for key '/home/bitech/.ssh/id_rsa':
debug1: key_parse_private_pem: PEM_read_PrivateKey failed
debug1: read PEM private key done: type <unknown>
debug1: No more authentication methods to try.
Permission denied (publickey).

我不明白如何调试这个错误。我尝试使用ssh-keygen -f id_rsa -p命令更改密码,但它总是给我 Bad passphrase error

答案1

这些错误表明您尝试打开的内容未被识别为 OpenSSH 可以读取的私钥。

debug1: Trying private key: /home/bitech/.ssh/id_rsa
debug1: key_parse_private_pem: PEM_read_PrivateKey failed
debug1: read PEM private key done: type <unknown>
Enter passphrase for key '/home/bitech/.ssh/id_rsa':

有一个已知错误,这将在下一版本中修复。简而言之,某些版本的 OpenSSH 将所有错误都表示为“错误的密码”,这可能会让用户感到非常困惑。

你的钥匙是什么样的?你从哪里得到那个的?

相关内容