Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
+5 votes
3 views
in DevOps and Agile by (19.7k points)

I'm on Mac Snow Leopard and I just installed git.

I just tried

git clone [email protected]:cakebook.git

but that gives me this error:

Initialized empty Git repository in `/Users/username/Documents/cakebook/.git/`

Permission denied (publickey).

fatal: The remote end hung up unexpectedly

What am I missing?
I've also tried doing ssh-keygen with no passphase but still same error.

closed

1 Answer

+6 votes
by (62.9k points)
selected by
 
Best answer

Command 1:

Ensure ssh-agent is enabled. The command starts the ssh-agent in the background:

eval "$(ssh-agent -s)"

Command 2:

Add your SSH key to the ssh-agent:

ssh-add ~/.ssh/id_rsa

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...