File Permissions In Red Hat

Permission :

Permission has give in to two type.

  • Symbolic method :
  • Numeric method :

We are showing symbolic method.

Read = r user = u add = +
Write = w group = g remove = -
Execute = x other = o replace = (=)
  • File = -
  • Directory = d
Notepad

Note : By defaults file do not has execute permission

View the permission by #ls-l

Command
#touch  /root/Desktop/xyz
#ls –l  /root/Desktop/xyz
file permissions in red hat

Permession :

  • 1> is show file or directory.(file = -, dir = d)
  • 2> user has read, write permission.
  • 3> group has read permission.
  • 4> other has read permission.
  • 5> user owner
  • 6> group owner here

How to change the permission in red hat?

Command
#chmod  u+rwx /root/Desktop/xyz      (execute file color  is green )
#ls –l /root/Desktop/xyz
-rwx r - - r - - 2  root root    ---------  xyz

How to replace the permission in red hat?.

Command
#chmod  g=rw  /root/Desktop/xyz
#ls –l /root/Desktop/xyz
-rwxrw- r - -  2  root root     ---------  xyz

How to remove the permission in red hat?

Command
#chmod  g-rw,o-r  /root/Desktop/xyz
#ls –l /root/Desktop/xyz
-rwx--- ---  2  root root     ---------  xyz

Numeric permission :

We have the three permission.

NO Read 2*2 Write 2*1 Execute 2*0
0 0 0 0
1 0 0 1
2 0 1 0
3 0 1 1
4 1 0 0
5 1 0 1
6 1 1 0
7 1 1 1
Command
#touch   /root/Desktop/pqr
#ls –l /root/Desktop/pqr
- rw- r-- r--   2   root  root   --------- pqr
#chmod  777  /root/Desktop/pqr
#ls –l /root/Desktop/pqr
-rwx rwr rwx   2   root  root   --------- pqr
#chmod   000  /root/Desktop/pqr
#ls –l  /root/Desktop/pqr
--- --- --- 2  root root ------------- pqr 
#chmod    472  /root/Desktop/pqr
#ls –l /root/Desktop/pqr
- r– - rwx –w-  2 root root -------- pqr

What is umask?

It is also related with permission.

Umask is used to display permission or set file creation mask permission applied to newly created file or directory.

Umask is set in two mode

1>> temporary mode

How to set temporary umask in red hat?

Command
#umask  <umasknumber>

How to check umask?

Command
#umask
Notepad

Note : Reboot the pc then gate original umask.

2>> Permeated mode

Command
#echo  “umask 077”  >>  /root/.bashrc

We also user vim editor for permeated umask.add “umask 077” it last line. In this file.

root and normal users permission

If you check current umask, then fallow the command.

Command
#umask
#Permissions_in_red_hat #file_permissions_in_red_hat #numeric_permission_in_red_hat #What_is_umask_in_red_hat #How_to_change_the_permission_in_red_hat #How_to_replace_the_permission_in_red_hat #How_to_remove_the_permission_in_red_hat #How_to_set_temporary_umask_in_red_hat

(New page will open, for Comment)

Not yet commented...