Add Users to the Sudoers List

When connecting to your VPS, you should never login as root, in fact, root logins with password authentication should be disabled.

Instead you should mainly use a none-root account and elevate your access rights to root only when needed.

By default, you can not use sudo with a new user account, so before you can use it, you have to add the user account to the sudoers list.

As root (ironically, yes I know) open the sudoers list for editing by running this command.

Note: If the ‘visudo’ command is not found, you may need to install sudo as this might be removed from some installations (or if you have run Minstall):

In this file, find this row:

and add below

where <username> is the username of the user that you would like to have the ability to elevate to root.

Save the file and exit. Test you newly changed settings by login as the new user and run “sudo”

3 comments for “Add Users to the Sudoers List

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.