juztcode
juztcode

Reputation: 1355

problem on adding ssh key to github - permission denied

I generated the SSH key using the command: $ ssh-keygen, It prompted for a filename and phrase, which I provided and generated the corresponding file. Then from github.com I added the SSH key from settings>SSH and GPG keys where I pasted the key in the generated file. Then I hit the command $ ssh -T [email protected] in the terminal which gave me a :Permission denied (publickey). message. What does this message mean and why am I getting this? Previously I didn't have trouble with this.

Upvotes: 1

Views: 32

Answers (1)

VonC
VonC

Reputation: 1328292

where I pasted the key in the generated file.

Make sure it was:

  • the id_rsa.pub file, meaning the public key (not the private one)
  • the public key pasted as one continuous line (not multiple lines)

Check also you have added your private key to the ssh-agent. (in order to not enter the passphrase every time)

Upvotes: 2

Related Questions