![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Advanced & Expert Users Advanced UNIX and Linux questions go here. Expert-to-Expert. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Use of sudoer with ssh login shell script (KSH) | rockysfr | UNIX for Advanced & Expert Users | 0 | 06-30-2007 08:28 PM |
| Passing parameters through a file | chawlaaman | Shell Programming and Scripting | 3 | 07-17-2006 11:56 AM |
| Failed to export parameters from configuration file | nir_s | Shell Programming and Scripting | 5 | 01-16-2006 12:03 AM |
| Another SUDOER Question... | scottsl | UNIX for Advanced & Expert Users | 0 | 11-11-2005 02:03 PM |
| Root privileges &Sudoer | blue_7 | UNIX for Dummies Questions & Answers | 2 | 06-09-2004 01:05 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Sudoer file - controlling parameters
Greetings all,
I'm interested in knowing more about setting up the sudoers file... hope to receive some advice here. Let's say that I have 3 users, with usernames user1, user2 and user3. The following rules would apply for each user: user1 can only use the command ksh a.sh to launch himself into the a.sh shell script. user2 can only use the command ksh b.sh ABC to launch himself into the b.sh shell script. The 3rd argument (or parameter) must strictly be the string "ABC", else we should deny access. user3 can only use the command ksh b.sh DEF to launch himself into the b.sh shell script. The 3rd argument (or parameter) must strictly be the string "DEF", else we should deny access. What are the declarations that I should make in the sudoer file for each of the 3 users? Thanks in advance. |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
1. add the below line at the top of scripts a.sh and b.sh(check exact path of ksh on your system) to avoid using ksh to run the scipts.
#!/usr/bin/ksh 2. put the scripts alongwith arguments into another script: echo "b.sh ABC" >/sbin/user2_script.sh;chmod +x /sbin/user2_script.sh echo "b.sh DEF" >/sbin/user3_script.sh; chmod +x /sbin/user3_script.sh 3. add the below entries to sudoers file: user1 ALL = NOPASSWD: /sbin/a.sh (whatever path exactly on your system) user2 ALL = NOPASSWD: /sbin/user2_script.sh user3 ALL = NOPASSWD: /sbin/user3_script.sh DONE |
|||
| Google The UNIX and Linux Forums |