Super User is a question and answer site for computer enthusiasts and power users. 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

In running ssh with agent forwarding. This allows me to do hg/git pulls from my server from systems that I have been authorized to based on my local


ssh -A myserver
hg clone ssh://myreposerver/repo

However, my local known_hosts is not used when for the clearing of known hosts. This means I'll have to type "yes" after verifying the host is correct. That in itself is not so much of a problem, but I'm automating all of this, so I never get to see the input prompt.

i.e. I'm really doing this:

ssh -A myserver "hg clone ssh://myreposerver/repo"

Of course, I could simply copy the whole known_hosts file, but that's not really elegant and causes maintenance problems of itself. For example, every project runs on its own user account to provide an extra layer of security, and I don't want to copy the known_hosts file to every user.

Any idea on how to do "known_hosts" forwarding?


EDIT for workaround:

ssh -t -A myserver "hg clone ssh://myreposerver/repo"

Forces a pseudo tty allocation, which means in practice that I can at least send "yes" to the remote call of ssh (that is itself being called by hg)

share|improve this question
I think this question might better be suited at ServerFault – Peter Manton May 13 '11 at 18:32

You must log in to answer this question.

Browse other questions tagged .