File Permissions 1

In Red Hat Enterprise Linux, all files have file permissions which determine whether a user is allowed to read, write, or execute them, for greater security.Command ls –l list the file permissions in the first column. The first column have places for 10 letters or hyphens. The first space is either a hyphen, the letter d, or the letter l. A hyphen means it is a file. The letter d denotes that the file is actually a directory and the letter l, it is a symbolic link to a directory somewhere else on the filesystem.

The next nine spaces are divided into 3 sets of three as shown in Figure. The first set of three is the read, write, and execute permissions for the owner of the file. The second set of three is the read, write, and execute permissions for anyone who belongs to the user group for the file. The last set of permissions is for anyone who has a login to the system.

So its like owner permissions-group user permissions-anonymous user permission

Within each set of permissions, r stands for read, w stands for write, and x stands for execute. If the file is a script or command, you must have execute permission to run it. The execute permission is required to change into a directory. To change file permissions, you must be the owner of the file or directory or be the root user. The chmod utility is used to modify file permissions.
The basic syntax is as follows:
chmod [ugoa][+-=] filename

For the first argument, choose one or more letters ugoa, where u stands for the user who owns the file , g stands for everyone in the file’s group, o stands for other users not in the file’s group, and a stands for all users. The difference between specifying o and a is that o changes the third set of permissions for everyone and a changes the permissions for all three sets.

The second argument must be one of +, -, or =. If the plus sign (+) is used, the permissions that follow it are added for the users and groups provided by the first argument. If the minus sign (-) is used, the permissions that follow are removed for the users and groups in the first argument. However, if the equals sign (=) is used, the file will only have the permissions being specified (the existing permissions are overwritten and not retained).

The last argument is a filename or group of filenames on which you set the permissions. Multiple filenames can be listed using the * wildcard character such as *.txt for all files ending in .txt. The third argument is the list of permissions for the users and groups from the first argument. 



Read rest of this post here

Comments

0 Responses to "File Permissions 1"

Post a Comment

 

Managing Shell And its Secrets

Subscribe To Get Update On Mobile

Subscribe
Get updates of latest post on your mobile free