Sharing the root password across multiple admins gets messy fast. On Linux Mint, the cleaner setup is giving each person a normal account and granting administrator privileges through the sudo group only when they need them.
If you need to add a user to sudoers on Linux Mint, the standard path is creating the account, placing it in the sudo group, and confirming the new login can run privileged commands without unlocking root. Linux Mint keeps the root account locked by default, so group membership is the supported day-to-day admin model.
The same workflow works for existing accounts, quick privilege removal, and the common root or su edge cases that show up after the group change. If you are working on Ubuntu instead, use the dedicated guide to add a new user to sudoers on Ubuntu.
Create a New User Account on Linux Mint
Open a terminal from the applications menu or use the shortcut configured on your system. For a new account, create the Linux Mint user first with sudo adduser username:
sudo adduser josh
adduser creates the home directory, copies default files from /etc/skel, then prompts for a password and optional profile fields. Press Enter to skip optional fields such as Full Name or Room Number, then type Y when the account details are correct.
The status text differs between Linux Mint versions. Mint 22.x prints several
info:prefixes during user creation, while Mint 21.x uses simpler status lines without those prefixes. Both formats are normal.
Verify the Linux Mint User Account
Next, confirm the account exists in the system user database:
getent passwd josh
Example output shows the user entry with their UID, home directory, and default shell:
josh:x:1001:1001:Josh User,,,:/home/josh:/bin/bash
Add a User to the Sudo Group on Linux Mint
Once the user account exists, grant Linux Mint administrator privileges by adding it to the sudo group. Although people often say “add a user to sudoers,” the standard Linux Mint workflow uses group membership rather than a manual edit to /etc/sudoers.
Add the User with usermod on Linux Mint
Add a user to the sudo group on Linux Mint with sudo usermod -aG sudo username. The -aG flags append the user to a supplementary group without removing them from other groups:
sudo usermod -aG sudo josh
Always include the
-a(append) flag when usingusermod -G. Using-Galone replaces all supplementary groups, which can lock the user out of other group-based permissions.
Add the User with gpasswd on Linux Mint
If you prefer gpasswd, add a user to the sudo group on Linux Mint with sudo gpasswd -a username sudo. The -a flag adds a user to the specified group:
sudo gpasswd -a josh sudo
When successful, the command confirms the addition:
Adding user josh to group sudo
Verify Linux Mint Sudo Group Membership
Next, confirm the user belongs to the sudo group using the id command:
id josh
Example output should include sudo in the supplemental group list:
uid=1001(josh) gid=1001(josh) groups=1001(josh),27(sudo),100(users)
The 27(sudo) entry confirms the user has sudo group membership. The rest of the group list can vary between Linux Mint releases and local defaults, so focus on the presence of sudo rather than matching every numeric group exactly.
Edit Sudoers Only for Custom Policies
Adding a user to the sudo group grants administrative access through sudo, but it does not unlock the root account or change the user’s login shell. Direct sudoers edits are for custom policies, such as limiting commands, setting host-specific rules, or creating tightly scoped passwordless access.
Use visudo for direct sudoers changes because it checks syntax before saving. Open the main policy file only when the default group rule is missing or you intentionally need a custom rule:
sudo visudo
After changing the main file or a drop-in under /etc/sudoers.d/, validate the complete sudoers policy before depending on the account:
sudo visudo -c
A clean check reports each sudoers file as parsed successfully. Fix any syntax error before closing your current administrator session.
Test Sudo Privileges on Linux Mint
Group membership changes take effect in new login sessions. The user must log out and log back in, or start a new login shell, before sudo works. To test without ending your current administrator session, switch to the new user account:
su - josh
Enter the user’s password when prompted. Once logged in as the new user, verify sudo access by running a command that requires root privileges:
sudo whoami
Sudo may display a brief first-use warning about root privileges. After entering the user’s password, the command output confirms sudo works:
[sudo] password for josh: root
The output root confirms the user can execute commands as the root user. If you see a “not in the sudoers file” error instead, the account is either missing sudo membership or still using an old session.
Add an Existing Linux Mint User to Sudo
If the account already exists, you only need the group step. Add the existing Linux Mint user to the sudo group with either command:
sudo usermod -aG sudo existinguser
Alternatively, use gpasswd:
sudo gpasswd -a existinguser sudo
Both commands update group membership immediately on disk. Verify the existing account before asking the user to start a new session:
id existinguser
The output should include sudo in the group list. The running desktop session or terminal still needs a full logout and login before it recognizes the new privileges.
Remove Sudo Access from a Linux Mint User
To revoke administrator privileges, remove the account from the sudo group without deleting the user itself. Use gpasswd with the -d (delete) flag:
Keep at least one confirmed sudo-enabled account before revoking another user’s administrator access. Removing sudo from the only working admin account can leave you dependent on recovery mode or a root password.
sudo gpasswd -d josh sudo
When successful, the command confirms removal:
Removing user josh from group sudo
Verify the account no longer lists the sudo group:
id josh
The sudo group should no longer appear in the output. The user must log out and back in for the removal to take effect in their session.
Troubleshoot Sudo Access on Linux Mint
Most sudo problems on Linux Mint come from an unchanged login session, a locked root account, or a missing package. Start with the account and session checks, then move to root and package state only if those pass.
Fix “User Is Not in the Sudoers File” on Linux Mint
If a sudo test such as sudo whoami returns this error:
josh is not in the sudoers file. This incident will be reported.
This means the user is not in the sudo group or has not started a new session since being added. First, verify group membership from another account with sudo access:
id josh
If sudo does not appear in the groups list, add the user to the group:
sudo usermod -aG sudo josh
If the user is already in the sudo group, they need a fresh login session. Close the old desktop session completely and log back in, or test from another administrator account with su - username.
Fix Authentication Failure with su on Linux Mint
If switching to root with su returns “Authentication failure,” the root account either has no password set or the password is incorrect. Linux Mint keeps root locked by default, so sudo group membership does not make su - work. Use sudo -i for an interactive root shell from a sudo-enabled account, and set a root password with sudo passwd root only when you truly need direct root login. If you set one temporarily, lock the root password again with sudo passwd -l root when you are done. If you manage the machine remotely after you install OpenSSH on Linux Mint, keep direct root SSH logins disabled and use the sudo-enabled account instead.
Fix a Root Password Prompt from sudo on Linux Mint
By default, sudo prompts for the current user’s password, not the root password. If sudo asks for the root password, the sudoers configuration may include rootpw, targetpw, or runaspw. Use an account or recovery shell that can read sudoers. If you are already in a root shell, omit sudo from the grep commands.
sudo grep -R -E '^[[:space:]]*Defaults.*(rootpw|targetpw|runaspw)' /etc/sudoers /etc/sudoers.d
No output means those password-changing defaults are not present. Next, confirm the sudo group still has the standard Linux Mint rule:
sudo grep '^%sudo' /etc/sudoers
The default configuration should show:
%sudo ALL=(ALL:ALL) ALL
This line grants all sudo group members full privileges using their own password. If the line is missing, modified, or paired with a password-changing default, repair the file with visudo and validate the policy with sudo visudo -c before testing again.
Fix sudo: command not found on Linux Mint
If the shell cannot find sudo at all, the package is missing or was removed. Sign in as root with su - if a root password exists, or use a recovery shell, then reinstall the package without the sudo prefix:
apt-get update
apt-get install sudo
After reinstalling sudo, add the account back to the sudo group with usermod -aG sudo username if needed, then start a new login session.
Fix Missing Commands After Using sudo on Linux Mint
Some commands available to your regular user may not be found when using sudo because sudo resets the PATH environment variable for security. To run commands from non-standard locations with sudo, provide the full path:
sudo /usr/local/bin/customcommand
Avoid using sudo -E as a routine fix. Preserving a full user environment into a root command can bypass the safer defaults that sudo applies for privileged work.
Conclusion
Your Linux Mint admin workflow now uses the standard sudo-group setup instead of a shared root password, which makes privileged actions easier to audit and revoke later. From here you can install VS Code on Linux Mint or install Git on Linux Mint from the same account whenever you need development tools or package-management access.


Formatting tips for your comment
You can use basic HTML to format your comment. Useful tags currently allowed in published comments:
<code>command</code>command<strong>bold</strong><em>italic</em><blockquote>quote</blockquote>