In a Unix environment, all files and directories are owned by two different entities -- a user and a group. Each file in the File System has three permission sets that determine who can access a file or directory. These sets are: group-level, user-level and global-level. Each permission set has three flags: read, write and execute. If a user does not have, for example, a read flag set, he or she will not be able to read a particular file or directory. The same applies to a user that does not have a execute flag set; he or she will not be able to execute that script. How to set the permissions Permissions are set using a command called CHMOD. CHMOD stands for CHange MODe. CHMOD comes as a set of three numbers. Each of these three numbers is a sum total of three other numbers. So you have to add three numbers to get the first CHMOD number, add three numbers to get the second CHMOD number and add three numbers to get the third CHMOD number.
The first digit represents the host server/computer. This will usually be set to seven. The second digit represents the group. And the third represents the world or "others." How do we arrive at the number 775? For the group "owner" we have: For the group "groups" we have: For group "others" we have: This means that the "host" and the "group" can do anything to the file, but anyone else can only execute it or read it. They can't modify it.
Fig3. CHMOD example
blog comments powered by Disqus |