sahil
sahil

Reputation: 135

Could not add identity "~/.ssh/id_rsa": agent refused operation

I have successfully generated the ssh key, but when i tried to add it to ssh-agent it is showing me this error

** 03/03/2020   19:39.04   /home/sahilra/Desktop/DOcs/Web_Dev/git_projects ** ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/home/mobaxterm/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/mobaxterm/.ssh/id_rsa.
Your public key has been saved in /home/mobaxterm/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:ISmtoclG2l6aWE9wHa4AS/4jzXKy/cVJk93sU7XJNw4 sahilra@SAHILRA01
The key's randomart image is:
+---[RSA 2048]----+
|..    .          |
|oo   + o         |
|..+ + * .      . |
| =+* = .o.o   o o|
|.+B*=  +S. o E =.|
| =B*. o o . . o o|
|..+..  +   o   . |
|    . .     .    |
|     .           |
+----[SHA256]-----+

$SSH_AUTH_SOCk=/tmp/ssh-I4LHdw/agent.2102 and agent is also running

**/home/sahilra/Desktop/DOcs/Web_Dev/git_projects ** ssh-add ~/.ssh/id_rsa
Could not add identity "/home/mobaxterm/.ssh/id_rsa": agent refused operation

still the probem exists

Upvotes: 2

Views: 4222

Answers (2)

esf0
esf0

Reputation: 11

Answer from here with some comments:

  • In the last step use sudo ssh-add ...

It worked for me (I also used mobaxterm).

Upvotes: 1

Harsh Jain
Harsh Jain

Reputation: 1

Not sure if you were able to resolve this but I ran into the same problem.

so your public key is save here : Your public key has been saved in /home/mobaxterm/.ssh/id_rsa.pub

You can clip > /home/mobaxterm/.ssh/id_rsa.pub and then add it to your github account.

You may still encounter connectivity issue... for me the owrkaround was the configure github locally using

$ git config --global user.name "John Doe"
$ git config --global user.email [email protected]

Upvotes: 0

Related Questions