Home.Hosting.Domain names.Typo3.F.A.Q.Contact.Search.Français.












    Help Desk : click here

    Toll free : 1-877-990-7760
    Local: 514-990-7760

    ICQ : 16614979
    MSN :
    AIM : cablannet

Permissions.


Table of permissions

Number 
Read(4) 
Write(2) 
Execute(1) 
 
 
 
 
 
 
 
 
 
 
 
 

Permissions in Linux.

The Linux filesystem uses permissions to define the rights each user has when accessing a file.

 

3 majors rights can applied to every file :

 

Read.
Write.
Execute.

 

The first two rights are simple to understand, they determine if a file can be read from and written to, respectivly.

 

The third right determines if the file can be run, which is only applicable to certain types of files.

 

For example, a directory that cannot be read, will not list it's content, a directory that doesn't allow writes will not allow creating new files and a directory that cannot execute will not allow to change to that directory.

 

 


User:group:everyone

In reality, each file has 3 sets of permissions, often represented as 4 numbers such as :

 

0755

 

The first 0 simply indicates Linux to threat the number as an octal number, and not as a decimal number. When using permissions, it is easier to use the octal number. For example. 0755 in decimal is 493.

 

The next three digits are the permissions for the owner of the files, the other members of the group of the file and finally everybody else.

 

Each and every file in your account is marked as being owned by you. As such, the first digit ( the 7  in this case ) defines your rights on the file.

 

Each and every file in your account is marked as being owned by a group with your name, which contains only you. As such, the second digit ( the first 5 in this case ) is not really used.

 

The third digit defines the rights of every other users on the server for that file. If you mark a file as world writtable ( ex : 0766 or 0777 ) then every other user on the server can modify that file.

 

Fortunately, the webserver runs as the user nobody and it is not a member of your group, as such if you want files to be writtable by the webserver, you need to give everyone access to this file.

 

In general, the webserver doesn't modify files. However, if you use Perl to modify a file, that file will require everyone to be able to write to it.

 

This is not true in PHP however... and it is partly why we strongly recommand the use of PHP over Perl and Python. Please read the section about PHPSuexec to know the difference.

 


Why is that important to know ?

Because every file must have it's rights set properly in order to be used.

 

If you only use HTML pages and images, then you shouldn't worry : the default permissions are valid, since by default every file is readable to the web user and HTML pages do not need to be executable.

 

But if you use scripts, they will require to set the executable rights, and if they write to files, they will required to have the world writtable flag set on.

 

Again, this is not the case for PHP on our servers. Please read all about PHPSuexec here.



Start your own web hosting business !

Refreshing Web designat refreshing prices