Sudo to user other than root but do not allow sudo to root

I have a set of RHEL 5 boxes running our ERP software on Oracle databases. I need to allow my DBA's to su to oracle and one other account (banner) without knowing the oracle or banner password. But I need to prevent them from su'ing to any other user especially root. I only want them to be able to switch to the oracle user or the banner user. I've recreate the accounts on a test system to try and work through my confusion and better understand how to use sudo before implementing it on my production systems.

Typically the user changes to these accounts like this:

>sudo su - oralce

They are then prompted to enter their own password and it lets them in. The problem is that they can use the command to become root, or any other user, as well.

I have a group on my system (enterpriseapps) which contains the users I want to grant access to. I edited my /etc/sudoers file. Here's how it looks:

So, if I understand it correctly, users in the DBA User_Alias should be able to run from any system (ALL) as users in the ORACLE Runas_Alias with NOPASSWD and they should only be able to run the commands in the SU Cmnd_Alias. Of course, I have my sysadmin group setup so that they can become root.

So I configured my Cmnd_Alias two different ways but they both give me same result:

I've been researching this for days now and still having issues. Anybody got any ideas about what I'm missing here? I'm sure I have misconfigured, just can't see the error.

Hi

The issue is, they are not allowed to call su which you do to execute oracle .
As that is not allowed, it will fail.

Therefor, just try

sudo oracle

If that still wont work, and assuming DBA is a group where only users who are allowed to execute ORACLE belong to.
Try this change which should bring the desired change:

DBA ALL=(oracle) NOPASSWD: ALL

NOPASSWD: ALL means that there will be no password required to start anything from 'ALL', which is oracle .

Generaly saying, as i was once told, using sudo su - for 'daily' use is a bad habit.

Greetings, hope this helps