Question
permission denied (publickey) using git from DigitalOcean console, Forge user
My setup originates with Laravel Forge connecting to various GitHub repos. I’ve been running a dozen sites without issue for about 6 months. All of a sudden, yesterday I started getting this permission denied (publickey) error in the DigitalOcean Console when I run any git push
or git pull
command.
I’ve been through these articles:
- https://www.digitalocean.com/community/questions/error-permission-denied-publickey-when-i-try-to-ssh
- https://www.digitalocean.com/community/questions/ssh-permission-denied-publickey
- https://stackoverflow.com/questions/48713210/ssh-permission-denied-publickey-digitalocean-ubuntu
They all recommend roughly the same solution:
- Edit config file
sudo nano /etc/ssh/sshd_config
- Change
PasswordAuthentication yes
which I shouldn’t need to do since this is SSH, not password auth - Change
PublickeyAuthentication yes
or in my case, uncomment it - One article says to change
AuthorizedHostKeys .ssh/authorized_keys
- Save, exit, and then run
sudo service sshd reload
I’ve tried all these steps multiple times but I still can’t get reconnected to my git repositories.
I’ve also reviewed the Forge SSH Keys instructions and confirmed the server key provided is the correct server key in /home/forge/.ssh/authorized_keys
Any additional ideas for 2020? I’m running Ubuntu 18.04.3
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
×