Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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
1  
And of course ssh -vvv might give you some good idea. –  michas Jul 11 '13 at 18:10

1 Answer 1

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
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

 
discard

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.