Can't connect with ssh with Ubuntu

Posted February 21, 2016 12.5k views
Linux BasicsDigitalOceanLinux Commands

ssh root@

Connection closed by

ssh -vvvv root@

OpenSSH_6.6.1, OpenSSL 1.0.1f 6 Jan 2014
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to [] port 22.
debug1: Connection established.
debug3: Incorrect RSA1 identifier
debug3: Could not load "/home/kedinn/.ssh/id_rsa" as a RSA1 public key
debug1: identity file /home/kedinn/.ssh/id_rsa type -1
debug1: identity file /home/kedinn/.ssh/id_rsa-cert type -1
debug1: identity file /home/kedinn/.ssh/id_dsa type -1
debug1: identity file /home/kedinn/.ssh/id_dsa-cert type -1
debug1: identity file /home/kedinn/.ssh/id_ecdsa type -1
debug1: identity file /home/kedinn/.ssh/id_ecdsa-cert type -1
debug1: identity file /home/kedinn/.ssh/id_ed25519 type -1
debug1: identity file /home/kedinn/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.6.1p1 Ubuntu-2ubuntu2.6
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.6.1p1 Ubuntu-2ubuntu2
debug1: match: OpenSSH_6.6.1p1 Ubuntu-2ubuntu2 pat OpenSSH_6.6.1* compat 0x04000000
debug2: fd 3 setting O_NONBLOCK
debug3: load_hostkeys: loading entries for host "" from file "/home/kedinn/.ssh/known_hosts"
debug3: load_hostkeys: loaded 0 keys
debug1: SSH2_MSG_KEXINIT sent
Connection closed by


These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
2 answers

This question was answered by @rbeard:

I had this problem as well and followed this here

You need to add a user while logged in as root. You can always login in as root from your DO account using the console there. To log in from your local terminal then ssh to the newuser account which needs to have sudo privileges, e.g. using sudo adduser <username> sudo.

You can’t access root directly from the terminal once ssh keys have been enabled. Always go via a user account and sudo to make changes to root.

View the original comment

Ok, the fix I suggested above no longer works. I am trying to set up a new droplet. Normally, one can login as root and then copy the SSH key from the local machine into authorized_keys, however this is no longer working for me. So I am stuck, I can neither login as root nor as a user, except though the DO web interface, but then I can’t paste in the SSH key. The interface is forcing me to use an SSH key that I use for another droplet and it all works fine for the other droplet. But it does not work for the new droplet I’m trying to set up. So what’s wrong?