TLDR;
cp -prf ~/.ssh /tmp/.ssh_2024_02_24
chmod 700 ~/.ssh
chmod 600 ~/.ssh/*
I had this curious issue, where my perfectly fine GCloud SSH Login via CLI stopped working when I moved from Ubuntu 18 to Ubuntu 20.
The error I was was not very descriptive, even when running verbose
gcloud --project=my-project compute ssh my-server-01 --zone=asia-south1-c --internal-ip
Verbose mode ( not including output for brevity ) :
gcloud --project=my-project compute ssh my-server-01 --zone=asia-south1-c --internal-ip --verbosity=debug
The first time it happened, I assumed something broke in the upgrade and reinstalled the OS since it was already on a different partition. Still no luck. The final solution was to downgrade to Ubuntu 18.
2nd time around, I was more determined to find the cause. I figured out it was due to OpenSSH becoming more strict, but I didn't have the option to downgrade it. I tried adding options to openssl config, hoping to use a less latest version of TLS. Nope, no success!
And after lot of search, I ended up on a stackoverflow.com page, which mentioned that it could be a case of .ssh files not having secure permissions and the SSH error message being insufficient misleading .
So, I crossed my fingers and did as suggested,
cp -prf ~/.ssh /tmp/.ssh_2024_02_24
chmod 700 ~/.ssh
chmod 600 ~/.ssh/*
And that solved it!
Comments
Post a Comment