Ssh – Why ssh uses .ssh/id_rsa as a pubkeyauthentication

authenticationrsassh

When trying to ssh -v 'somehost'

Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /home/kaldown/.ssh/id_rsa
debug1: Authentications that can continue: publickey
debug1: Trying private key: /home/kaldown/.ssh/id_dsa
debug1: Trying private key: /home/kaldown/.ssh/id_ecdsa
debug1: Trying private key: /home/kaldown/.ssh/id_ed25519
debug1: No more authentication methods to try.
Permission denied (publickey).

And why he telling that it's type 1 instead of type 2

debug1: identity file /home/kaldown/.ssh/id_rsa type 1
debug1: identity file /home/kaldown/.ssh/id_rsa-cert type -1
debug1: identity file /home/kaldown/.ssh/id_dsa type -1
debug1: identity file /home/kaldown/.ssh/id_dsa-cert type -1
debug1: identity file /home/kaldown/.ssh/id_ecdsa type -1
debug1: identity file /home/kaldown/.ssh/id_ecdsa-cert type -1
debug1: identity file /home/kaldown/.ssh/id_ed25519 type -1
debug1: identity file /home/kaldown/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.6.1_hpn13v11 FreeBSD-20140420

in sshd_config:

PermitRootLogin no
RSAAuthentication yes
PubkeyAuthentication yes
AuthorizedKeysFile .ssh/authorized_keys
PermitEmptyPasswords no
PasswordAuthentication no
ChallengeResponseAuthentication no
GSSAPIAuthentication no
UsePAM yes
UsePrivilegeSeparation sandbox

P.S. I'm using FreeBSD 10.1 which have a problems with ssh-copy-id, telling strange

Unmatched '

So I just scp my public key in .ssh/authorized_keys of exact user

1) Why it uses .ssh/id_rsa instead of .ssh/id_rsa.pub as a public key?

2) Why it's telling me that type 1, when I created this with ssh -t rsa (rsa2) key

3) Why I can't connect with keys, but password only with that config.

Server-side: CentOS 7, 3.10

Thank you.

Best Answer

Your id_rsa file contains information about both your private and public key. It is only offering the public part of the key.

I believe that type 1 or type 2 designates whether it is an RSA or DSA key.