Sudo for a command


 
Thread Tools Search this Thread
Operating Systems Solaris Sudo for a command
# 1  
Old 03-12-2008
Sudo for a command

I am trying to set up sudo for a command, but do not want to specify the arguments that can be passed into it. I want the user who is using sudo to be able to pass in the arguments they want. I am fairly sure I know how to do this with RBAC in Solaris 10, but for reasons I will not get into I cannot use RBAC.

In summary, is there a way to set up sudo so the user can get at a command like /usr/sbin/projadd but be able to pass in their own arguments to it?

TIA.
# 2  
Old 03-17-2008
Quote:
Originally Posted by synchro
....
In summary, is there a way to set up sudo so the user can get at a command like /usr/sbin/projadd but be able to pass in their own arguments to it?
From the sudoers man page:
A commandname is a fully qualified filename which may
include shell-style wildcards (see the Wildcards section below). A
simple filename allows the user to run the command with any
arguments he/she wishes.

So in your case the following will allow 'username' to run projadd with any arguments.

username ALL = /usr/sbin/projadd
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

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

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

3. Red Hat

Sudo command configs

I am wondering how to use SUDO command to allow only my account to run mount command as root. I have root privilege.:confused: (4 Replies)
Discussion started by: almirzaee
4 Replies

4. UNIX for Dummies Questions & Answers

sudo - command usage

Hi, I have few doubts regarding "sudo" command. It acutally allows access to other commands as a different user. It stands for "superuser do". Now, we execute a command as sudo su - oracle Can you please tell me what does it do actually, thank you. (6 Replies)
Discussion started by: Dev_Dev
6 Replies

5. UNIX for Dummies Questions & Answers

CentOS using sudo command

Hi, this is my first time posting here and am new to linux/unix. So here is my question. I have two user account and a root account. root user account 1:calchen1 user account2: calchen2 Now i want to use the sudo utility to allows user to run programs with the privileges of another... (1 Reply)
Discussion started by: coolcalin812
1 Replies

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

7. UNIX for Advanced & Expert Users

Sudo command

Hello, What does the below sudo command provide access to, does it allow a user to su to any other user except root. sudo !/usr/bin/su * (1 Reply)
Discussion started by: sophos
1 Replies

8. UNIX for Advanced & Expert Users

Sudo command problem

Hi All, I am tring to redirect mails comming to my user id to a script. In other word trigger a script when a mail comes to my user id. Actually , Admin team has done all this to me previously. in my script i am doing like /usr/local/bin/sudo -u parbrxs /export/home/parbrxs/bin/parbrxs.sh... (4 Replies)
Discussion started by: mindtee_abhi
4 Replies

9. Shell Programming and Scripting

sudo command with password

Hello everybody, Say I forgot my root password (shit happens, no?) and I'd like to brutally try 100 possibilities to delete a file using sudo. How can I make a script that tries all the passwords? The following doesn't work. Do you have a clue? foo:~$ cat test sudo rm dummy <<< 'password' echo... (1 Reply)
Discussion started by: chebarbudo
1 Replies

10. Shell Programming and Scripting

sudo command remotely

Hi, can any one of you help me how to run sudo commands/scripts remotely... (2 Replies)
Discussion started by: pvamsikr
2 Replies
Login or Register to Ask a Question