Unix/Linux Go Back    


UNIX for Dummies Questions & Answers This forum is closed for new posts. Please post beginner questions to learn unix and learn linux in this forum UNIX for Beginners Questions & Answers

SUDO help with command alias

UNIX for Dummies Questions & Answers


 
 
Thread Tools Search this Thread Display Modes
    #1  
Old Unix and Linux 12-24-2013
mbak mbak is offline
Registered User
 
Join Date: Jan 2008
Last Activity: 5 April 2017, 12:50 PM EDT
Location: Cloud
Posts: 70
Thanks: 17
Thanked 1 Time in 1 Post
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 07:22 PM.. Reason: removed unwanted space
Sponsored Links
    #2  
Old Unix and Linux 12-24-2013
vbe's Unix or Linux Image
vbe vbe is online now Forum Staff  
Moderator
 
Join Date: Sep 2005
Last Activity: 17 October 2017, 10:30 AM EDT
Location: Switzerland - GE
Posts: 6,469
Thanks: 288
Thanked 551 Times in 513 Posts
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...
Sponsored Links
    #3  
Old Unix and Linux 12-24-2013
mbak mbak is offline
Registered User
 
Join Date: Jan 2008
Last Activity: 5 April 2017, 12:50 PM EDT
Location: Cloud
Posts: 70
Thanks: 17
Thanked 1 Time in 1 Post
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.
Sponsored Links
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
ssh foo.com sudo command - Prompts for sudo password as visible text. Help? fluoborate Shell Programming and Scripting 9 11-02-2011 02:18 PM
Unable to use the Sudo command. "0509-130 Symbol resolution failed for sudo because:" Chloe123 UNIX for Dummies Questions & Answers 1 12-21-2009 04:09 PM
Problems with Alias, /bin/sh and sudo stulincoln UNIX for Dummies Questions & Answers 0 05-29-2008 10:47 AM
alias and sudo Nicol UNIX for Advanced & Expert Users 7 05-15-2006 10:17 AM
alias for rm command shriashishpatil UNIX for Advanced & Expert Users 8 02-23-2006 07:42 AM



All times are GMT -4. The time now is 10:44 AM.