these are the steps I followed to change the default ssh port
- login to compute engine instance using gcutil ssh
- cd /etc/ssh
- sudo nano sshd_config –> changed the port to some number lets say for the example: 1111
- saved and exit
- sudo service ssh restart —> [ ok ] Restarting OpenBSD Secure Shell server: sshd.
- open a new terminal and repeated step 1 —> ssh: connect to host xxx.xxx.xxx.xxx port 22: Connection refused —-> the change succeded
- went to my GCE console and added a firewall with the tcp:1111
-
tried to connect again with gcutil ssh —> ssh: connect to host xxx.xxx.xxx.xxx port 22: Connection refused
I'm not following why after enabling the port 1111 on the GCE gcutil ssh still tries to connect on port 22INFO: Running command line: ssh -o UserKnownHostsFile=/dev/null -o CheckHostIP=no -o StrictHostKeyChecking=no -i /Users/MyUser/.ssh/google_compute_engine -A -p 22 MyUser@xxx.xxx.xxx.xxx —
what am i missing? should I download my ssh key again after changing the port? and if so how do i do that?
Best Answer
The documentation clearly states how to provide an alternate ssh port for
gcutil ssh
.in your case: