简体   繁体   中英

Permission denied (publickey) error when trying to clone from GitHub

I want to clone a repository and I ran into permission issues, I tried to set up my username and email but keep getting errors

I used

git config --global user.name "yusuf-uthman"
git config --global user.email "yusufuthman57@gmail.com"

but didnt get any notification wether its accepted or not.

Uthman@DESKTOP-30QGK3L MINGW64 ~/Desktop/Scripts/hng_internship5.0
$ git config --global user.name "Uthman Yusuf"

Uthman@DESKTOP-30QGK3L MINGW64 ~/Desktop/Scripts/hng_internship5.0
$ git config --global user.email "yusufuthman57@gmail.com"

Uthman@DESKTOP-30QGK3L MINGW64 ~/Desktop/Scripts/hng_internship5.0
$ git clone git@github.com:yusuf-uthman/hng-internship.git
Cloning into 'hng-internship'...
Warning: Permanently added the RSA host key for IP address '192.30.253.113' to the list of known hosts.
git@github.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 expect to have permission and be able to clone the repository, I'm sure the repository exists because I just created it, I will appreciate any help

but didnt get any notification wether its accepted or not.

Username and Email are just settings in you git config file, no one will accept or decline it. If you commit, the value of the settings will be used to determine the commits author and committer.

Access rights to a repository are usually managed via ssh keys. See Connecting to GitHub with SSH .

It looks like you are cloning your github repo via SSH URLs (for this you need to add your public SSH key in your repository)

Use HTTP URL method to clone and then IMO you'll be able to clone it on your local.

Format: - SSH URLs: git clone git@github.com:yusuf-uthman/hng-internship.git - HTTP URLs: https://github.com/yusuf-uthman/hng-internship.git

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM