![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Sticky Bit???? | skyineyes | UNIX for Dummies Questions & Answers | 10 | 05-29-2008 01:15 PM |
| Sticky Bit | teenu18 | UNIX for Dummies Questions & Answers | 3 | 12-17-2007 03:08 PM |
| sticky bit | manu.vmr | Shell Programming and Scripting | 2 | 02-02-2007 07:43 AM |
| Sticky Bit | rob11g | UNIX for Dummies Questions & Answers | 1 | 03-14-2005 04:51 PM |
| Sticky bit | LivinFree | UNIX for Dummies Questions & Answers | 3 | 07-20-2001 11:28 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
I have a script that I want to be able to let user 'wcs1234' execute it, but when it runs, it will do so under the higher authority of 'cdunix'. It is my understanding that I accomplish this with a sticky bit. I have tried every variation of this but am unable to get this to work.
my script is as follows: !bin/ksh cd /opt/cmunix/teststage ls -lt # whoami print -n "enter file to copy....." read file echo $file " copied to stage directory.." # cp -p /opt/cmunix/teststage/$file /opt/cmunix/stage/ exit 0 my permissions are as follows: -rwxrwsr-x 1 cdunix sterling 511 Feb 04 15:41 cptostage.sh any help would be greatly appreciated.... Todd |
|
||||
|
The checking for user bit is as per below:
SCRIPT_USER=wcs1234 WHOAMI=$(/usr/ucb/whoami) if [ "$WHOAMI" != "$SCRIPT_USER" ];then echo "$CallName: script must be run by $SCRIPT_USER" exit 1 else echo "You are $WHOAMI - OK to continue..." fi Not sure how to make this execute with another user though....but here's half to check the user. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|