Operating System - HP-UX
1753774 Members
6522 Online
108799 Solutions
New Discussion юеВ

Re: sudo - configuring the sudoers file

 
Jim Wolff
Occasional Advisor

sudo - configuring the sudoers file

Can someone please help me.
I have read the man pages on sudo, sudoers, and visudo and can still not determine the proper syntax for adding a user the capability to execute certain commands (as root user using the sudo command).

I simply want to grant my DBA the ability to execute pfs_mount, root.sh (owner by Oracle but must be run by root), mkdir, and a couple of other commands.

I have even gone to the SUDO page: http://www.courtesan.com/sudo/ and can still not find any examples of putting an entry type that I need into the sudoers file.

My current type entries are:

# Host alias specification

# User alias specification

# Cmnd alias specification

# Runas alias specification

# User privilege specification
root ALL=(ALL) ALL
joeDBA ALL=(ALL) ALL

I would like to give user joeDBA only certain privileges, not all of root's.

Thanks in advance...

jim
Sr. Oracle DBA
3 REPLIES 3
RikTytgat
Honored Contributor

Re: sudo - configuring the sudoers file

Hi,

What about:

# Host alias specification
Host_Alias HOSTS = aldebaran

# User alias specification
User_Alias ADMIN = rik

# Cmnd alias specification
Cmnd_Alias ADMIN_CMDS = /usr/bin/ksh, /bin/bash

# Runas alias specification
Runas_Alias ADMIN_RUNAS = root, oracle

# User privilege specification
root ALL = (ALL) ALL
ADMIN HOSTS = (ADMIN_RUNAS) ADMIN_CMDS


Above example works on my host.

Hope this helps,
Rik.
Rick Garland
Honored Contributor

Re: sudo - configuring the sudoers file

I have attached a sudoers file that I have been using. It doesn't contain the pfs_mount but I believe it will get you what you need.

RikTytgat
Honored Contributor

Re: sudo - configuring the sudoers file

Hi,
Forgot to mention that the sudoers manpage contains a good example.

See http://www.courtesan.com/sudo/man/sudoers.html

Bye,
Rik