Загрузка страницы

Linux essentials Commands for Changing File and Directory permission in hindi

The chmod command allows you to change the permissions on a file and directory using either a symbolic or numeric mode or a reference file.
Linux File Permissions
The read permission.
The write permission.
The execute permission.
This concept allows you to specify which users are allowed to read the file, write to the file, or execute the file.
Before going further, let’s explain the basic Linux permissions model.
In Linux, each file is associated with an owner and a group and assigned with permission access rights for three different classes of users:
The file owner.
The group members.
Others (everybody else).
File ownership can be changed using the chown and chgrp commands.
ls -l filename.txt
In the example above (rw-r--r--) means that the file owner has read and write permissions (rw-), the group and others have only read permissions (r--).

Each of the three permission triplets can be constructed of the following characters and have a different effects, depending on whether they are set to a file or to a directory:
Read - The file is not readable. You cannot view the file contents.
r The file is readable.
Write - The file cannot be changed or modified.
w The file can be changed or modified.
Execute - The file cannot be executed.
x The file can be executed.
s If found in the user triplet it sets the setuid bit. If found in the group triplet, it sets the setgid bit. It also means that x flag is set.
When the setuid or setgid flags are set on an executable file, the file is executed with the file’s owner and/or group privileges.
S Same as s but the x flag is not set. This flag is rarely used on files.
t If found in the others triplet it sets the sticky bit.
It also means that x flag is set. This flag is useless on files.
T Same as t but the x flag is not set. This flag is useless on files.
Effect of Permissions on Directories (Folders)
In Linux, Directories are special types of files that contain other files and directories.Permission Character Meaning on Directory
Read - The directory’s contents cannot be shown.
r The directory’s contents can be shown.
(e.g. You can list files inside the directory with ls.)
Write - The directory’s contents cannot be altered.
w The directory’s contents can be altered.
(e.g. You can create new files, delete files ..etc.)
Execute - The directory cannot be changed to.
x The directory can be navigated using cd.
s If found in the user triplet, it sets the setuid bit. If found in the group triplet it sets the setgid bit. It also means that x flag is set. When the setgid flag is set on a directory the new files created within it inherits the directory group ID (GID), instead of the primary group ID of the user who created the file.
setuid has no effect on directories.
S Same as s but the x flag is not set. This flag is useless on directories.
t If found in the others triplet it sets the sticky bit.
It also means that x flag is set. When the sticky bit is set on a directory, only the file’s owner, the directory’s owner, or administrative user can delete or rename the files within the directory.
T Same as t but the x flag is not set. This flag is useless on directories.
Using chmod
The chmod command takes the following general form:
chmod [OPTIONS] MODE FILE...
The chmod command allows you to change the permissions on a file using either a symbolic or numeric mode or a reference file. We will explain the modes in more detail later in this article. The command can accept one or more files and/or directories separated by space as arguments.
Only root, the file owner or user with sudo privileges can change the permissions of a file. Be extra careful when using chmod, especially when recursively changing the permissions.
Symbolic (Text) Method
The syntax of the chmod command when using the symbolic mode has the following format:
chmod [OPTIONS] [ugoa…][-+=]perms…[,…] FILE...
The first set of flags ([ugoa…]), users flags, defines which users classes the permissions to the file are changed.
u - The file owner.
g - The users who are members of the group.
o - All other users.
a - All users, identical to ugo.
Numeric Method
The syntax of the chmod command when using numeric method has the following format:
chmod [OPTIONS] NUMBER FILE...
When using the numeric mode, you can set the permissions for all three user classes (owner, group, and all others) at the same time.
The NUMBER can be a 3 or 4-digits number.
When 3 digits number is used, the first digit represents the permissions of the file’s owner, the second one the file’s group, and the last one all other users.
Each write, read, and execute permissions have the following number value:
r (read) = 4
w (write) = 2
x (execute) = 1
no permissions = 0
The permissions number of a specific user class is represented by the sum
Owner: rwx=4+2+1=7
Group: r-x=4+0+1=5
Others: r-x=4+0+0=4
Using the method above we come up to the number 754, which represents the desired permissions.

Видео Linux essentials Commands for Changing File and Directory permission in hindi канала techessay
Показать
Комментарии отсутствуют
Введите заголовок:

Введите адрес ссылки:

Введите адрес видео с YouTube:

Зарегистрируйтесь или войдите с
Информация о видео
28 декабря 2020 г. 9:40:24
00:18:53
Другие видео канала
Complete Concept of Linux inode , hard and soft links and create hard and soft links with use casesComplete Concept of Linux inode , hard and soft links and create hard and soft links with use casesFive upcoming future truck and bus technology 2018_2025  or upcoming technology in future vehiclesFive upcoming future truck and bus technology 2018_2025 or upcoming technology in future vehiclesUnderstanding linux basic bash shell expansions and pattern matchingUnderstanding linux basic bash shell expansions and pattern matchinghow to connect ec2 linux instance by using sshhow to connect ec2 linux instance by using sshhow to change the azure virtual machine instance size manuallyhow to change the azure virtual machine instance size manuallyhow to migrate any wordpress website to azure cloud by using AllinOne WP migration Pluginhow to migrate any wordpress website to azure cloud by using AllinOne WP migration PluginLinux essential  commands for configuring tor with proxychains in hindiLinux essential commands for configuring tor with proxychains in hindihow to setup proxy and certificate in burpsuite in hindi|How to Configure proxy  and CA in burpsuitehow to setup proxy and certificate in burpsuite in hindi|How to Configure proxy and CA in burpsuiteLinux essential  keyboard shortcuts tricks in hindiLinux essential keyboard shortcuts tricks in hindihow to install xampp server in kali linux 2021 in hindi |install xampp in linux hindi videohow to install xampp server in kali linux 2021 in hindi |install xampp in linux hindi videohow to install wordpress on ec2 instance by using docker containerhow to install wordpress on ec2 instance by using docker containerHow to increase Facebook posts like by using free Facebook Autoliker tool|How to increase fb likeHow to increase Facebook posts like by using free Facebook Autoliker tool|How to increase fb likehow to convert any wordpress dynamic website into staic website for free in hindihow to convert any wordpress dynamic website into staic website for free in hindiTop five Most dangerous railway tracks of word you may be fear after seeing beautiful railway routeTop five Most dangerous railway tracks of word you may be fear after seeing beautiful railway routehindihow to unlock rar password simple methodhindihow to unlock rar password simple methodhow to enable two factor authentication on aws root accounthow to enable two factor authentication on aws root accountAWS Certified Solution Architect Associate Complete Course | AWS beginners Tutorial Part-1 2022AWS Certified Solution Architect Associate Complete Course | AWS beginners Tutorial Part-1 2022wordpress theme installationwordpress theme installationLive !! Netflix App Deployment With DevSecOps Practices| A Real-world DevSecOps Project for ResumeLive !! Netflix App Deployment With DevSecOps Practices| A Real-world DevSecOps Project for ResumeLinux basic file permission  Complete tutorialLinux basic file permission Complete tutorial
Яндекс.Метрика