Google Cloud - Recovering SSH access
ฝัง
- เผยแพร่เมื่อ 6 ก.พ. 2023
- Oops, you forgot to unblock SSH/port 22 and now you're locked out. Here's what you can do to recover it. First you'll need to get up and running with the Serial console (cloud.google.com/compute/docs....
Short steps:
1. Shut the machine off
2. Edit it and click the checkbox for remote access via the serial console
3. Add the bash script mentioned in the link above, replacing USERNAME with your Google Cloud username and password with a temporary one
4. Save it, turn on your machine, connect via serial console, login with the username/pw you just added
5. sudo ufw allow 22
6. shut off, edit machine again, disable serial and remove bash script, done
Thank you so much you're a life saver
thanks a lot, very helpful, keep going, best of luck
It's always the accounts with small subscribers that usually have the solutions to problems. Thank you Erik. Solved a problem of over 2 months. I just used to create a new virtual machine.
Glad I could help! This is something that always crops up during classes
Sir please does this mean I can log in the vps now on any terminal like bitvise or purity ? With that user name and pass ?
you have no idea how you saved me rn, thank you!
Worked, u are a life saver thank you :D
Its worked perfectly :)
It worked for me. Great Job!
Good to hear!
I can't thank you enough
Sorry... how do I even enable ssh like you show in 2:57 if I'm not able to login?
yo bro, idk if youre still there, but man, im using a VM with a ubuntu shape, I did the same thing as you but it wont let me type the password, and i get some issues like failed to start login service or no space left on device, i dont know what to do
No space left on device sounds like a hard drive issue, or perhaps a partition got filled up. Is there anything critical on the VM? Might be one of those times where it's easier to just create a new one...