PDA

View Full Version : Changing Permissions


ep2002
01-19-2005, 07:58 PM
Hi there,

How do I change the permissions on a file?

Also, what are the numeric codes I need to change them to?

With my previous FTP program it only had me check off read, write etc., so I don't know what the numeric values are supposed to be or what they all mean as it's only once in a blue moon a programmer makes me change these things LOL

Thanks a ton & have a great night !


Michelle

MxxCon
01-19-2005, 08:36 PM
right click on file or dir you want to change and select 'attributes(chmod)'


for example you have "-rw-------" for files, and "drwxr-xr-x" for directories. The numerical equivalent of this is 600 and 755. The first number controls the "owner" permissions, the latter two, the "group" and the "world" permissions.

How is this arrived at? Each letter has a value assigned to it:

* Null, or "-" = 0
* Execute, or "x" = 1
* Write, or "w" = 2
* Read, or "r" = 4

Adding them up arrives at a value for the group they control. Thus, in the above examples, "600" (r = 4) + (w = 2) = 6, results in "rw-" for the "owner" permissions, and 0 = "---" and "---" for the group and world permissions

More examples:

"chmod 644 [filename]" will result in "-rw-r--r--";
"chmod 755 [directory]" will result in "drwxr-xr-x";
These are the default permissions any new directories you create will have. They enable anyone to enter the directory and list the files inside it.
"chmod 777 [directory]" willl result in "drwxrwxrwx"

ep2002
01-19-2005, 08:56 PM
Thanks a ton :)


Michelle