jeshansen
By:
jeshansen

Trouble using an ed25519 ssh key. Server closes connection.

October 24, 2017 143 views
Security Linux Basics Ubuntu

I normally use RSA keys for SSH, but for no particular reason, I wanted to try using an ED25519 key. I made one and added it to my collection of SSH keys. I then spun an Ubuntu 17.10 droplet up and had it use this public key.

The server does not seem happy about this key, however. This is the log from when trying to connect. Any idea what's causing this?

jes@mymachine:~$ ssh -vvv -i .ssh/testservers root@178.62.62.178
OpenSSH_7.6p1, OpenSSL 1.0.2g  1 Mar 2016
debug1: Reading configuration data /home/jes/.ssh/config
debug1: Reading configuration data /usr/local/etc/ssh_config
debug2: resolving "178.62.62.178" port 22
debug2: ssh_connect_direct: needpriv 0
debug1: Connecting to 178.62.62.178 [178.62.62.178] port 22.
debug1: Connection established.
debug1: identity file .ssh/testservers type 3
debug1: key_load_public: No such file or directory
debug1: identity file .ssh/testservers-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_7.6
debug1: Remote protocol version 2.0, remote software version OpenSSH_7.5p1 Ubuntu-10
debug1: match: OpenSSH_7.5p1 Ubuntu-10 pat OpenSSH* compat 0x04000000
debug2: fd 3 setting O_NONBLOCK
debug1: Authenticating to 178.62.62.178:22 as 'root'
debug3: hostkeys_foreach: reading file "/home/jes/.ssh/known_hosts"
debug3: send packet: type 20
debug1: SSH2_MSG_KEXINIT sent
Connection closed by 178.62.62.178 port 22

jes@mymachine:~$ ssh-keygen -lf .ssh/testservers.pub
256 SHA256:80Y1v3JofR7j6CGlACM+C4iQlMWff+qIUX5Aje+/lDw jes@mymachine (ED25519)
jes@mymachine:~$
1 Answer
jeshansen October 24, 2017
Accepted Answer

I managed to get around this. I suspect this has to do with the new server not being in the known_hosts file. I made a new droplet with two keys, my 'normal' RSA key and the ed25519 key. After logging in using the RSA key and adding the server to the known hosts, I was able to log in using the ed25519 key.

Have another answer? Share your knowledge.