Is it possible to use the Google Cloud Shell via a ssh?

本小妞迷上赌 提交于 2019-11-28 18:57:13

问题


Is it possible to connect to the Google Cloud Shell instance via the ssh? Maybe somehow with gcloud? So I can use it with my favorite terminal (iTerm in particular) and not with the Web-based shell.

Answer: yes it is now been possible: https://cloud.google.com/blog/products/gcp/introducing-the-ability-to-connect-to-cloud-shell-from-any-terminal


回答1:


Yes. From the gcloud CLI, run gcloud alpha cloud-shell ssh. This will establish an interactive SSH session with Cloud Shell.

Note, this command may change once this feature graduates from Alpha.

Reference:

  • gcloud alpha cloud-shell ssh



回答2:


You can connect to a vpn from the cloud shell, put the needed binary in your home directory and write the necessary startup scripts (connect to vpn and start daemon etc) on top of the .bashrc file so that it get executed when you start the shell from your browser.

I also suggest to use mosh becasue routing this way is pretty terrible and maybe run ssh cipherless since the vpn is already encrypted.

You could also cobble the heartbeat to keep the shell alive but that's probably too much in abuseland, having a pinned tab for the cloud shell seems good enough to me.



来源:https://stackoverflow.com/questions/41324702/is-it-possible-to-use-the-google-cloud-shell-via-a-ssh

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!