On my client I am attempting to run:

git clone gitosis@DevServer:gitosis-admin.git

I get a warning:

The authenticity of host '10.1.1.13 (10.1.1.13)' can't be established. RSA key fingerprint is a2:c3:fd:d7:f7:75:df:dd:49:64:ce:64:cc:98:e6:2c. Are you sure you want to continue connecting (yes/no)?

It appears to be picking up the public key from:

/etc/ssh/ssh_host_rsa_key.pub

I want it to use the key located in:

/srv/gitosis/.ssh/authorized_keys

How do I get my server to hand out the correct public key?

link|improve this question
feedback

2 Answers

I think you may be misinterpreting the messages from ssh. The following...

The authenticity of host '10.1.1.13 (10.1.1.13)' can't be established. RSA key fingerprint is a2:c3:fd:d7:f7:75:df:dd:49:64:ce:64:cc:98:e6:2c. Are you sure you want to continue connecting (yes/no)?

...has nothing to do with your authorized_keys file. You're getting this because you have never connected to the given host before, so the corresponding host is not in your in known_hosts file. This is perfectly normal behavior when you first connect to a remote host (because in the most common case you will not have a priori knowledge of the appropriate host key).

The authorized_keys file is only used by the remote host to determine what ssh client connections to accept, based on the private key they present when they connect.

link|improve this answer
Yeah, I was misinterpreting the message. Thanks :-D – mbursill Jan 19 '11 at 6:07
feedback

I was able to fix this by reinitializing the admin repository with the command:

sudo -H -u gitosis gitosis-init < /tmp/id_rsa.pub

This only worked after I removed the existing repository:

sudo rm /srv/gitosis/repositories/gitosis-admin.git -r

Reinitializing the repository without removing it first wouldn't update the authorized_keys file. If you had generated a new key, you'd be stuck using the old one.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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