Permission denied appears on git push (p
1 Description of the problem
The above error occurs when push, it says make sure you have sufficient permissions and this repository exists, the repository does not exist... This probably isn't, so it's a question of permissions, or exactly sshkey.
2 Regenerate ssh keyssh-key -t rsa -b 4096 -C xxxx@xxxxx
This is the method recommended by gitub to generate a new ssh key. Note, please do not use default name, the first prompt will enter a name, please use a custom name.
3 Modify ~/.ssh/config
Move public and private keys to ~/.ssh.
mv xxx xxx.pub ~/.ssh
Modify ~/.ssh/config:
vim ~/.ssh/config
input
Host github.comHostName github.comUser gitIdentityFile ~/.ssh/name
where name is the custom key name of the previous step, which is the private key, not the public key ending in.pub.
4 Adding public keys to github
In the github homepage, click on the avatar in the upper right corner to enter the settings.
Select:
Enter the name and the contents of the public key and save it.
5 push
Success!