【发布时间】:2018-04-29 05:50:11
【问题描述】:
我正在尝试为 gcloud 实例设置新的 ssh 密钥。我按照此处的说明逐字执行 (https://cloud.google.com/compute/docs/instances/adding-removing-ssh-keys),生成一个新密钥,将带有我的用户名的公共 rsa-ssh 密钥放在 Google Cloud Platform 界面中元数据选项卡的 SSH 密钥部分,并为我的使用 chmod 的公钥和私钥。
在尝试使用 -vvv 详细标志进行 ss 时,我收到如下错误:
...
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /Users/erickofman/.ssh/salsadb
debug3: send_pubkey_test
debug3: send packet: type 50
debug2: we sent a publickey packet, wait for reply
debug3: receive packet: type 51
debug1: Authentications that can continue: publickey
debug2: we did not send a packet, disable method
debug1: No more authentication methods to try.
Permission denied (publickey).
我(与同事)确保我的公钥包含在服务器的 .ssh 文件夹中的 authorized_keys 文件中。考虑到某些东西可能已经过时,我还尝试使用service sshd restart 重新启动 ssh 服务器,但无济于事。
我还尝试使用 gcloud 工具设置 ssh,结果相同。
据我所知,我拥有该网站的正确角色/权限。
这是日志在服务器端的样子:
admin@awesome-website:~$ tail /var/log/auth.log
Nov 15 20:40:16 awesome-website sshd[18846]: input_userauth_request: invalid user ekofman [preauth]
Nov 15 20:40:17 awesome-website sshd[18846]: Connection closed by 10.100.100.10 port 90001 [preauth]
Nov 15 20:41:17 awesome-website sshd[18848]: Connection closed by 200.200.20.20 port 90002 [preauth]
一直在努力解决这个问题,非常感谢任何帮助!
【问题讨论】:
-
“提供 RSA 公钥:/Users/erickofman/.ssh/salsadb.pub”stackoverflow.com/a/29948797/13317
-
@Kenster 糟糕,我粘贴了不正确的代码——我在使用私钥时得到了完全相同的错误,但是,我已经更新了帖子
-
debug3: authmethod_is_enabled publickey debug1: Next authentication method: publickey debug1: Offering RSA public key: /Users/erickofman/.ssh/salsadb debug3: send_pubkey_test debug3: send packet: type 50 debug2: we sent a publickey packet, wait for reply debug3: receive packet: type 51 debug1: Authentications that can continue: publickey debug2: we did not send a packet, disable method debug1: No more authentication methods to try. Permission denied (publickey). -
是否有其他用户可以使用密钥ssh?
-
是的,我的同事已经能够使用之前生成并添加的密钥,但是我们从头开始一起完成了相同的过程,现在他无法使用新密钥进行 ssh。
标签: authentication ssh instance gcloud public-key