Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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?

share|improve this question

2 Answers 2

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.

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

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.

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.