+4 votes
445 views

How to fix ssh permission denied (publickey) git clone error?


in Linux / Unix by (552k points)
reopened by | 445 views

1 Answer

+3 votes
Best answer

Permission denied (publickey) fatal: Could not read from remote repository

I try with sudo and I get the same error, I create the folder, I give write permissions to rule out possible permission issues and the error is the same, after searching, and read the bitbucket documentation, for security when making the clone, ( can be because it is a private repository, this only allows it in its free version bitbucket, github does not allow it) we must include the ssh key of our team.

To fix it, you must generate the ssh key again

ssh-keygen -t rsa

or if we already have a key generated, we can copy it to the clipboard with the instruction

xclip -sel clip <~ / .ssh / id_rsa.pub

user1 @ laptop: ~ / tmp $ sudo git clone [email protected]: repo / myrepo.git

Clone in «myrepo» ...
remote: Counting objects: 651, done.
remote: Compressing objects: 100% (604/604), done.
remote: Total 651 (delta 292), reused 113 (delta 34)
Receiving objects: 100% (651/651), 1.89 MiB | 1.42 MiB / s, done.
Resolving deltas: 100% (292/292), done.
Checking connectivity ... done.

by (552k points)
selected by

Related questions

+5 votes
1 answer
asked Nov 9, 2019 in Windows 10 by backtothefuture (552k points) | 311 views
+4 votes
1 answer
asked Jul 23, 2020 in Linux / Unix by backtothefuture (552k points) | 816 views
+3 votes
1 answer
asked Sep 19, 2019 in Linux / Unix by backtothefuture (552k points) | 296 views
+5 votes
1 answer
asked Sep 23, 2020 in Linux / Unix by backtothefuture (552k points) | 340 views
Sponsored articles cost $40 per post. You can contact us via Feedback

Most popular questions within the last 30 days

10,659 questions
10,791 answers
510 comments
3 users