2

I have an ssh key name.ppk I want to add by mac terminal to be able to clone from Git repository because when I am cloning from the repository it give me

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

3 Answers 3

1

Follow the below step:

Step1: open terminal and paste below cmd with your email id which is being used in github or bitbucket or any other hosting service which you are using.

  ssh-keygen 

Step2: You will get: Generating public/private ssh key pair. no need to type anything just press enter.

Step3: You will get Enter file in which to save the key (/Users/abhishekupadhyay/.ssh/id_rsa): Again don't do anything just press enter.

Step4: You will get Your public key has been saved in /Users/abhishekupadhyay/.ssh/id_rsa.pub

Step5: The key fingerprint is: SHA256:0WHGzcQwaT4SabOuL2d2Yl3XPIJgP4E88LA39+rl8zk [email protected] The key's randomart image is: +--[ED25519 256]--+ | oB. | | o=++o+ | | .Bo | | .o@oo | | .S.*.+ o | | . +.o..o| | . . .oo. .| | o * o.o. E.| | B.o.. .oo.| +----[SHA256]-----+

Note: This is not a ssh key which you required for your hosting service(eg. github or bitbucket) your ssh key saved in .ssh/id_rsa.pub

Step6: For copy your public ssh key use below command:

pbcopy < ~/.ssh/id_rsa.pub

Step7: You will get ssh key adding option from: Right top icon click--Setting--SSH and GPG keys---New SSh key.

enter image description here

Step8: Paste your ssh key like below , and title would be like "accesstoken", Select key type: "Authentication key" and you are done.

enter image description here

===================================================================== Simple trick: paste below as press enter again and again tiill SHA-256 image comes up.

ssh-keygen 

Then

pbcopy < ~/.ssh/id_rsa.pub

Now ssh key is copy in clipboard. You can use now to paste.

Sign up to request clarification or add additional context in comments.

Comments

0

Try How to convert SSH keypairs generated using PuttyGen(Windows) into key-pairs used by ssh-agent and KeyChain(Linux)

After that:

/usr/bin/ssh-add -K (add to keychain)

Source: https://ekkescorner.wordpress.com/blog-series/git-mercurial/step-by-step-ssh-on-osx-ubuntu-and-windows/

Comments

0

You can generate SSH keys (for git) in OSX by following these steps on GitHub: https://help.github.com/articles/generating-ssh-keys.

If you need to stick with the .ppk key (and Luchini's post doesn't work for you), you might also find this helpful: Use PPK file in Mac Terminal to connect to remote connection over SSH

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.