I am trying to better understand how ssh
does host authentication. I am ssh'ing from a macbook pro (OSX 10.14.6) to several CentOS 8.1 servers. There are several files on the remote CentOS servers in /etc/ssh/
that are used for the host-based authentication (e.g. ssh_host_ed25519_key.pub
, ssh_host_dsa_key.pub
, ssh_host_rsa_key.pub
).
If I look at my macbook's local ~/.ssh/known_hosts
, I see entries that use ssh-rsa
which corresponds to /etc/ssh/ssh_host_rsa_key.pub
. I also see entries for ecdsa-sha2-nistp256
which correspond to /etc/ssh/ssh_host_ecdsa_key.pub
.
Question :
When I
ssh
into my remote server, is there a way for me to forcessh
to use a particular algorithm for the host authentication or is this something that I'll have to change by hand inknown_hosts
? E.g. force it to usessh_host_ecdsa_key.pub
instead ofssh_host_rsa_key.pub
.How does
ssh
by default decide which algorithm to use for host authentication?