A SHARE OF $50,000 CASH! A SHARE OF $50,000 CASH!
We are aware of some customers receiving a fraudulent email claiming to be VentraIP Australia. Please do not open the link in this email, and mark it as spam immediately. If you have clicked the link in the email and entered your details, please update your VIPControl password immediately. Read More
View all Products Close Menu Menu
How to create a sudo user
Updated Friday October 30th 2020 / Category Self-Managed VPS

This article describes how to give a user sudo access, to provide higher level access, usually restricted only to the root user.

A user with sudo access can be limited to only certain commands, or can be given full access just like the root user, but without having to give out your root password.

How do I give a user sudo access?

  1. SSH into your VPS. For Self Managed VPS’ the SSH port is 2222.
  2. If you haven’t already, create a user using the following command (change “vipsupport” to whichever username you like):
    # useradd vipsupport
  3. Set a password for the newly created user:
    # passwd vipsupport
    Changing password for user vipsupport.
    New password:
    Retype new password:
    passwd: all authentication tokens updated successfully.
  4. This user can now SSH into your VPS with the password you just set, however they will not have any root user privileges. To add these, open the /etc/sudoers file by running the command:
    # visudo
  5. Scroll to the bottom of this file, and add the user you just created.
    1. To give this user full root permissions, add the following line to the bottom:
      vipsupport    ALL=(ALL)  ALL
    2. To limit the user to only certain commands, for example “mount” or “su – root”:
      vipsupport    ALL=(ALL) /usr/bin/mount
  6. To exit the visudo editor, type:
Can’t find the answers you're looking for? Check out these other methods of support!