Search code examples
sshssh-keysopenssh

/etc/ssh/ssh_host_rsa_key.pub is not a public key file


Can't check my server RSA fingerprint. What am I doing wrong?

$ ls /etc/ssh
moduli       ssh_host_dsa_key    ssh_host_key.pub
ssh_config   ssh_host_dsa_key.pub  ssh_host_rsa_key
sshd_config  ssh_host_key    ssh_host_rsa_key.pub
$ ssh-keygen -lf /etc/ssh/ssh_host_rsa_key.pub 
/etc/ssh/ssh_host_rsa_key.pub is not a public key file.
$ ssh-keygen -lf /etc/ssh/ssh_host_rsa_key
/etc/ssh/ssh_host_rsa_key is not a public key file.

Solution

  • That was a file permissions problem.

    $ cat /etc/ssh/ssh_host_rsa_key.pub 
    /etc/ssh/ssh_host_rsa_key.pub: Permission denied