LearnToGrow
LearnToGrow

Reputation: 1778

SSH connection from gcloud instance to local machine

I want to connect from the google cloud machine to my computer using SSH but I get this error.

ssh filename username@ip:path_to_save_file_on_my_computer

ssh: connect to host 10.180.x.x port 22: Connection timed out lost connection

Upvotes: 0

Views: 847

Answers (1)

Shaiq
Shaiq

Reputation: 529

I will assume that you trying to connect from local machine to an instance which would be the normal case. Let me know if you are looking for a different scenario.

You can connect to instances that do not have external IP addresses by following any method from the article .

Additionally keep in mind that your Google Cloud Platform VPC network must have one or more firewall rules that allow SSH connections on port 22. The firewall rules must allow SSH connections for the IP ranges or specific IP addresses from which you want to connect.

In case your GCE VM does have an external IP, I would recommend connecting using "gcloud compute SSH", since once Cloud SDK has been setup, it will create automatically the necessary keys to access the VMs.

Upvotes: 0

Related Questions