This is a very simple process. Although there are a few other ways of doing this, I am going to show you the most “macho” way. There are three permission “groups”, and each one has three types of permissions you can set. Each type of permission has a numerical value, and when you add up the values of of the permissions in each of your three groups, you get the desirable number.

-rwx-wx–x 1 daniel daniel 0 Jun 19 17:27 test

Lets break down the permissions section at the beginning of that ‘ll’ listing.
- rwx -wx –x
In this case, the first – means it’s not a directory. There’s more to learn about other potential significances for this, but I don’t know them yet.

The next section has three letters (r w x) – Read, Write, Execute. These three are part of the first of the three groups, Owner. Since all three letters are listed, it means that the owner of the file (Daniel) can read, write, and execute the file.

The next section is (- w x). This is the “group” section. This means that everyone in the same group as Daniel is allowed to write and execute the file, but NOT read it.

The last section is (- – x). This is the “world” section. This means that everyone who is neither the owner nor in the owners group is allowed to ONLY execute the file.
Now, to change the permissions on a file, you must type the ‘chmod’ command, followed by a three digit number, and then the name of the file or directory whos permissions you wish to alter. Lets say we want to make it so file ‘test’ can ONLY be read, written to, and executed by the owner and no one else. The command to execute would be the following:

chmod 700 test

I figured this out by adding the values of r, w, and x together.

r = 4, w = 2, x = 1

Since we wanted owner (first digit) to be allowed all three, I added 4, 2, and 1 to get the seven. Group and World wasn’t allowed to do anything, so they got zero. Here’s one more example. This one will give owner read/write, group only write, and world only read:

chmod 724 test

It’s a simple task, but I hope some beginners can learn from it.

Post By Gishore J Kallarackal (2,121 Posts)

Gishore J Kallarackal is the founder of techgurulive. The purpose of this site is to share information about free resources that techies can use for reference. You can follow me on the social web, subscribe to the RSS Feed or sign up for the email newsletter for your daily dose of tech tips & tutorials. You can content me via @twitter or e-mail.

Website: → Techgurulive