![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | 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 !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| copy a fs with the same privileges | itik | AIX | 3 | 05-08-2008 11:09 AM |
| root privileges | madmat | UNIX for Dummies Questions & Answers | 4 | 04-16-2008 03:00 AM |
| ACL vs privileges | heroine | UNIX for Dummies Questions & Answers | 1 | 12-29-2006 07:19 PM |
| root privileges | sumsin | High Level Programming | 21 | 12-30-2005 12:43 PM |
| privileges | paladaxar | UNIX for Dummies Questions & Answers | 1 | 11-02-2005 05:28 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
Giving others execute privileges
I'm trying to give everyone execute privileges on one of my small scripts. BUT, I don't want them to be able to view the file, just execute it.
As USER1, I have: /usrhome/ncora/script_test CDS> $ls -la drwxrw-rw- 2 ncora ncd 96 Jan 13 15:58 . drwxrwxrwx 7 ncora ncd 2048 Jan 17 08:55 .. -rwx-----x 1 ncora ncd 59 Jan 17 08:57 script1.sh -rwx-----x 1 ncora ncd 76 Jan 13 15:50 script2.sh But, as USER2, if I try: ./usrhome/ncora/script_test/script1.sh i get: sh: /usrhome/ncora/script_test/script2.sh: Cannot find or open the file. Why can't USER2 execute USER1's script?? Thanks! |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
Does USER2 have permissions to the directory the script is in? I would guess from the "cannot find or open the file" message that they don't and therefore they can't see the script to run it.
|
|
#3
|
|||
|
|||
|
You might try placing a space between the . and the first / like this:
. /usrhome/ncora/script_test/script1.sh |
|
#4
|
|||
|
|||
|
I gave everyone read permissions to the directory. Now when USER2 goes to that directory he sees:
$ ls -la total 8 drwxrwxrwx 2 ncora ncd 96 Jan 17 09:07 . drwxrwxrwx 7 ncora ncd 2048 Jan 17 23:55 .. -rwx--x--x 1 ncora ncd 59 Jan 17 08:57 script1.sh -rwx--x--x 1 ncora ncd 76 Jan 13 15:50 script2.sh But I can't seem to be able to execute the script. Is it not possible to have X without R?? Thanks! |
|
#5
|
||||
|
||||
|
First of all, remove the world writable permission from '.' and '..'. You do *not* need that. When you showed the 'ls -la' output in the first post, the problem was that others did not have rights to browse the directory (the x for others was missing from the permissions for .).
If you still are unable to run the script, that is quite surprising. What is the error message that you are getting? |
|
#6
|
|||
|
|||
|
This is what I get now:
$ echo $SHELL /usr/bin/sh $ $ ls -la total 8 drwxrwxr-x 2 ncora ncd 96 Jan 17 09:07 . drwxrwxr-x 7 ncora ncd 2048 Jan 17 23:55 .. -rwx--x--x 1 ncora ncd 59 Jan 17 08:57 script1.sh -rwx--x--x 1 ncora ncd 76 Jan 13 15:50 script2.sh $ ./script1.sh /usr/bin/sh: ./script1.sh: Cannot find or open the file. $ |
|
#7
|
||||
|
||||
|
Is the first line of the file script1.sh "#!/usr/bin/sh" or is it "#!/bin/sh". If it is /usr/bin/sh/ksh/csh, does the file exist?
I have got similar errors before on Linux and BSD systems where the /bin directory is an actual directory and not a symlink to /usr/bin. If that is the case, then /bin/sh exists but not /usr/bin/sh. |
||||
| Google The UNIX and Linux Forums |