Guide to file permissions & file rights numbers

This article was written by in March 23, 2015, & may not be posted on other sites!
Original source url for this article: Guide to file permissions & file rights numbers

Guide to file permissions & file rights numbers.
So, what does the numbers mean next to the files on your server? File permissions will help you to have a secure website and a secure directory on your server. You don’t want any stranger to be able to change the content of your files, right!? Guide to file permissions & file rights numbers.

Guide to file permissions & file rights numbers tutorial

 

Guide to file permissions & file rights numbers

File permissions:

  • 4 – read: permitted to read the contents of file.
  • 2 – write: permitted to write to the file.
  • 1 – execute: permitted to execute the file as a program/script.

 

Directory permissions:

  • 4 – read: permitted to read the contents of directory ( view files and sub-directories in that directory ).
  • 2 – write: permitted to write in to the directory. ( create files and sub-directories in that directory )
  • 1 – execute: permitted to enter into that directory.

 

Numeric values for the read, write and execute permissions:

Here are the basic read, write and execute numbers used to specify permissions on files and directories. If you want somebody to be able to read your file, use 4, if you want somebody to be able to read & write to your file, use 4+2 = 6 and so on.

  • read =  4
  • write = 2
  • execute = 1
  • Permission to do nothing = 0

read + write = 6
read + write + execute = 7

 

So how does file permissions & file rights numbers work?

Next to all your files and folder on your server are 3 numbers setting the rights on those files, for example 644 which means that users can read + write, while group and others can only read.

  • First number is for user
  • Second number is for group
  • Third number is for others

 

Spread the word

Facebooktwittergoogle_pluslinkedinmail

Leave a Reply

Your email address will not be published. Required fields are marked *