I have problem with a google cloud virtual machine Suddenly I am not able to acces to my VM instance from google cloud: it returs me: ssh: connect to host port 22: Connection refused
I have run nmap and outputs Host is up. PORT STATE SERVICE 22/tcp filtered ssh
I have modified the /etc/ssh/ssh_config, to prevent broken pip error, adding :
ServerAliveInterval 120
ServerAliveCountMax 10
to the end of that file .
1.: May anyone figuer out what is happening and how to solve it.
thanks so much
Summary from the comments above:
If you've never set a password for either your user or root you'll be asked twice for a new password, if you've set a password before you'll be asked first for the old password and then twice for the new password, so take this in account when using the startup script. As explained here the script to set the password can be run with or without --stdin parameter depending on the system you run the script on.
Access the instance via Interactive Serial Console.
Revert the settings on the file /etc/ssh/ssh_config
back to the old config and try to ssh again.
Important note, for security reasons remove the startup script and change the password from within the instance once you regain access to the instance.