1

Immediately following my upgrade to Ubuntu 22.04 from 21.10, I can no longer connect to Google Cloud Platform via ssh and am receiving the following error (e.g. after running git clone):

john@doe.com@source.developers.google.com: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights and the repository exists.

I'm asking here because it seems directly related to the upgrade (though could be coincidence), and I'm wondering if ssh standard/methods changed in Ubuntu 22.04 that could be causing this, though several searches on this were unsuccessful.

In addition to hours of searching and reviewing all other Ask Ubuntu questions related to Permission denied (publickey)., I've tried the following:

Confirm ssh agent is running:
eval $(ssh-agent -s)

Add key to agent:
ssh-add (equivalent to ssh-add ~/.ssh/id_rsa)

Show sha256 of public key:
ssh-add -l (output on my machine matches sha256 sum displayed by Google in Manage SSH Keys)

Generated new keys and tested those:
ssh-keygen -t rsa -b 4096 -C "220608_test"

Tried restarting/enabling/starting ssh:
sudo systemctl restart ssh.service
sudo systemctl enable ssh.service
sudo systemctl start ssh.service

Checked permissions:
Permission of ~/.ssh/ folder: 700 i.e. rwx------
Permission of private key in ~/.ssh/: 600 i.e. rw-------
Permission of public key in ~/.ssh/: 644 i.e. rw-r--r--

I also tested changing the public key to 600 permissions:
chmod 600 ~/.ssh/id_rsa.pub

Determined firewall status is inactive per:
sudo ufw status

I've never needed to specify connection parameters for Google Cloud in ~/.ssh/config.

Any thoughts would be appreciated.

0 Answers0