Github fix permission denied error

when using go mod to get private dependencies.

Donald Le


Example error

go: invalid version: git fetch -f origin refs/heads/*:refs/heads/* refs/tags/*:refs/tags/* in /home/cuongld/go/pkg/mod/cache/vcs/asshfsfsd: exit status 128: Permission denied (publickey).
fatal: Could not read from remote repository.

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

You need to add ssh public key to your github account.

In order to add ssh public key, all you need to do is navigate to and add it.

Then you can

go get

to download the needed dependencies.

~~ Happy coding guys~~



Donald Le

A passionate automation engineer who strongly believes in “A man can do anything he wants if he puts in the work”.