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.

When I grep in the etc folder, I get this message:

grep: ssh_host_rsa_key: Permission denied.

Since I am on cygwin, I can't use sudo or something else.

Please let me know how to find it out.

share|improve this question

2 Answers 2

up vote 6 down vote accepted
ssh-keygen -l -f /etc/ssh_host_rsa_key.pub

This command will output just the fingerprint like this:

2048 9e:1a:5e:27:16:4d:2a:13:90:2c:64:41:bd:25:fd:35 /etc/ssh/ssh_host_rsa_key.pub

-f is for filename
-l is to output the fingerprint of the public key file.

Output consists of three parts

  • bit length of the key: 2048
  • finger print of the key: 9e:1a:5e:27:16:4d:2a:13:90:2c:64:41:bd:25:fd:35
  • name of the key file: /etc/ssh/ssh_host_rsa_key.pub

I would like to request experts on this matter to point any shortcomings in this method.

share|improve this answer
    
You left out a file folder in the command line. The file is under /etc/ssh/'filename' You put /etc/'filename' Cheers! –  user141554 Oct 17 '12 at 21:57

Sudo is aditional package, which has to be installed during Cygwin installation. Have you tried su to become superuser?

Anyway, you can always view content of the Cygwin files from Windows...

share|improve this answer
    
I have tried su, but it did not work. I am guessing we have a vanilla Cygwin installation. Also I do not have the install permissions on the server. I will get this installed and try. I was not able to open these files from text editor as well. –  Nanda Feb 4 '11 at 13:15
    
Fortunately I have hit upon a solution from ssh documentation. I have posted it below as an answer. Thanks for your insight! –  Nanda Feb 4 '11 at 13:16

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.