Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have two hosts (A and B) with the same public key stored in ~/.ssh/authorized_keys. Why am I able to ssh between them without a password. The keypair was generated on a third host (C), so I am confident the private key is not available on either A or B.

Update: Answered my own question, and prompting from heavyd was helpful. Turns out I had 'OpenSSH Agent Forwarding' turned on on my local SSH client. The local SSH client (machine C) does have access to the private key, and was acting as agent to authenticate machine A to machine B. This is not what I want, and I'm turning off Agent Forwarding in my client.

tl;dr: Agent Forwarding

share|improve this question
    
Does commenting out the key (put a # at the beginning of the line) change anything? –  heavyd Mar 13 '13 at 14:50
    
If I comment out the key (on both hosts' authorized_keys), I am forced to use a password. –  mwhidden Mar 13 '13 at 14:52
    
But the three hosts don't share the same home-directory, and hence ~/.ssh, do they? –  mpy Mar 13 '13 at 14:53
2  
Running ssh -vv user@host should tell you which key is getting used. –  heavyd Mar 13 '13 at 14:54
1  
You can post your answer as an answer and mark it as accepted if you want. –  Jan Schejbal Mar 13 '13 at 15:24

1 Answer 1

up vote 0 down vote accepted

Answered my own question, and prompting from heavyd was helpful. Turns out I had Agent Forwarding turned on on my local SSH client. The local SSH client (machine C) does have access to the private key, and was acting as agent to authenticate machine A to machine B. This is not what I want, and I'm turning off Agent Forwarding in my client.

share|improve this answer

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.