|
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
#1 |
I Love Turkish Delight, they're very moreish.
Join Date: Nov 2004
Location: UK
Posts: 578
|
chmod
I'm just starting to try to get to grips with basic scripting and my eyes keep glazing over.
I've done Google tutorial searches on SSI and CGI and I'm gradually getting a very hazy understanding - very hazy. I keep coming across the instruction to 'CHmod' something to 777 - using CHmod as a verb. This is pure Swahili to me. Is it possible for someone to explain this as if you were talking to an eight year old child please? Thanks in advance japamor ![]()
__________________
![]() |
![]() |
![]() |
![]() |
#2 |
You can now put whatever you want in this space :)
Join Date: Sep 2004
Location: Next door to a kid with a moped.
Posts: 1,492
|
CHMOD refers to read/write/execute permissions on the files on your server. I believe 777 makes a file read/write/executable for everyone. If you use CuteFTP just right-click on a file, choose CHMOD and change the settings
__________________
BUY MY PORNSITES! |
![]() |
![]() |
![]() |
#3 |
Certified Nice Person
|
The CHMOD option may also be labeled as 'Change File Attributes' or just 'Attributes'.
Typically, when clicked, a box will pop up which will show a three rows of permissions. Owner, Group, and Public. Below that will be a small empty text box marked 'Manual'. If you have be given a number like 777 or 644 or whatever, type it into that box.
__________________
Click here to purchase a bridge I'm selling. |
![]() |
![]() |
![]() |
#4 |
Subversive filth of the hedonistic decadent West
Join Date: Mar 2003
Location: Southeast Florida
Posts: 27,936
|
I keep a cheat sheet here
http://www.cleos-porn-links.com/adul...aster-help.php Scroll down just a bit to see two different permissions tools. If you want to change the permissions on a file after you have telneted or SSH in to your server you would type. chmod 755 NAME_OF_FILE and then hit return To do all the files in a directory it is the same but you have to add the reclusive flag like this. chmod -R 755 NAME_OF_DIRECTORY and then hit return |
![]() |
![]() |
![]() |
#5 |
You tried your best and you failed miserably. The lesson is 'never try'
Join Date: Oct 2004
Posts: 166
|
Cleo, thats a cool script you have for that!
japamor, The part that gets confusing is how to put the numbers together. It works like this: Unix type machines allow for three types of users for a file or directory. The "owner", the "group" and "everyone" else. And, they are assigned in that order. For each file created on the server, there are three options for use. This is called giving the file "permissions": r = read the file (see the contents of the file) w = write to the file (make changes) x = execute the file (in the case of a program) Now we have three types of users with three types of options. owner = rwx group = rwx everyone = rwx The server will look at these groups in order and assign the letters(rwx) to each: (Think in terms of columns when reading this with the + being the divider between the columns) owner+group+everyone rwx+rwx+rwx When a file is created the server will automaticly give the basic "permissions": rw- + r-- + r-- This means that you(the owner) can read and write the file, but everyone else, can see the contents but cant make changes to the file. As the unix type operating systems matured, they found that rwx was to confusing, so the assigned numbers to each of the letters: r =4 w = 2 x = 1 That turns this: rwx+rwx+rwx into this: 421+421+421 When you upload a file to the server, the server will give the file basic "permissions" : rw-+r--+r-- 42-+4--+4-- If you dont understand by now, the rest of this wont make any sense. You have learned so far that there are times that you need to change the "permissons" on files and directories. To do this, you use the unix command called "chmod" with some numbers. The next obvious question is, "How do I determine what numbers to use". Remember the numbers we assigned to each of the "permissions"? We simply need to add them together. Lets use the basic server permissions the server assigns: For the owner: rw- or 42- 4 plus 2 plus 0 = 6 For the group: r-- or 4-- 4 plus 0 plus 0 = 4 For everyone: r-- or 4-- 4 plus 0 plus 0 = 4 Putting that all together, the server assigns to the file the basic permissions of: 644 All of the following lines means the same thing: rw-+r--+r-- 42-+4--+4-- 644 Lets say that you have a script that requires the permissions changed to 755. owner = 7 group = 5 everyone= 5 The owner 4 plus 2 plus 1 = 7 The group: 4 plus 0 plus 1 = 5 Everyone: 4 plus 0 plus 1 = 5 rwx+r-x+r-x 421+4-1+4-1 755 Hopefully that didnt totally confuse you. Use that niftly little tool that Cleo has and do some experimenting, you'll get the hang of it pretty quick. |
![]() |
![]() |
![]() |
#6 |
I Love Turkish Delight, they're very moreish.
Join Date: Nov 2004
Location: UK
Posts: 578
|
My sincere thanks to Lemmy, UW, Cleo and Barron.
That really is very helpful - the fog is beginning to disperse and its given me a lot to work on. And that's a great cheat sheet Cleo! Barron, you must have an educational gift 'cos I understood all of your post without getting confused! Thanks all once again. ![]()
__________________
![]() |
![]() |
![]() |
![]() |
|
|