4WebHelp: Permissions and CHMODing

Permissions tend to be more important to Perl Scripts as Perl Scripts usually write to directories and files rather than a database like PHP.

Anyway, Permissions (Or CHMODs as the Linux term) is just the Linux way of assigning "who is allowed to do what".

First you will need to get yourself a good FTP client like CuteFTP (it does permissions/CHMODs visually) although you can use SSH and type in commands for CHMODding files and folders manually. For CuteFTP, you simply need to right-click the uploaded file or folder in the remote window and click Properties/CHMOD. You should see a box where you can type a number and a a bunch of tick boxes near it.

A CHMOD is a number, it references reading, writing, execution and group access of a file or folder.

In various ReadMe files for Perl scripts one may see instructions such as CHMOD 777 a specific file or folder.

In these three digit CHMOD numbers the first digit indicates the permissions for the owner, the second is the permissions for other members of the same "group" as the owner and third is the permissions for "others", aka the public at large.

You might also find permissions specified in rwx format (r= Read, w= Write, x =eXecute), ex: 600 = -rw-rw-rw-

In the three-digit number format the individual numbers are derived by adding up the permissions with 1=execute, 2=write and 4=read (read, write and execute = 4+2+1 -> 7)

644 (-rw-r--r--) = "I don't mind if other people can read this file, however only I should be able to run or write to/edit it"

755 (-rwxr-xr-x) = "I don't mind if other people can read or run this file, however only I should be able to write to/edit it"

777 (-rwxrwxrwx) = "Anybody can do anything they want (read, run, modify) with this file"

Permissions can be modified in a number of ways:

© 4WebHelp and Justin

Latest comments on this tutorial
Thanks, need this for my 'Computer Systems & Networks' revision. Smile
you need to have the CHmod set to 777 when you are trying to make some new file in some folder or try to edit the current file via script .

But if you have folder created the folder/dir using the PHP commands then you can also do the same using the 755 persmissions as well.

Hi, look this is a result of your help. The web forum I mentioned above is running now !
[Link Removed]
Thank you for this CHMOD explanation, I used my host's c/panel to set up my ShoutBox on my website and finaly people can use it, it's at: [Link Removed]
Longer I was trying to figure this out in dreamweaver's ftp program and I couldn't, but now I know, thanks again.
PS:Now I must learn how to set up in there forum writen in perl.
Nice and simple, very effective.
It only took me a minute or so to read and now I know how to CHMOD and even the combinations given above. All tutorials should be this easy to follow.

Add a new comment

Page URL: http://www.4webhelp.net/tutorials/misc/chmod.php
Back to the "pretty" page!

© 2020, 4WebHelp Team.