Reputation: 1
I cannot ssh into Google compute engine instance. Here is scenario.
I tried to ssh into an instance from ubuntu ssh client, so generated a private & public key in my local and added pubkey to metadata.
But got Permission denied (publickey)
error message and the instance console was saying No space left on device
I then increased the size of the instance by 100GB more and then restart the instance.
After few mins later, tried to ssh into the instance again and getting the Permission denied (publickey)
error again and the console said No usable temporary directory found in ['/tmp', '/var/tmp', '/usr/tmp', '/']
Now I can't connect to the instance by any tool such as browser console, ssh client etc.
Is there any solution to address this problem?
Thanks in advance.
Upvotes: 0
Views: 1710
Reputation: 57
A complete tutorial is linked: https://youtu.be/HSBTnfDsVRs
In this video, I talked about how to SSH into GCP using Windows Terminal. There are three methods to do so:
Access via Chrome Access via Command Prompt Access via a custom Windows Terminal tab (best!!) Process for Chrome:
Open Google Chrome
Type "https://console.cloud.google.com/
"
And you can access it!!
Process for Installing Google Cloud SDK:
Install Google Cloud SDK (https://cloud.google.com/sdk/docs/downloads-interactive) Click "Next" Click "I Agree" It's installed!! Process for Command Prompt (via PuTTy):
Open Windows Terminal
Then, open Command Prompt
Type "gcloud cloud-shell ssh"
And you can access it!!
Process for a custom Windows Terminal tab:
Open Windows Terminal
Go to Settings and click "Open JSON file"
Then add the following:
{
"backgroundImage": "C:/Users/user/Downloads/Pictures/gcp.png",
"backgroundImageOpacity": 0.2,
"commandline": "wsl ~/ssh-gcloud-env.sh [email] [project_id]",
"hidden": false,
"icon": "C:/Users/user/Downloads/Pictures/gcp.png",
"name": "SSH into GCP"
},
Then, open your wsl2 Ubuntu VM, and in your /home/user/ directory make a file named "ssh-gcloud-env.sh". And type in the following commands:
gcloud auth login $1
gcloud config set project $2
gcloud cloud-shell ssh
Save the file and type the following: "chmod +x ssh-gcloud-env.sh"
Finally, go to your Windows Terminal and open the custom tab.
Yay! We did it
Upvotes: 0
Reputation: 134
I faced the same problem during these days, and I solved it using winSCP to access the storage and delete a lot of heavy files created by my scripts, also because the the instructions here have been not so useful. If you do not know how to configure winSCP and GCP, follow my steps or this video.
While creating a new site in winSCP
copy the public key and open GCP
Click on your instance to edit its settings
Done, now you can access your instance storage and remove some files; after that, your instance will be able to boot correctly creating the temporary files needed.
Upvotes: 1
Reputation: 119
As Dan mentioned, you need to connect on serial console to expand the filesystem making use of the additional disk space allocated. You can also attempt to free up some space etc.
Upvotes: 0