繁体   English   中英

谷歌云中的权限被拒绝(公钥)错误是否有任何解决方法?

[英]Is there any workaround for the permission denied (publickey) error in google cloud?

我目前正在 Google Cloud 中构建和保护网络:来自 Google Cloud Skills Boost 的挑战实验室。 我完成了 1-5 号挑战,但卡在了 6 号挑战中:

在 Compute Engine 实例页面中,点击堡垒主机的 SSH 按钮。 接通后,拨打 SSH 到 juice-shop。

在 SSH 到 bastion 之后,我输入ssh (IP address of juice-shop) ,但结果是Permission denied (publickey). 错误。 我尝试在 SSH 命令后键入 -v,这是执行后显示的内容:

OpenSSH_7.4p1 Debian-10+deb9u7, OpenSSL 1.0.2u  20 Dec 2019
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to 192.168.11.2 [192.168.11.2] port 22.
debug1: Connection established.
debug1: key_load_public: No such file or directory
debug1: identity file /home/student-04-e657ce74df3d/.ssh/id_rsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/student-04-e657ce74df3d/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/student-04-e657ce74df3d/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/student-04-e657ce74df3d/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/student-04-e657ce74df3d/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/student-04-e657ce74df3d/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/student-04-e657ce74df3d/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/student-04-e657ce74df3d/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.4p1 Debian-10+deb9u7
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* compat 0x04000000
debug1: Authenticating to 192.168.11.2:22 as 'student-04-e657ce74df3d'
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:T6OeQTHDWFMJTDZ8K02/glob0my9gLLdqH4IOJFIzwc
debug1: Host '192.168.11.2' is known and matches the ECDSA host key.
debug1: Found key in /home/student-04-e657ce74df3d/.ssh/known_hosts:1
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey after 134217728 blocks
debug1: pubkey_prepare: ssh_fetch_identitylist: invalid format
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519,ssh-rsa,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521>
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Trying private key: /home/student-04-e657ce74df3d/.ssh/id_rsa
debug1: Trying private key: /home/student-04-e657ce74df3d/.ssh/id_dsa
debug1: Trying private key: /home/student-04-e657ce74df3d/.ssh/id_ecdsa
debug1: Trying private key: /home/student-04-e657ce74df3d/.ssh/id_ed25519
debug1: No more authentication methods to try.
Permission denied (publickey).

After checking the .ssh folder, the only file in there is known_hosts , and the content is |1|Ufd+u5OJlKnZGrn7IXI2Bu/4XUs=|U1BWwkP97chmDwk/6E71T7UvKHM= ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBJuxpHVNlFCmVFiHVuq+wKn/WlMs9thpNHT2M8rExeTYeEbjq//qlHLkZFMyEXFKaLAaMVHCG1O5ohR+KRuugXU=

有没有其他人遇到同样的问题,或者有人有解决这个问题的方法吗? 任何帮助将不胜感激,谢谢。

在堡垒 SSH 中运行此命令。

gcloud 计算 ssh juice-shop --internal-ip

在此之后,将密码短语保留为空,然后按两次 enter,然后在 y/n 中按 y。 并检查您的进度。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM