Today (Saturday) We will make some minor tuning adjustments to MySQL.

You may experience 2 up to 10 seconds "glitch time" when we restart MySQL. We expect to make these adjustments around 1AM Eastern Daylight Saving Time (EDT) US.


SUDO help with command alias


 
Thread Tools Search this Thread
# 1  
SUDO help with command alias

Hi there,

I'm trying to setup sudo privileges for a user, Oracle in this case, to run Unix commands like mv,chmod, chown, mkdir, rmdir against their own set of commands or scripts.
Is there an easier way to do this than to give Unix commands for each of their respective commands as shown below since I'd have to do this for 30+ Oracle user commands ?

Code:
For eg...
User_Alias TESTGRP = %orauser

Cmnd_Alias TESTCMD=/usr/bin/mv /opt/oracle/bin, \
/usr/bin/chmod /opt/oracle/bin, \
/usr/bin/chown /opt/oracle/bin, \
/usr/bin/mkdir /opt/oracle/bin, \
/usr/bin/rmdir /opt/oracle/bin, \

/usr/bin/mv /opt/oracle/tmp, \
/usr/bin/chmod /opt/oracle/tmp, \
/usr/bin/chown /opt/oracle/tmp, \
/usr/bin/mkdir /opt/oracle/tmp, \
/usr/bin/rmdir /opt/oracle/tmp, \

/usr/bin/mv /opt/oracle/sbin, \
/usr/bin/chmod /opt/oracle/sbin, \
/usr/bin/chown /opt/oracle/sbin, \
/usr/bin/mkdir /opt/oracle/sbin, \
/usr/bin/rmdir /opt/oracle/sbin

TESTGRP ALL = TESTCMD

Thanks
/M

Last edited by mbak; 12-25-2013 at 08:22 PM.. Reason: removed unwanted space
# 2  
What OS is this?
Many of your commands would depend of OS (some allow users to chmod, chown… others don't…) and initial permissions in parent directories…
using groups and chmod 2775 <dir> can be of some help...
# 3  
This is for AIX/Linux and sudo does work on both OS if I use chmod,chown...etc individually as listed in my eg...for each of the Oracle user's commands but its tedious doing them individually if you have 20+ or 30+ Oracle user commands to run against.
 

|
Thread Tools Search this Thread
Search this Thread:
Advanced Search

More UNIX and Linux Forum Topics You Might Find Helpful
ssh foo.com sudo command - Prompts for sudo password as visible text. Help?
fluoborate
I am writing a BASH script to update a webserver and then restart Apache. It looks basically like this: #!/bin/bash rsync /path/on/local/machine/ foo.com:path/on/remote/machine/ ssh foo.com sudo /etc/init.d/apache2 reloadrsync and ssh don't prompt for a password, because I have DSA encryption...... Shell Programming and Scripting
9
Shell Programming and Scripting
Unable to use the Sudo command. "0509-130 Symbol resolution failed for sudo because:"
Chloe123
Hi! I'm very new to unix, so please keep that in mind with the level of language used if you choose to help :D Thanks! When attempting to use sudo on and AIX machine with oslevel 5.1.0.0, I get the following error: exec(): 0509-036 Cannot load program sudo because of the following errors:...... UNIX for Dummies Questions & Answers
1
UNIX for Dummies Questions & Answers
Problems with Alias, /bin/sh and sudo
stulincoln
'exec /bin/sh' breaks alias -------------------------------------------------------------------------------- I have an application that requires su to root in order to run some commands. Unfortunately, my corporate policy only allows sudo so I created an alias in .profile as "alias su="su...... UNIX for Dummies Questions & Answers
0
UNIX for Dummies Questions & Answers
Alias a command
b_garima
Hi 'm executing a java program from my shell script on solaris 9 as $JAVA_HOME\bin\java -ms32m -mx128m -classpath $CLASSPATH com.abc.fwk,abcServer.abcfwkServer $1 & where $1 is port number when i do ps -ef, it shows whole command , i want to give this some alias name as abcProcess, so...... UNIX for Advanced & Expert Users
2
UNIX for Advanced & Expert Users
alias and sudo
Nicol
I'm using personal user to enter telnet session then manually connecting to a generic user using the following : sudo -H -u $1 ksh -c ". ~$1/.profile && cd ~$1 && ksh" ; where $1 is the generic user. It works but in the ".profile" execution , the alias are not working when the generic...... UNIX for Advanced & Expert Users
7
UNIX for Advanced & Expert Users

Featured Tech Videos