Виртуальная машина Google Cloud Platform не может выполнить S SH с локального компьютера (в разрешении отказано (открытый ключ)) - PullRequest
0 голосов
/ 26 мая 2020

Я пробовал s sh на виртуальную машину Google Cloud с моего терминала MacBook, который вчера работал отлично. У меня есть ключи publi c и закрытые ключи, как я понимаю.

Когда я пытаюсь подключиться, как показано ниже,

XXXXXXXX-MacBook-Pro:~ xxxxxxxx$ ssh -i .ssh/id_rsa xxxxxxxx@12.345.678.910 -v

Отладка ошибок происходит как показано ниже. (Имена пользователей, IP-адрес и т. Д. c. Замаскированы)

OpenSSH_8.1p1, LibreSSL 2.7.3
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 47: Applying options for *
debug1: Connecting to 12.345.678.910 [12.345.678.910] port 22.
debug1: Connection established.
debug1: identity file .ssh/id_rsa type 0
debug1: identity file .ssh/id_rsa-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_8.1
debug1: Remote protocol version 2.0, remote software version OpenSSH_7.4p1 Debian-10+deb9u7
debug1: match: OpenSSH_7.4p1 Debian-10+deb9u7 pat OpenSSH_7.0*,OpenSSH_7.1*,OpenSSH_7.2*,OpenSSH_7.3*,OpenSSH_7.4*,OpenSSH_7.5*,OpenSSH_7.6*,OpenSSH_7.7* compat 0x04000002
debug1: Authenticating to 12.345.678.910:22 as 'xxxxxxxx'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: curve25519-sha256
debug1: kex: host key algorithm: ecdsa-sha2-nistp256
debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy
debug1: Host '12.345.678.910' is known and matches the ECDSA host key.
debug1: Found key in /Users/xxxxxxxx/.ssh/known_hosts:1
debug1: rekey out after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey in after 134217728 blocks
debug1: Will attempt key: .ssh/id_rsa RSA SHA256:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx explicit
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<ssh-xxxxx,ssh-rsa,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-xxxxxx,ecdsa-sha2-xxxxxx>
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering public key: .ssh/id_rsa RSA SHA256:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx explicit
debug1: Authentications that can continue: publickey
debug1: No more authentication methods to try.
xxxxxxxxxx@12.345.678.910: Permission denied (publickey).

«Ключ хоста сервера» и «Предлагаемый ключ c publi: .ssh / id_rsa RSA» были разными. Однако я скопировал и вставил .ssh / id_rsa.pub со своего локального компьютера, и к авторизованным_keys в виртуальной машине Google Cloud был прикреплен тот же ключ publi c.

Что вызывает это и как это исправить?

...