2. Basic Permission : Read, Write and Execute
Read :
This permission give you the authority to open and read a file. Read permission on a directory gives
you the ability to lists its content.
Write:
The write permission gives you the authority to modify the contents of a file. The write permission on
a directory gives you the authority to add, remove and rename files stored in the directory.
Execute:
The execute permission is required to execute a file. It is never set by default, which makes Linux
almost completely immune to viruses. Only someone with administrative right to a directory will be capable of
applying the execute permission.
5. SET PERMISSION :-
We can use the 'chmod' command which stands for 'change mode’.
Using the command, we can set permissions (read, write, execute) on a file/directory for the owner, group and
the world.
Syntax :-
chmod permission filename
6. Advance file permission : SUID, SGID and Sticky bit
Set-User_Id (SUID):
By default, when a user executes a file, the process which results in this execution has the
same permissions as those of the user. In fact , the process inherits his default group and user
identification
Set-Group_Id (SGID) :
The set-group-id (SGID) is similar to SUID except that a program with SGID set allows the
user to have the same power as the group which owns the program.
Sticky bit:
The sticky bit(also called the saved text bit) is the last permission bit remaining to be
discussed. It applies to both regular files and directories. When applied to a regular file, it ensures that
the text image of a program with the bit set is permanently kept in the swap area so that it can be
reloaded quickly when the program’s turn to use the CPU arrives.
7. Permission Numerical value Relative value
SUID 4 u+s
SGID 2 g+s
Sticky bit 1 +t
SUID :
$ ls -l /usr/bin/passwd
-rwsr-xr-x 1 root root 22984 Jan 6 2007 /usr/bin/passwd
GUID :-
ls –Id account
drwxr-sr-x. 2 root account 4096 Apr 30 21:28 account
Sticky bit :-
ls –Id account/
drwxr-sr-t. 2 root account 4096 Apr 30 21:28 account/