在Google Cloud控制台的项目IAM页面上,我已经明确地添加了我的用户名,并赋予了“计算实例管理员(v1)”角色,但我仍然无法连接到一些通过自动化创建的实例。
[username]:~/src/infrastructure$ gcloud compute ssh [instance id]
Unauthorized use is strictly prohibited. All access and activity
is subject to logging and monitoring.
Permission denied (publickey).
ERROR: (gcloud.compute.ssh) [/usr/bin/ssh] exited with return code [255].
我似乎只能连接由我创建的实例。
可能出了什么问题?
顺便提一下,根据这份文档,我应该能够手动将我的RSA公钥添加到实例中,然后使用SSH进行连接。
我已将我的公钥从〜/ .ssh / google_compute_engine.pub
添加到实例元数据中,但尝试使用SSH时没有成功。
[username]:~/src/infrastructure$ ssh -i ~/.ssh/google_compute_engine [public ip of instance]
Unauthorized use is strictly prohibited. All access and activity is subject to logging and monitoring.
Received disconnect from 35.197.127.143 port 22:2: Too many authentication failures for matts
Connection to 35.197.127.143 closed by remote host.
Connection to 35.197.127.143 closed.
按照谷歌的建议,我不想手动管理实例访问的SSH密钥。我希望gcloud compute ssh
能够正常工作,因此我对第二个故障不太关注(除非它们有关联)。