Linux: Add passwordless sudo permission to user

In this blog, I will provide passwordless sudo permission to oracle user for testing purposes. Change the username as needed.

1. As the root user, create a separate group for the purpose of granting sudo privileges. Choose a desired name for the group.

# groupadd oracle_sudoers

2. Use the usermod command to add the oracle user to the group:

# usermod -aG oracle_sudoers oracle

3. Update /etc/sudoers using visudo command

# visudo

Add the following line:

%oracle_sudoers ALL=(ALL) NOPASSWD: ALL

Explanation (read carefully):

PartMeaning
%oracle_sudoersRefers to a Linux user group called oracle_sudoers. The % symbol means “group” and not a specific user. So this applies to all users who are members of this group.
ALL=(ALL)Members can run commands as any user, including root.
The first ALL refers to any host (typically used in multi-host sudo configs).
The (ALL) means as any target user.
NOPASSWD:Allows these users to run sudo commands without being prompted for a password.
ALLThey are allowed to run any command with sudo. You can also restrict the group to execute only the specific commands you designate in this section.

⚠️ Security Note:

This provides full root-level access without password prompts to members of oracle_sudoers, so it should be used with caution and only for trusted administrative users (e.g., DBAs or sysadmins).

Unknown's avatarAbout Mariami Kupatadze
Oracle Certified Master Linkedin: https://www.linkedin.com/in/mariami-kupatadze-01074722/

One Response to Linux: Add passwordless sudo permission to user

  1. Hi,

    Thank you very much for this post.

Leave a reply to databasenotes Cancel reply