如何从 GCP ssh 到另一台服务器

How to ssh to another server from GCP

我需要从 Google Cloud Build 使用 SSH 连接到另一台服务器。我试试 运行 这个。但它不起作用。 echo ${_KEY_STAGING} >> keyStaging && ssh -i keyStaging phihoang@${_SERVER_STAGING} -p 2222

根据您收到的错误消息:

 Permissions 0644 for '/Users/tudouya/.ssh/vm/vm_id_rsa.pub' are too open. It is required that your private key files are NOT accessible by others

需要运行以下命令

chmod 600 /Users/tudouya/.ssh/vm/vm_id_rsa.pub

此命令必须由用户 tudouya 执行,并且会删除其他用户的访问权限,从而解决您的问题。