Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
strace should give you a good hint what's going on. – michas Jul 11 '13 at 18:01
And of course ssh -vvv might give you some good idea. – michas Jul 11 '13 at 18:10
up vote 4 down vote accepted

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
share|improve this answer
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 posting your answer, you agree to the privacy policy and terms of service.

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