ERROR: (gcloud.compute.ssh) [/usr/bin/ssh] exited with return code [255].

143 views
Skip to first unread message

Mansi Jain

unread,
Jun 21, 2017, 9:02:48 AM6/21/17
to gce-discussion
Unable to connect to gcloud instance.
We have two instances having same firewall rules but one is working while other isn't.
Please reply asap.
ssh: connect to host xxx.xxx.xxx.xx port 22: Connection timed out
ERROR: (gcloud.compute.ssh) [/usr/bin/ssh] exited with return code [255].

Faizan (Google Cloud Support)

unread,
Jun 21, 2017, 1:07:41 PM6/21/17
to gce-discussion
Hello Mansi,

You can go through instance serial console output to make sure instance has booted properly. Make sure the request is not getting blocked by GCE or instance firewall (e.g iptables, ufw etc). You can test if the port is open using the following command:

nmap INSTANCE-IP

If the port is open you can try to connect on port 22 using telnet to see if it successfully connects:

telnet INSTANCE-IP 22

In case the firewall is blocking the port you can change or disable the firewall on the instance through startup script e.g:

#!/bin/bash 
/usr/sbin/ufw allow 22/tcp

I hope that helps.

Faizan
Reply all
Reply to author
Forward
0 new messages