Other user should not read the file but can execute

Hi,

I have one script for which I want that other user should not read the script file but can execute. Is there any method ?

I tried by giving 711 but it gives Permission denied to other users.

For Generic User id as a work around , I have created alias in .bashrc file and other user can run the alias(although not a good idea).

But for Individual id , I am not able to do anything. Please help.

This is not possible with regular unix permissions. In order for a user to be able to execute a script he needs to able to read it.
You may probably be able to accomplish this using sudo
Another method is to obfuscate the script with a script "compiler", which would however not stop a determined user and offers no real security...

Hi.

Suggestions, comments:

1) Consider the use of ACLs:

-- man pages, and Learn to use extended filesystem ACLs - TechRepublic

However, scripts probably will still need read permission to execute (I have not tried ACLs with that goal in mind).

2) Re-write the script in an executable language, c, Fortran, etc., and look at post #16 in thread How to compile .sh script using g++?

3) Take a step back and tell us WHY you want to exclude read permission.

Best wishes ... cheers, drl

@drl, I don't think ACL's are going to be of help here, seeing as a user needs to be able to read a script in order to be able execute it as himself.

Hi, Scrutinizer.

Agreed for that specific task, hence the caveat in item 1, and suggestion 3 to elicit the real reason ... cheers, drl