Owners & Permissions...

5 posts / 0 new
Last post
doug-doug the mighty's picture
Offline
Last seen: 2 weeks 4 days ago
Joined: Apr 14 2004 - 17:52
Posts: 1396
Owners & Permissions...

I need help. I will not be offended if you explain this to me like I am stoooopid - the more detail the better!

I have several archival type files and folders I have created while logged in under a given user ("A"). I intended for these to be generic in use and non-private. I want the ability to allow any logged in user to read & write to the folders. the root folder for this is located off of the main branch (on the same level as "Users" and "Applications").

I have since created a new user ("B"). I tried to add files to these folders but was told that I could not modify the folder. After poking around, I discovered that if I change ownership and permissions to match my user ("B"), I could complete my work. As I have numerous files and folders, I will have to do this hundreds of times - PITA!!! when I attempt this on the root folder and say "Apply to enclosed items", it does not propagate the owner and permission change to all folders within or even the non-folder items directly off of the root folder. I also foresee that the items I have assigned to "B" will not be modifiable by "A" unless I change owners (again).

I already repaired disk permissions, but that did not change the items either.

1.) What owner do I need to assign to allow all loged in users (read as "anyone that logs in as any given current and/or future user") to access the contents? (system?, nobody?, mysql?, unknown?, user A?, user B?, ...)

2.) What access must be assigned to the new owner? ( I assume 'Read & Write')

3.) What group do I need to assign? (admin?, bin?, staff?, wheel?, ...)

4.) What access must be assigned to the new group? ( I assume 'Read & Write')

5.) What access must be assigned to the "Others"? ( I assume 'Read & Write')

6.) Is there a better way to do this other than Cmd+I? I already see that that does not propate to all items. Do I need to use something like NetInfo Manager? or do I need to log in as 'root', or what?

TIA

BDub's picture
Offline
Last seen: 2 years 1 month ago
Joined: Dec 20 2003 - 10:38
Posts: 703
If I read correctly, you want

If I read correctly, you want to set the folder permissions recursively so that they're world readable, writable, executable, the whole nine yards

Assume the directory is called "foo".

Go to Terminal. Type: sudo chmod -Rv 0777 /foo

This also gives a verbose listing of all the files affected. I like to have it, just to assure myself that it did go through.

-BDub

BDub's picture
Offline
Last seen: 2 years 1 month ago
Joined: Dec 20 2003 - 10:38
Posts: 703
Re: If I read correctly, you want

sudo chmod -Rv 0777 /foo

Just to break down this statement, because I hate voodoo commands, and this may look like one if you don't know your Unix/BSD/Linux/OS X

'sudo' - This specifies that the command should be run as a superuser. You'll be prompted for a password the first time you use it, as well as anytime you use it after a timeout period.

'chmod' - Change file modes. You want to change who can access the files.

'-R' - Option to do this recursively. In other words, all the files in all the subdirectories, not just the /foo directory itself, but also /foo/bar and /foo/spam (assuming those files existed within /foo

'-v' - Verbose. Show what files are being changed.

'0777' - Specifies the mode that it's set to. The following is quoted from the chmod man page (available by going to terminal and typing 'man chmod':


2000 (the set-group-ID-on-execution bit) Executable files with
this bit set will run with effective gid set to the gid of
the file owner.
1000 (the sticky bit) See chmod(2) and sticky(8).
0400 Allow read by owner.
0200 Allow write by owner.
0100 For files, allow execution by owner. For directories,
allow the owner to search in the directory.
0040 Allow read by group members.
0020 Allow write by group members.
0010 For files, allow execution by group members. For directo-
ries, allow group members to search in the directory.
0004 Allow read by others.
0002 Allow write by others.
0001 For files, allow execution by others. For directories
allow others to search in the directory.

You add together all of the modes you want used. In the form 0xyz (not bothering to explain the first zero, as it could technically be dropped from the statement)

x = permissions for owner
y = permissions for files group
z = permissions for others.

Thus '111' means 'everyone can execute'
'222' means 'everyone can write'
444' means 'everyone can read'

Added together we get '777' meaning everyone (owner, group, and others) an read, write, and execute.

'/foo' - The name of the base directory or file to perform this on.

-BDub

Offline
Last seen: 7 years 1 month ago
Joined: Feb 23 2005 - 05:27
Posts: 233
thanks,

That was one of the best quick explanations i've seen in a while. Well done.

doug-doug the mighty's picture
Offline
Last seen: 2 weeks 4 days ago
Joined: Apr 14 2004 - 17:52
Posts: 1396
Re: thanks,

That was one of the best quick explanations i've seen in a while. Well done.

Yes, thanks! I could not get the '-v' part to go in as dispalyed above and ultimately dropped it since I did not care to se the very long list. The only errors I got were on files that are read-only anyways, like certain applications and downloaded bits that one can use, but not alter (and that was expected).

Problem solved (for now, I think).

Log in or register to post comments