# SUDO help with command alias

**URL:** <https://community.unix.com/t/sudo-help-with-command-alias/338040>\
**Category:** UNIX for Dummies Questions & Answers\
**Created:** [December 24, 2013, 4:41pm UTC](https://community.unix.com/t/sudo-help-with-command-alias/338040 "2013-12-24T16:41:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mbak](https://community.unix.com/letter_avatar/mbak/32/6_22734026db12803ebb3e059622ac3534.png) [@mbak](https://community.unix.com/u/mbak)\
**Post date:** [December 24, 2013, 4:41pm UTC](https://community.unix.com/t/sudo-help-with-command-alias/338040/1 "2013-12-24T16:41:02Z")

</div>

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 ?

```nohighlight
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

---

<div class="post-metadata">

**Author:** ![vbe](https://community.unix.com/user_avatar/community.unix.com/vbe/32/266_2.png) [@vbe](https://community.unix.com/u/vbe)\
**Post date:** [December 24, 2013, 7:17pm UTC](https://community.unix.com/t/sudo-help-with-command-alias/338040/2 "2013-12-24T19:17:45Z")

</div>

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...

---

<div class="post-metadata">

**Author:** ![mbak](https://community.unix.com/letter_avatar/mbak/32/6_22734026db12803ebb3e059622ac3534.png) [@mbak](https://community.unix.com/u/mbak)\
**Post date:** [December 24, 2013, 7:35pm UTC](https://community.unix.com/t/sudo-help-with-command-alias/338040/3 "2013-12-24T19:35:47Z")

</div>

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.
