Sponsored Content
Full Discussion: SUDO help with command alias
Top Forums UNIX for Dummies Questions & Answers SUDO help with command alias Post 302880927 by mbak on Tuesday 24th of December 2013 04:41:02 PM
Old 12-24-2013
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
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

I want to create a command alias

I want to create a command alias. I know what shell I'm using, I just don't know which file to inter the command alias. When I type "echo $SHELL" the output is as follows: bin/sh If I'm correct, this is the bourne shell. Does anyone know which file to edit in this particular shell? Thanks. (2 Replies)
Discussion started by: cstovall
2 Replies

2. UNIX for Advanced & Expert Users

alias for rm command

Hi, i want to make alias for rm command. It should actually move the file to a directory in my home. Say if i type %rm abc.txt the command should expand to %mv abc.txt ~ashishp/trash How should I write the alias for this? -Ashish (8 Replies)
Discussion started by: shriashishpatil
8 Replies

3. UNIX for Advanced & Expert Users

alias and sudo

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... (7 Replies)
Discussion started by: Nicol
7 Replies

4. UNIX for Advanced & Expert Users

Alias a command

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... (2 Replies)
Discussion started by: b_garima
2 Replies

5. UNIX for Dummies Questions & Answers

Problems with Alias, /bin/sh and sudo

'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... (0 Replies)
Discussion started by: stulincoln
0 Replies

6. UNIX for Advanced & Expert Users

alias command in script

How can I embed alias command inside the unix script? Script: echo "...." ... ... alias aa=/usr/bin/telnet ... ...The above script is not working. If I type aa hostname in the command prompt 'TELNET' terminal is not opening. Regards,... (2 Replies)
Discussion started by: sharif
2 Replies

7. UNIX for Dummies Questions & Answers

alias command within .profile

Please could someone advise me the command - to set up aliases commands within a .profile using shell sh regards venhart (13 Replies)
Discussion started by: venhart
13 Replies

8. UNIX for Dummies Questions & Answers

Unable to use the Sudo command. "0509-130 Symbol resolution failed for sudo because:"

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:... (1 Reply)
Discussion started by: Chloe123
1 Replies

9. Shell Programming and Scripting

ssh foo.com sudo command - Prompts for sudo password as visible text. Help?

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... (9 Replies)
Discussion started by: fluoborate
9 Replies

10. Shell Programming and Scripting

Alias command help

Hello, I'm attempting to configure shell settings in my new Macbook. The standard unix command line 'alias' doesn't seem to be working: bash-3.2$ alias dir ls -la bash: alias: dir: not found bash: alias: ls: not found bash: alias: -la: not found bash-3.2$ alias dir 'ls -la' bash:... (1 Reply)
Discussion started by: palex
1 Replies
GZEXE(1)						      General Commands Manual							  GZEXE(1)

NAME
gzexe - compress executable files in place SYNOPSIS
gzexe name ... DESCRIPTION
The gzexe utility allows you to compress executables in place and have them automatically uncompress and execute when you run them (at a penalty in performance). For example if you execute ``gzexe /usr/bin/gdb'' it will create the following two files: -rwxr-xr-x 1 root root 1026675 Jun 7 13:53 /usr/bin/gdb -rwxr-xr-x 1 root root 2304524 May 30 13:02 /usr/bin/gdb~ /usr/bin/gdb~ is the original file and /usr/bin/gdb is the self-uncompressing executable file. You can remove /usr/bin/gdb~ once you are sure that /usr/bin/gdb works properly. This utility is most useful on systems with very small disks. OPTIONS
-d Decompress the given executables instead of compressing them. SEE ALSO
gzip(1), znew(1), zmore(1), zcmp(1), zforce(1) CAVEATS
The compressed executable is a shell script. This may create some security holes. In particular, the compressed executable relies on the PATH environment variable to find gzip and some standard utilities (basename, chmod, ln, mkdir, mktemp, rm, sleep, and tail). BUGS
gzexe attempts to retain the original file attributes on the compressed executable, but you may have to fix them manually in some cases, using chmod or chown. GZEXE(1)
All times are GMT -4. The time now is 02:19 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy