LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-23-2007, 03:36 PM   #1
baddah
Member
 
Registered: Feb 2006
Location: Cape Town,South Africa
Distribution: Fedora Core 8
Posts: 183

Rep: Reputation: 30
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.
 
Old 05-23-2007, 03:45 PM   #2
custangro
Senior Member
 
Registered: Nov 2006
Location: California
Distribution: Fedora , CentOS , RHEL
Posts: 1,969
Blog Entries: 1

Rep: Reputation: 208Reputation: 208Reputation: 208
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

Last edited by custangro; 05-23-2007 at 03:48 PM.
 
Old 05-23-2007, 03:48 PM   #3
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387
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.
 
Old 05-23-2007, 04:08 PM   #4
baddah
Member
 
Registered: Feb 2006
Location: Cape Town,South Africa
Distribution: Fedora Core 8
Posts: 183

Original Poster
Rep: Reputation: 30
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Permissions cannot touch `testFile': Read-only file system windsurfer Linux - Software 2 04-17-2007 08:13 AM
cannot execute binary file, though ownership and permissions are set correctly :( rahmmandel Linux - Software 6 01-11-2007 09:45 AM
Permissions to execute...? Elric of Grans Linux - Software 3 01-07-2007 07:24 PM
Read contents of file and execute command cosiek Programming 3 09-30-2003 12:07 PM
How to set permissions to read, execute, write for users only chupacabra Linux - General 3 12-18-2002 04:54 PM


All times are GMT -5. The time now is 06:10 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration