This is the strangest I've ever encountered and I have no idea how to fix it.

I have many entries in my .ssh/config file because I use a number of keys. When I ssh and I am located outside my .ssh folder I get prompted for a password (key was passwordless).

When I cd to my .ssh folder, same command ssh {alias} connects directly as expected (doesn't ask for password). Do you have ANY idea why this could be happening?

  • strace should give you a good hint what's going on. – michas Jul 11 '13 at 18:01
  • 1
    And of course ssh -vvv might give you some good idea. – michas Jul 11 '13 at 18:10

It sounds like the path to your key files for one of your rules isn't using an absolute path but a relative one. It's most likely a line like this on one of your Host connection definitions:

You have:

IdentityFile id_dsa

But the rule should be this:

IdentityFile ~/.ssh/id_dsa
| improve this answer | |
  • 1
    Worked like a charm! Funny thing, non of my entries had path. Just the filaname of the key. Added absolute path to the failing one worked like a charm! Thanksy! xD – ptheofan Jul 12 '13 at 8:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.