[英]Google Cloud Platform - SSH/Telnet
I am running apps on Compute Engine. 我正在Compute Engine上运行应用程序。 I run on a Windows box and use Putty to connect to the CE. 我在Windows框上运行,并使用Putty连接到CE。 This pretty much seems to work fine (leaving aside the problems in the Google doc on this). 这看起来似乎很好用(将Google文档中的问题排除在外)。
I have set up another user who I want to enable for SSH (on a Mac) and have her use FileZilla to push files to the CE. 我设置了另一个要在Mac上启用SSH的用户,并让她使用FileZilla将文件推送到CE。
I am trying it out on my own Mac. 我正在自己的Mac上试用。 I set up 2 firewall rules with 2 different priorities for tcp:22 = 我为tcp:22 =设置了2个具有2个不同优先级的防火墙规则
myssh Apply to all IP ranges: 0.0.0.0/0 tcp:22 Allow 1000 default
default-allow-ssh Apply to all IP ranges: 0.0.0.0/0 tcp:22 Allow 65534 default
The user has permissions on of the Project of: "Compute Instance Admin(v1)" 用户具有以下项目的权限:“计算实例管理员(v1)”
On the Mac terminal I do the following: 在Mac终端上,执行以下操作:
ssh-keygen -t rsa -f ~/.ssh/userfirstname-ssh-key -C [googleusername.gmail.com]
I go to the GCP CE Meta data (logged in as myself) and then copy the contents of the userfirstname-ssh-key.pub to the Metadata/SSH Keys and save. 我转到GCP CE元数据(以我自己的身份登录),然后将userfirstname-ssh-key.pub的内容复制到元数据/ SSH密钥并保存。
After GCP gives the ok on the key being added I enter the following in the Mac terminal: 在GCP确认添加的密钥正确后,我在Mac终端中输入以下内容:
ssh -i [userfirstname]-ssh-key [googleusername.gmail.com]@gcp-external-ip
Depending on i-don't-know-what, sometimes it says "Permission denied (public key)", "Operation timed out" 根据我不知道的内容,有时会显示“权限被拒绝(公共密钥)”,“操作超时”
I've repeated this a few times and just tried to telnet in to the gcp-external-ip and get "Operation timed out" telnet: Unable to connect to remote host. 我已经重复了几次,只是尝试通过telnet进入gcp-external-ip并获取“操作超时” telnet:无法连接到远程主机。
At a complete loss. 不知所措。 Please help. 请帮忙。
You could (and should) use the gcloud
command line tools. 您可以(并且应该)使用gcloud
命令行工具。 Then it is easiest to simple copy the correct gcloud command from the Web Console. 然后,最简单的方法是从Web控制台简单地复制正确的gcloud命令。 There is a little drop-down menu next to 'SSH' for each of your instances. 每个实例的“ SSH”旁边都有一个下拉菜单。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.