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.

Animesh
  • 273
  • 5
  • 17

2 Answers2

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.

Animesh
  • 273
  • 5
  • 17
  • You left out a file folder in the command line. The file is under /etc/ssh/'filename' You put /etc/'filename' Cheers! –  Oct 17 '12 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. – linbianxiaocao Oct 03 '16 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...

mkudlacek
  • 1,677
  • 1
  • 11
  • 15
  • 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 Feb 04 '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! – Animesh Feb 04 '11 at 13:16