SUDO Access

What is Sudo Access ?

sudo access means giving a normal Linux user permission to run commands with another user’s privileges, usually root.

How to Grant Sudo Access to other user ?

In Linux environments, it is common to have separate operating-system users such as oracle , applmgr for managing the database, Oracle E-Business Suite application tier.

Sometimes these users need elevated privileges to perform administrative tasks. The recommended way to provide administrative privileges is through sudo.

This guide explains how to safely configure sudo access for the OS users like Oracle, Applmgr or any other user.

Prerequisites:

Before making any changes, make sure:

  • You have access to the server as root, or an existing account with sudo privileges.
  • The users should be already exist.

You can verify that the users exist with:

id <username>

id ubuntu
uid=1001(ubuntu) gid=1001(ubuntu) groups=1001(ubuntu),4(adm),24(cdrom),27(sudo),30(dip),101(lxd),988(docker)

If the users exist, you should see their UID, GID, and group information.

We can assign sudo access by directly modifying /etc/sudoers. However, the safest approach is to create a dedicated sudoers file rather than editing /etc/sudoers directly.

We will go with dedicated sudoers file.

1. Log into server as a ROOT server.

2. Create a dedicated sudoers file.

visudo -f /etc/sudoers.d/nonroot_users

Add below lines:

oracle  ALL=(ALL)       ALL
applmgr ALL=(ALL)       ALL
grid    ALL=(ALL)       ALL

Save and exit.

3. Verify the sudoers configuration.

visudo -c
/etc/sudoers: parsed OK

4. Test sudo access

su - oracle
sudo -l

They should be able to run commands with sudo.

If you specifically want these any sudo users to run any command without entering a password,

Use:

oracle  ALL=(ALL)       NOPASSWD: ALL
applmgr ALL=(ALL)       NOPASSWD: ALL
grid    ALL=(ALL)       NOPASSWD: ALL

I’d avoid NOPASSWD: ALL unless you have a specific operational requirement. 

ALL sudo access is already effectively root access, so these accounts should be tightly controlled.

Disclaimer: 

This is an independent personal blog and is not affiliated with, sponsored by, or endorsed by Oracle Corporation. The views, explanations, and experiences expressed here are the author’s own. Commands, scripts, and procedures may be based on Oracle’s official documentation and are provided for educational and reference purposes only. Always test and validate them before use in a Live/Production environment. Sample output shown in this article was generated during the author’s own testing and may vary depending on the environment.

Please read full Disclaimer.