Why can't I connect to a remote Server because id_rsa

Viewed 25

Here is what I see:

ls

I don‘t know why the id rsa in the directory .ssh/ssh/: Actually, it should be in the directory .ssh/ so system don't to find it.

How should I solve it?

1 Answers

You should simply do:

 mv /User/<you>/.ssh/ssh/id_rsa* /User/<you>/.ssh/

That would move those default keys to their expected place, allowing an ssh -Tv ... to work (while displaying where it is looking for those keys, and if it finds them)

If those files are already in the right .ssh folder, look for ~/.ssh/config

Maybe in that file, you have a line with the wrong path:

IdentityFile ~/.ssh/ssh/id_rsa
# instead of
IdentityFile ~/.ssh/id_rsa

That would also explain why SSH is looking for that key in the wrong path.

Related