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

this is not a duplicate of Get SSH fingerprint from remote server securely?

My question is what are the ways to obtain the public-key fingerprint of a remote server.

I have a shared hosting account on GoDaddy and I logged in using SSH, I now want to go to /etc/ssh/ and use ssh-keygen to verify my fingerprint. but in this directory there is only a file for the RSA fingerprint which is pretty weird because why would they put the RSA key for display but not the DSA key?

Maybe this is actually the DSA fingerprint and the ssh-keygen is interpreting it wrong? is there a way to make ssh-keygen interprent it as DSA?

or am I missing something?

share|improve this question
    
Is it possible your server only has an RSA key? Check your configuration.... –  voretaq7 Jun 28 '11 at 17:15
    
no, when I log-in via SSH it tells me that the fingerprint is a DSA fingerprint –  fiftyeight Jun 28 '11 at 20:55
add comment

1 Answer

up vote 1 down vote accepted

It's impossible that ssh-keygen would interpret a key as the wrong type, since the type is encoded in two places of the file; also RSA and DSA keys use different internal structures, so you would get an error message.

  • It could be that there is a ssh_host_dsa_key and you're just missing its .pub counterpart.

  • It could be that sshd is configured to look for keys elsewhere. Check sshd_config:

    grep -i ^hostkey /etc/ssh/sshd_config
    
  • ...or that someone removed the DSA key file but didn't restart sshd.

  • It could be that the server is using a different SSH daemon, not OpenSSH.

  • As a last resort, you can use ssh-keyscan -t dsa localhost > hostkey-dsa.pub and run ssh-keygen -lf on the output file.

share|improve this answer
    
Thanx for the comment! the last option (ssh-keyscan) actually worked! amazing, how did it find the key? can I get the location of the key-file? EDIT: I think i get it, I tell the remote server to connect to itself via ssh and save the public key, am I correct? –  fiftyeight Jul 13 '11 at 16:33
    
Yes, you're right. –  grawity Jul 13 '11 at 20:04
add comment

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.