LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   File Permissions - Execute Not Read (https://www.linuxquestions.org/questions/linux-newbie-8/file-permissions-execute-not-read-556160/)

baddah 05-23-2007 02:36 PM

File Permissions - Execute Not Read
 
Hi,

I have a perl script sitting on my server.I want user john to be able to execute,but no read/write to it.So john must be able to execute the script,but if he tries to read the file,he must get access denied.Root must have all permissions on it.How will i do this?I thought doing chmod 771,with owner root should fix it,but not So the file looks like.

Code:

-rwxrwx--x    1 root root 340 May 23 10:53 test.pl
If user john tries to execute it he gets Can't open perl script "./test.pl": Permission denied.

Does the last execute bit not set execution roghts for any user?How will i get this working?

Thanks for the help.

custangro 05-23-2007 02:45 PM

I think he needs read access..

Code:

chmod o+r test.pl
Also, ./test.pl only works if the user is in the directory that the script is in. If the user is not in the directory that the script is in they can type the full path...

Code:

./<path>/test.pl

druuna 05-23-2007 02:48 PM

Hi,

'The world' also needs the read bit (r-x instead of --x). A chmod 775 test.pl should do the trick.

The x bit is for executing, but the user must also be able to read the file in able to execute it.

baddah 05-23-2007 03:08 PM

ok,thanks i saw that 755 works,but i would really prefer the user not to be able to read the file,thought it might be possible with file permissions.Well I'll have to think of something else then.

Thanks


All times are GMT -5. The time now is 07:38 AM.