简体   繁体   中英

Cannot ssh into GCP instance

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.

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.

winSCP - Create Keys

While creating a new site in winSCP

  • go to advanced --> ssh --> Authentication
  • click on Tools and open the Putty gen
  • generate public and private key
  • save them

copy the public key and open GCP

Setting your GCP instance

Click on your instance to edit its settings

  • scroll down until you reach ssh keys在此处输入图片说明
  • paste your key
  • save

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM