How to create a non-admin (sudo) user on Ubuntu

Add a New User Account

Create a new user account with the adduser command.

$ adduser example_user

Use a strong password for the new user. You can enter values for the user information, or press ENTER to leave those fields blank.

Add the User to the Sudo Group

Add the new user to the sudo group with usermod.

$ usermod -aG sudo example_user

Switch to the new user

# su - example_user

Verify you are the new user with whoami, then test sudo access with sudo whoami, which should return root.

$ whoami
$ sudo whoami
[sudo] password for example_user:

The new user account is ready to use. As a best practice, use this sudo user for server administration. You should avoid using root for maintenance tasks.

About The Author

1 thought on “How to create a non-admin (sudo) user on Ubuntu”

  1. Pingback: How to add Sudo Users in Ubuntu 20.04 - Nucleio Technologies IT Solutions

Leave a Comment

Your email address will not be published.

Scroll to Top