Get the App
SLTechnology News&Howtos  ›  Servers  › 

Permission denied appears on git push (p

Shulou Source: shulou.com Published: 2022-06-03 09:37:30 12月06日 Update

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!

Tags: Name public key question input warehouse permissions generation success content avatar method when say this is error previous home recommendation prompt move Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno NVidia Xiaomi Shulou Information vpn Shulou Tech Info