1

I am trying to clone a git repository. I am able to do it successfully from the netbeans IDE but if I try to use the command line to clone the repository with the same ssh private key, I am getting the following error : Cloning into 'name'... Enter passphrase for key '/home/user/.ssh/id_rsa': Permission denied (publickey). fatal: Could not read from remote repository.

Please make sure you have the correct access rights and the repository exists.

The repository exixts as I am able to clone it from Netbeans.I am using the same private key id_rsa. I am working on ubuntu 14.04.

Has anyone faced this problem. I am not able to figure out the issue.

kirancodify
  • 695
  • 8
  • 14
  • There is almost certainly something different between the two. – Jonathon Reinhart Dec 27 '14 at 10:42
  • ssh only prompts for a passphrase after it has tried to read the key without a passphrase and failed. The key may have a passphrase, or the file may be corrupt, or file permissions may prevent reading it. – Kenster Dec 27 '14 at 14:16

2 Answers2

0

If your private key is passphrase protected, it is possible that said passphrase has been filled in the NetBeans Git authentication setting (which means NB won't ask you anything):

https://netbeans.org/images_www/articles/74/ide/git/github-repo-small.png

In command line, you would need an ssh agent in order to memorize the passphrase.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • I haven't given any passphrase while creating the key.So I do not give anything in netbeans either.In command line I just press enter. – kirancodify Dec 27 '14 at 10:54
  • @user3679348 are your permissions properly set on the ssh folder and keys? As in http://stackoverflow.com/a/26967270/6309? – VonC Dec 27 '14 at 10:56
  • They were different, I set them now to the one as in the answer but no luck.Still getting the same issue – kirancodify Dec 27 '14 at 11:11
  • is there any place where a log will be generated on my system on this issue ? – kirancodify Dec 27 '14 at 11:22
  • @user3679348 you can generate one with `ssh -Tvvv`, as in http://stackoverflow.com/a/22740720/6309. – VonC Dec 27 '14 at 12:26
0

There must be a passphrase when you generate you ssh key, just enter it when the information

Enter passphrase for key '/home/user/.ssh/id_rsa':

appear.

younghz
  • 66
  • 3