Giving others execute privileges


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Giving others execute privileges
# 1  
Old 01-17-2006
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!
# 2  
Old 01-17-2006
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  
Old 01-17-2006
You might try placing a space between the . and the first / like this:
. /usrhome/ncora/script_test/script1.sh
# 4  
Old 01-18-2006
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  
Old 01-18-2006
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  
Old 01-18-2006
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  
Old 01-18-2006
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.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

X11 privileges

Hi What privileges I need to install X11? Or, in other words, can I install X11 without root privileges? The only user that installed X11 will use it. If it depends on OS version, here is the list of operating systems: Linux Red Hat Enterprise AS/ES 4.0/4.5/5 ... (1 Reply)
Discussion started by: lleontiev
1 Replies

2. Shell Programming and Scripting

Privileges like root

My English is no very good. I must make a bash scripting sh create like a backdoor, and when execute the script a user without privileges convert in super user or root, whithout introducing the password. In Spanish: Crear un script que sirva como puerta trasera al sistema, de manera que al... (1 Reply)
Discussion started by: kitievbr
1 Replies

3. Shell Programming and Scripting

How to execute a script without giving x permission to the file?

How to execute a script with out giving x permission to the file? (7 Replies)
Discussion started by: praveen_b744
7 Replies

4. Web Development

no privileges in phpMyAdmin

Salamo Alikom i had install MySQL 5.1.33 binary version for FreeBSD ,when i logging to phpMyAdmin as root i see no privilege to create database ,how can i solve this problem ? (1 Reply)
Discussion started by: SIFE
1 Replies

5. AIX

copy a fs with the same privileges

Hi All, I use "cp -R /fs/* /newfs" and I can copy everything except it won't have the files/directories the same privileges. Is there a trick to this without using a software-backup. Thanks in advance, itik (3 Replies)
Discussion started by: itik
3 Replies

6. UNIX for Dummies Questions & Answers

root privileges

Hello, As admin with root rights, to execute any command from another user without password-ask, I do : su - <user> -c "<cmd>" But how can I do to give the same rights to another physical user without using root user ? :confused: I've try to create another user "toor" with the same primary... (4 Replies)
Discussion started by: madmat
4 Replies

7. UNIX for Dummies Questions & Answers

ACL vs privileges

Hello genius..! what do y'all think of these questions...? help appreciated...! Access Control Lists and privileges.... # Why both file ACLs and user permissions/privileges (not to be confused with rights in ACLs) are used in Windows access control (why not just use one of these)? # In... (1 Reply)
Discussion started by: heroine
1 Replies

8. Programming

root privileges

Hi I have make a program that needs root privleges but any user can try to run it, so what I want it is, when any user tries( other than root ) to run the program, an input prompt would open to enter root password ( if user knows ) and program will run ( otherwise exit ), and after completing... (21 Replies)
Discussion started by: sumsin
21 Replies

9. UNIX for Dummies Questions & Answers

privileges

I have a website that I am working on and one of the pages allows people to upload pictures to be used on other pages. My question is: is it safe to set the privileges to 777 on the folder that the pictures are saved in? Or would that open up my site to be hacked, bugged, wormed...and everything... (1 Reply)
Discussion started by: paladaxar
1 Replies

10. UNIX for Advanced & Expert Users

User Privileges

I have used several Linux Flavors and now I need to know something. I have the ROOT user and then I have my personal user. What I need to do is for my normal user to be able to write files to directories where appearntly, only the root user has privileges. For example, to write files to... (1 Reply)
Discussion started by: gdboling
1 Replies
Login or Register to Ask a Question