How To Set Up Sudo and SSH Keys on Ubuntu 14.04

Hosting on Digitalocean – How To Set Up Sudo and SSH Keys on Ubuntu 14.04


How To Set Up Sudo and SSH Keys on Ubuntu 14.04

Hosting on Digitalocean

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.

A written tutorial on the same topic can be found here:

Check out the DigitalOcean Community for more system administration tutorials:

Leave a comment or tweet at Mitchell and DigitalOcean to tell us if this helped you.

To learn more about DigitalOcean:
Follow us on Twitter:
Like us on Facebook:
Follow us on Instagram:
Tweet at Mitch!

you search:

Hosting on Digitalocean

How To Set Up Sudo and SSH Keys on Ubuntu 14.04

31 thoughts on “Hosting on Digitalocean – How To Set Up Sudo and SSH Keys on Ubuntu 14.04

  1. Hello! I was going through the process and I stopped to check whether I can access via root or not and even after the process of doing "vi /etc/ssh/sshd_config" and changing the permit root to no… Anyone else run into this? thanks!

  2. Looks like an ssh-agent was running already but it can not find any keys attached. To solve this add the private key identities to the authentication agent like so:

    ssh-add
    Then you can ssh into your server.

    in addition, you can see the list of fingerprints of all identities currently added by:

    ssh-add -l

  3. What if i already have a key named id_rsa.pem in that location that i'm using and that i don't want to overwrite? How then do i use it, please? I generated a key with a new name, but the passwordless login isn't working, so I assume the login is looking at my previous key named id_rsa. All the DO docs just advise to 'use the default'.

  4. Why don't we just go ahead and make our own OS from scratch. Heck, even run our own servers. While we are at it, let's manufacture our own computer chips. Might as well run our own web connection.

  5. & I'm DOWNN. After doing the last step sudo vi /etc/ssh/sshd_config Now every-time i try and access either as my users or root via terminal it refuses connection on port 22. 🙁 FML.

    I think i may have accidentally typed something in somewhere. Any way of resetting these files to their defaults? I'd appreciate it. Need to start over.

  6. Hello! Please help me, I made these changes and now when I try login in PuTTY I don't can't, because I get: "Network error: Connection refused" When I set "PermitRootLogin no" the problem happens… I back to "PermitRootLogin yes" and solved… How can I set it without generates: Network error: Connection refused?

  7. Video looks good, however, what about adding keys to already made droplets? I saw instructions that you cannot do such a task using the control panel. 

    Instead:

    cat ~/.ssh/id_rsa.pub | ssh [email protected][your.ip.address.here]"cat >> ~/.ssh/authorized_keys

Leave a Reply

Your email address will not be published. Required fields are marked *