Allow a user use a specific root command!


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Allow a user use a specific root command!
# 1  
Old 01-07-2010
Bug Allow a user use a specific root command!

Hi,
I like to allow an user to permit an root command " /usr/ucb/ps -auxwww", do you know how?

Kind regards
Mehrdad
# 2  
Old 01-07-2010
Install sudo and add this to the sudoers file (using visudo)
Code:
user ALL = (root) /usr/ucb/ps -auxwww

If the user should be able to do this without being prompted for a password:
Code:
user ALL = (root) NOPASSWD: /usr/ucb/ps -auxwww

# 3  
Old 01-07-2010
Why we have to go for sudo ?

What about giving just execute permission to that file. And if need be setting set-user-id bit.
# 4  
Old 01-07-2010
thegeek - what you suggest is a security hole, IMO. It means anybody can excute the command. sudo was built explicitly for the task described - give one-off access to restricted commands & files to one user and run them as root.
# 5  
Old 01-14-2010
So what if everybody can use the command? It's just informative!
# 6  
Old 01-14-2010
First, and IMO foremost, it sets a bad precedent. Users might start thinking that getting privileges that way isn't a problem.
Second, it opens that command up for everyone, not just certain selected people. That might create a security hole. After all, knowing a password isn't a security hole by itself, it's just informative too (Note: this is just an example).
# 7  
Old 01-14-2010
Assuming this is Solaris 10, the issue is discussed at length here:

The Linux and Unix Menagerie: Old Style ps On Solaris 10
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Running a command as another non-root user

Hi, I am trying to run a command within my KSH script as another user due to permission issues, now both users are non root. I have tried the following command and was unsuccessful: echo "<password>" | sudo -S -u <username> -k command Can I use sudo to run a command as a non-root user? (5 Replies)
Discussion started by: MIA651
5 Replies

2. Shell Programming and Scripting

Execute a command with root user

i m logged in with user1 id. i wish to execute the below as root user for which i tried several commands but all of them fail. sudo 'cat /tmp/tmp.file >>/etc/logger' Password: sudo: cat /tmp/tmp.file >>/etc/logger: command not found sudo cat /tmp/tmp.file >>/etc/logger bash:... (5 Replies)
Discussion started by: mohtashims
5 Replies

3. UNIX for Dummies Questions & Answers

Execute a command as root from normal user

Hi , I am trying to stop and start a process using the below code. I have sudo access on my machine ## PID = process id echo "$PASSWD" | sudo -S kill -9 <PID> echo "$PASSWD" | sudo -S /opt/abc/startserver /opt/abc/startserver: error while loading shared libraries: librts.so: cannot open... (6 Replies)
Discussion started by: rakeshkumar
6 Replies

4. UNIX for Dummies Questions & Answers

Sudo to delegate permission from non-root user to another non-root user

I've been through many threads before i decide to create a separate thread. I can't really find the solution to my (simple) problem. Here's what I'm trying to achieve: As "canar" user I want to run a command, let's say "/opt/ocaml/bin/ocaml" as "duck" user. The only to achieve this is to... (1 Reply)
Discussion started by: canar
1 Replies

5. AIX

find command to list all the 777 files and directories owned by root user

Hi I'm logged in to an AIX box now and we need to do an audit on this box. cbssapr01:# pwd / Which command will show all the files and directories owned by root user with permissions as 777 ? (8 Replies)
Discussion started by: newtoaixos
8 Replies

6. Cybersecurity

How to limit patchadd command to root user only?

How to limit patchadd command to root user only? I'm running a solaris 10 5/09 server, I have 2 users other than root. One being able to use the patchadd command and one is unable to do so. What I'm trying to do is to limit the patchadd command so that only root is able to run it. (7 Replies)
Discussion started by: ShouTenraku
7 Replies

7. Shell Programming and Scripting

Execute Root command as Normal user

Hi, We need to execute a root commmand to change the expiry period of a user but we are getting error as permission denied Q How can we execute a root command by a normal user ? :mad: any thing or suggestion will be good .... :b: (3 Replies)
Discussion started by: abhishek1979
3 Replies

8. UNIX for Dummies Questions & Answers

How to allow access to some commands having root privleges to be run bu non root user

hi i am new to unix and i have abig task. i have to \run particular commands having root privileges from a non root user. i know sudo is one of the way but i need sum other approach kindly help Thanks (5 Replies)
Discussion started by: suryashikha
5 Replies

9. Shell Programming and Scripting

root user command in shell script execute as normal user

Hi All I have written one shell script for GPRS route add is given below named GPRSRouteSet.sh URL="www.google.com" VBURL="10.5.2.211" echo "Setting route for $URL for GPRS" URL_Address=`nslookup $URL|grep Address:|grep -v "#"|awk -F " " '{print $2}'|head -1` echo "Executing ... (3 Replies)
Discussion started by: mnmonu
3 Replies

10. Shell Programming and Scripting

login into root from user and execute command through script

i have logged in as user. I want to write a script to login into root and execute commands for eg. ifconfig or other command. kindly help me out. (6 Replies)
Discussion started by: pradeepreddy
6 Replies
Login or Register to Ask a Question