How do I make an existing user a sudo user in Linux?

Granting sudo (superuser) privileges to an existing user in Linux allows them to perform administrative tasks that require higher-level permissions. This guide will walk you through the process of making an existing user a sudo user in Linux, with clear explanations of each step to ensure ease of understanding.

Understanding Key Terms

  • Sudo: Short for “superuser do,” sudo allows a permitted user to execute commands as the superuser or another user, as specified by the security policy.
  • Root User: The administrative user in Linux with unrestricted access to all commands and files.
  • Usermod: A command used to modify a user account in Linux.
  • Sudoers File: A configuration file that determines which users have sudo privileges and what commands they can run.


Before you begin, ensure you have:

  1. Root or existing sudo user access.
  2. Access to the terminal.

Step-by-Step Guide to Make an Existing User a Sudo User

1. Open the Terminal

Access the terminal on your Linux system. You can do this by searching for “terminal” in your applications menu or using the shortcut Ctrl + Alt + T.

2. Add the User to the Sudo Group

To grant sudo privileges to an existing user, you need to add them to the sudo group. For example, if you want to grant sudo privileges to a user named existinguser, use the following command:

sudo usermod -aG sudo existinguser


  • sudo: Executes the command with superuser privileges.
  • usermod: The command used to modify a user account.
  • -aG: The -a option appends the user to the specified group(s), while the -G option specifies the group(s) to which the user is being added.
  • sudo: The group to which the user is being added.
  • existinguser: The username of the existing user.

3. Verify the User’s Sudo Privileges

To ensure the user now has sudo privileges, switch to the user account:

su - existinguser

Then, run a command with sudo to check if it executes correctly. For example:

sudo whoami


  • su - existinguser: Switches to the user account of existinguser.
  • sudo whoami: Runs the whoami command with sudo privileges to display the effective username. If the user has sudo privileges, the output will be root.

Additional Tips

  • Editing the Sudoers File: For specific sudo permissions, you can edit the sudoers file using the visudo command, which safely edits the file to prevent syntax errors.
  sudo visudo

Add the following line to grant specific command permissions:

  existinguser ALL=(ALL) NOPASSWD: /path/to/command


  • existinguser: The username of the user being granted specific sudo permissions.
  • ALL=(ALL) NOPASSWD: Allows the user to run the specified command without being prompted for a password.
  • /path/to/command: The specific command the user can run.
  • Removing Sudo Privileges: To remove sudo privileges from a user, use the deluser command:
  sudo deluser existinguser sudo


  • deluser: The command used to delete a user from a group.
  • existinguser: The username of the user.
  • sudo: The group from which the user is being removed.


Making an existing user a sudo user in Linux is a straightforward process that involves adding the user to the sudo group. By following this guide, you can efficiently manage administrative privileges on your Linux system, ensuring both security and convenience. Proper management of sudo users helps maintain a secure and well-administered system, preventing unauthorized or accidental changes.