gcloud ssh port change

1,760 views
Skip to first unread message

ip99...@gmail.com

unread,
May 14, 2015, 3:59:53 PM5/14/15
to gce-dis...@googlegroups.com
How to gcloud  compute ssh - to VM Instance when ssh port is changed (sshd_config?

Vaqar

unread,
May 15, 2015, 1:47:23 PM5/15/15
to gce-dis...@googlegroups.com
Hi, 

To specify the port when using gcloud compute, you will have to add the --ssh-flag to the command line. With this you can specify all the arguments that can be used with SSH. For example to connect on port 4561, the command would be:

gcloud compute ssh my_instance --zone us-central1-a --ssh-flag="-p 4561"

Make sure you have restarted the ssh service with:   sudo service ssh restart

Also keep in mind you will have to add a firewall rule on your network in the Developers Console to allow port 4561.

I hope this helps.
Reply all
Reply to author
Forward
0 new messages