Server Fault is a question and answer site for system and network administrators. 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

I am trying to set up gerrit replication, but I am getting reject HostKey.

The pubkey of the user running gerrit is in the authorized_keys2 file on the remote host. I am able to ssh just fine when I manually do it in the terminal.

Any ideas?

share|improve this question
Are you doing this as the same user ? What are the permissions on the authorized_keys2 file and the .ssh directory ? – flo Aug 14 '11 at 0:00

Can we get the exact command and messages for clarity?

In ssh, the host keys are independent from the user ones.

authorized_keys2 should now be renamed into authorized_keys as authorized_keys2 was deprecated long ago.

share|improve this answer

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.