Stumped on how to add root ssh to a second computer.

March 29, 2016 543 views
Getting Started Security

I set up my droplet on my laptop and everything went smoothly. I now have a desktop and am trying to add the same access there that I have on my laptop. I generated my key and pasted it into DO using Add SSH Key from the control panel.

But when I attempt to ssh as root I get...

The authenticity of host '<MY IP>' can't be established.
ECDSA key fingerprint is <MY FINGERPRINT>.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '<MY IP>' (ECDSA) to the list of known hosts.
root@<MY IP>'s password:
Permission denied, please try again.

However, when I set up my account initially, I set up a single sudo account. When I attempt to ssh using that sudo account, it works and I am able to connect as expected. I guess I'm expecting to be able to have root access from both of my computers, not one with root and one with sudo. What am I not understanding? Thx.

  • So I created a sudo user, since logging in as root is apparently frowned upon, I am able to log in from both machines using the sudo user.

    This video was very helpful

    This tutorial screencast will show you how to set up a non-root superuser account (sudo) and SSH key authentication on an Ubuntu 14.04 server. Following these steps can improve the security of your server, and is recommended for all Linux servers.
  • Hey there,

    You should be able to login as root if you edit /etc/ssh/sshd_config and ensure the PermitRootLogin option is set to yes. If it's not there, you can add it. Just add a new line that looks like this:

    PermitRootLogin yes

    Mike C
    Platform Support Specialist
    DigitalOcean Support
    Check out our fantastic community articles!

  • Thanks Mike. I was able to edit that config file but from my second machine it still rejects me as root.

    Mac-Pro:~ work$ ssh root@<ipAddress>
    root@<ipAddress>'s password:
    Permission denied, please try again.
    root@<ipAddress>'s password:
Be the first one to answer this question.