1

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.

2 Answers 2

9
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.

2
  • 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, 2012 at 21:57
  • 1
    For new version of openssh, use ssh-keygen -E md5 -lf /etc/ssh/ssh_host_rsa_key.pub to get the fingerprint with md5 hash format. The default is the sha256 format. Oct 3, 2016 at 15:47
1

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...

2
  • 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.
    – Animesh D
    Feb 4, 2011 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!
    – Animesh D
    Feb 4, 2011 at 13:16

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .