The authorization is given to the user that enables them to access specific resources on the n/w, such as a data file. Our first priority is protection and security.
On a Linux system, each file and directory are assigned access rights for the owner of the file, the members of a group of related users, and everybody else. Rights can be assigned to read a file, write a file, and to execute a file.
Effect on a file:
Read (r): contents of the file can be read.
Write (w): The contents of the file can be changed.
Execute (x): The file can be executed as a command.
Effect on directory:
Read (r): contents of the directory can be listed.
Write (w): any file in the directory may be created or deleted.
Execute (x): The contents of the directory can be accessed.
There are two methods to set permission:
- Symbolic method:
Read -r
Write -w
Execute – x
No permission —
2. Numeric
Read -4
Write -2
Execute – 1
No permission -0
Also read,
Setting Linux permissions for files and folders:
For User:
#chmod u+rwx folder name/filename
U = user
+ = add
rwx = permission
#chmod u-rwx folder name/file name
U = user
– = remove
rwx = permission
For Group:
#chmod g+rwx folder name/file name
g = group
+ = add
rwx = permission
#chmod g-rwx folder name/file name
g = group
– = remove
rwx = permission
For others:
#chmod o+rwx folder name/file name
o = other
+ = add
rwx = permission
#chmod o-rwx folder name/file name
o = other
– = remove
rwx = permission
To set all:
#chmod u+rwx, g+rwx, o-rwx folder name/file name
- Numeric method:
#chmod 765 folder name/file name (777 for full permission)
7- user: r w x 4+3+1=7
6-group: r w – 4+2+0=6
5-others r – x 4+0+1=5
Number | Permission Type | symbol |
0 | No permission | – – |
1 | Execute | – x |
2 | Write | w – |
3 | Execute + write | w x |
4 | Read | r – – |
5 | Read + x | r – x |
6 | Read + w | r w – |
7 | R +w + x | r w x |
To change group ship:
#chgrp (group name)(file name)
To change ownership:
#chown (user name) (file name)
For any further assistance please contact our support department.
The post Methods To Manage Linux File Permission appeared first on Welcome to Hostdens.com Blog.
Methods To Manage Linux File Permission was first posted on April 9, 2020 at 9:55 pm.
©2019 "Welcome to Hostdens.com Blog". Use of this feed is for personal non-commercial use only. If you are not reading this article in your feed reader, then the site is guilty of copyright infringement. Please contact me at [email protected]
This post first appeared on The Advantages Of Managed Word Press Hosting, please read the originial post: here