2) Permissions

PERMISSIONS
________________________________________________________________________________________________________________________________________________________________

    v  Some important points
      Ø  / (forward slash) root (administrator).
      Ø  In terminal: “# login with root user.
                      $ login with local user.

  v Types of User
      Ø  u owner
      Ø  g group
      Ø  o other user
      Ø  a all user (owner + group + other user)

  v Types of Permission
In Linux, there are three types of permission for file and directory.
      Ø  r read
      Ø  w write
      Ø  x execute

  v File or directory permissions

  v File types
- Regular file
             d Directory
              l Symbolic link or soft link

  v Umask value
 Linux Operating System has different umask value for root user and local user.
      Ø  Umask value for root user 022
      Ø  Umask value for local user 002

  v Base value
In Linux, there are different base value for file and directory.
      Ø  Base value for file 666
      Ø  Base value for directory 777

  v Default permission
Linux Operating System has different-different default permission for file and directory in root user and local user.
      Ø  In root account:  Base value – umask value
·         For a file (666 – 022) = 644 (rw-  r--  r--)
·         For a directory (777 – 022) = 755 (rwx  r-x  r-x)
      Ø  In local user: Base value – umask value
·         For a file (666 – 002) = 664 (rw-  rw-  r--)
·         For a directory (777 – 002) = 775 (rwx  rwx  r-x)


  v Permission value
File and directory permission list given bellow:-
Permission value
Permission order
Permission
0
-  - -
No permission
1
- - x
Only execute
2
- w -
Only write
3
- w x
Write & execute
4
r - -
Only read
5
r – x
Read & execute
6
r w -
Read & write
7
r w x
Read, write & execute

Command → chmod ɸ 764 ɸ directory name
              here, 7 owner user
                        6 group user
                        4 other user
Note: When a file has a normal permission, then any user can delete it.
            System account Id 01 – 999
            Root account Id 1000
            Other user Id 1001 - ……

  v Permission operation
      Ø +  add the permission                 
      Ø -    remove the permission
      Ø = same permission
#        chmod ɸ user name + permission type ɸ file name/directory name
#        chmod ɸ user name – permission type ɸ file name/directory name

  v Some special permission
Ø Uid bit no. → 4
Use use for make owner permission.
#        Chmod ɸ 4 777 ɸ file name

Ø gid bit no. → 2
Use use for make group owner permission.
#        Chmod ɸ 2 777 ɸ file name

Ø Sticky bit no. → 1
Use use for block other permission.
#        Chmod ɸ 1 777 ɸ file name





Comments