LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 04-26-2005, 07:05 PM   #1
goodolday
LQ Newbie
 
Registered: Apr 2005
Posts: 6

Rep: Reputation: 0
directory permissions


need some help with this ques in my linux book,

The programmer is to have full access to the programs directory, the two managers should have enough permissions to list and read its contents, while everybody else should have no access to it.

so would i do the cmd like this for the programmers chmod u+rwx programs

and for the managers group i would do chmod o+r

and for everybody else chmod o-rwx

just wondering if i'm on the right track,
 
Old 04-26-2005, 07:27 PM   #2
visaris
Member
 
Registered: Dec 2004
Distribution: gentoo
Posts: 190

Rep: Reputation: 30
That sounds reasonable, but the + makes an assumption about what the current permissions are.

I would do this:
chmod 750 /programs

That should make the directory: drwxr-x---
 
Old 04-26-2005, 07:28 PM   #3
zhangmaike
Member
 
Registered: Oct 2004
Distribution: Slackware
Posts: 376

Rep: Reputation: 31
If you still want to use the new-style arguments instead of octal, you can use = instead of + and stay on the safe side:

Code:
chmod u=rwx DIRECTORY
chmod g=r DIRECTORY
chmod o= DIRECTORY

Last edited by zhangmaike; 04-26-2005 at 07:29 PM.
 
Old 04-26-2005, 07:42 PM   #4
Genesee
Member
 
Registered: Dec 2002
Distribution: Slackware
Posts: 927

Rep: Reputation: 30
Quote:
Originally posted by visaris
That sounds reasonable, but the + makes an assumption about what the current permissions are.

I would do this:
chmod 750 /programs

That should make the directory: drwxr-x---
right - assuming the programmer is the owner, and the managers are the only members of the group
 
Old 04-26-2005, 08:57 PM   #5
visaris
Member
 
Registered: Dec 2004
Distribution: gentoo
Posts: 190

Rep: Reputation: 30
I wanted to add a comment to "zhangmaike". I think you need execute permissions to be able to change to a directory and list it's contents. So I think you mean "chmod g=rx". Someone orrect me if I am wrong.
 
Old 04-27-2005, 02:59 PM   #6
zhangmaike
Member
 
Registered: Oct 2004
Distribution: Slackware
Posts: 376

Rep: Reputation: 31
You're right. You need execute permissions to cd to a directory. But I don't believe you need execute permissions to list / view files within it... only to set the current working directory.

At least... that's what I believe. I don't often use directories without execute permissions.
 
Old 04-28-2005, 02:51 AM   #7
zhangmaike
Member
 
Registered: Oct 2004
Distribution: Slackware
Posts: 376

Rep: Reputation: 31
Slight correction to my last reply - apparently you do need execute permissions to list the contents of a directory. However, you'll get a permissions error for every file within the directory... and that error will say the filename... You just can't see the files' permissions, modification dates, ownerships, etc.

Last edited by zhangmaike; 04-28-2005 at 02:54 AM.
 
  


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
New directory permissions Paulsuk Linux - General 3 05-18-2005 07:36 AM
directory permissions Tinku Linux - General 2 09-25-2004 12:25 PM
write permissions for directory - not accidently move/deleted the directory linuxgamer Linux - Newbie 10 12-02-2003 04:04 AM
directory permissions breadbin Linux - General 3 05-28-2003 06:42 PM
directory permissions knueven7 Linux - Software 1 04-14-2003 10:00 AM


All times are GMT -5. The time now is 08:36 PM.

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