Question

Ubuntu 20.04 asks for root passphrase when I SSH login as non-root

As I was following this tutorial (https://www.digitalocean.com/community/tutorials/initial-server-setup-with-ubuntu-20-04), I created a new user account at step 2, including an account password. Then, I successfully added sudo privileges to this user account (step 3), set up the basic firewall and enables external access for my regular user (step 5).

So far, so good.

Now, when I externally login using ssh user@ipaddress, Ubuntu 20.04 asks for my passphrase, but it permits only the passphrase for my root user. Isn’t that strange? What if I add another user that is not me. He or she will have to know the passphrase for my root user account. That is not really save.

Please let me know what is good practice here.

Show comments

Submit an answer


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

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.

Accepted Answer

Hi @KatoVonKatz,

I think, at Step 2 — Creating a New User, you entered your root password instead of a new password for your regular user. You should set a new password for your regular user as following:

  1. Log in your regular user via SSH:

    1. ssh user@ipaddress
  2. Change the password:

    1. passwd

    Enter your root password first, then enter a new password twice when prompted.

  3. Then log out:

    1. exit
  4. Finally, log in again with the new password:

    1. ssh user@ipaddress
KFSys
Site Moderator
Site Moderator badge
September 21, 2020

Hi @KatoVonKatz,

Following the tutorial lets, you create a user with sudo privileges so that you don’t need to use root for everything.

If you wish to have a user that’s being accessed by another person, you shouldn’t rsync your SSH key to the newly created folder .ssh user’s folder but rather use the key of the person that’s going to use this user.

Regards, KFSys

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Become a contributor for community

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

DigitalOcean Documentation

Full documentation for every DigitalOcean product.

Resources for startups and SMBs

The Wave has everything you need to know about building a business, from raising funding to marketing your product.

Get our newsletter

Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.

New accounts only. By submitting your email you agree to our Privacy Policy

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.