Greenguy's Board


Go Back   Greenguy's Board > Programming & Scripting
Register FAQ Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
Old 2005-05-28, 06:29 AM   #1
japamor
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
__________________
japamor is offline   Reply With Quote
Old 2005-05-28, 07:03 AM   #2
Lemmy
You can now put whatever you want in this space :)
 
Lemmy's Avatar
 
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!
Lemmy is offline   Reply With Quote
Old 2005-05-28, 08:20 AM   #3
Useless
Certified Nice Person
 
Useless's Avatar
 
Join Date: Oct 2003
Location: Dirty Undies, NY
Posts: 11,268
Send a message via ICQ to Useless
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.
Useless is offline   Reply With Quote
Old 2005-05-28, 08:30 AM   #4
Cleo
Subversive filth of the hedonistic decadent West
 
Cleo's Avatar
 
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
__________________
Free Rides on Uber and Lyft
Uber Car: uberTzTerri
Lyft Car: TZ896289
Cleo is offline   Reply With Quote
Old 2005-05-28, 10:55 AM   #5
Barron
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.
Barron is offline   Reply With Quote
Old 2005-05-28, 12:26 PM   #6
japamor
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.
__________________
japamor is offline   Reply With Quote
Reply


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 On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 01:46 AM.


Mark Read
Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
© Greenguy Marketing Inc