| Home |
| Whats New? |
| Links |
| Search |
| FAQs |
| Forums |
| Downloads |
| Latest Freelance Jobs |
| Archives |
| FIle Archives |
|
Assorted scripts
(1) |
|
DewNewPHPLinks
(7) |
| Captcha add-on for DewNewPHPLinks 2.0 |
|
| DewNewPHPLinks 2.1.0.1 |
|
| Mozilla Firefox Bookmark Importer |
|
| DewNewPHPLinks Bookmarklet creator v 0.99 |
|
| DNPL Ban List 1.0 |
| CHMOD Whats with those numbers? |
|
|
If you use Linux, or just maintain a website, you have undoubtedly had to do something to adjust permissions on a file or a directory. With many of todays programs handling the details for you, I find there are many otherwise experienced webmasters who don't have a clue how the Linux file permissions work. Well hopefully after reading this, it'll be as easy as 123 , or rather 4 2 1
So you've like read some directions somewhere out there with something like chmod the file 755 and the directory 700
First off, the chmod command .. this is Linux'ese for CHange MODe , eg; changing the mode of the file, besides permissions, it can also change something called a sticky bit .. but I'll save that for a later time.
So what about those numbers ?
There will always be 3 digits, sometimes 4, with the first being zero, like
0755 and 755
These are identical as far as chmod is concerned, so for simplicity I'll stick with the 3 digit format.
The first number, sets the permissions of the file owner. That is most likely you, or possibly your webserver's process
The second number sets the permissions for the group members, but today this is rarely used since the typical Linux user is in a group of one.
The last number sets the permssion for everyone else, as such, its the one that will most likely cause issues if incorrect. Its also the one you should as conservative as possible with..
Good... so lets say, the file owner need full permissions on a file, but wanted to keep private data in it, no one else should be able to do anything to the file...
chmod 700 private_file.txt
Ok.. perhaps, we'll allow just members of our group to view the file content by giving them read (4) permssions
chmod 740 private_file.txt
Ok, maybe the info isn't so private anymore.. allow anyone to read the file
chmod 744 private_file.txt
Perhaps allow group members to edit the file, by adding write (2) permissions ..
chmod 764 private_file.txt
Typically, files that make up a wbesite should be chmod 755
Full permissions for the file/directory owner, read and execute permissions for everyone else.
BUT.. sometimes, you need something different. Hopefully this little note will help you to determine what permissions you actually need, and how to make that change yourself.
Regards, Dewed
|
|||
| < Prev | Next > |
|---|