Vote

This tutorial allows to understand and manage the files’ rights of your Linux system.

Introduction

Let’s start with a folder’s display in order to visualize the elements that both commands chmod and chown allow to change :

The first column tells us if we visualize a file (-), a link (l) or a folder (d) along with their rights (drwxr-xr-x+).
The following columns tells us the owner, the group, the size, the date of modification and the name.


chmod

The command chmod allows to change a file/folder’s rights.
The rights can change in an octal or in an individual way.
In octal, the command chmod is followed by 3 numbers that is to say the 1st for the owner, the second for the group and the last for the other users according to the following rule :

  • 0 : – – – (no right)
  • 1 : – – x (execution)
  • 2 : – w – (writing)
  • 3 : – w x (writing and execution)
  • 4 : r – – (read only)
  • 5 : r – x (reading and execution)
  • 6 : r w – (reading and writing)
  • 7 : r w x (reading, writing and execution)

 

In individuality, we indicate the concernedentity User (u), Group (g), Other (o) or All (a) and the adding action (+) or right deletion (-).

Argument allowing to applicate the modification to the folder recursively.

A generator of chmod permissions is available at the end of the tutorial.


chown / chgrp

The command chown allows to change the file/folder’s owner.
Only the owner and user root can change a file/folder’s rights.
It is also possible to change the owner and the group at the same time.
The command chgrp allows to change the file/folder’s group.

Argument allowing to applicate the modification to the folder recursively.


Generatorr

In order to change your permissions quicker, you can use the following generator :


Categories: SystemTutorials

JN Community

Les Ressources, en particulier les tutoriaux, présupposent que l’Utilisateur qui décide de les mettre en œuvre dispose des connaissances, des compétences et de l’expérience nécessaire pour cette mise en œuvre. L’Utilisateur disposant d’une connaissance, compétence et/ou expérience limitée ou insuffisante doit absolument s’abstenir de mettre en œuvre les Ressources par lui-même.
Jaguar Network décline toute responsabilité quant aux conséquences dommageables de la mise en œuvre des Ressources, notamment sur les infrastructures informatiques de l’Utilisateur, de ses commettants ou préposés ou de tout tiers.
Il est précisé en tant que de besoin que toute intervention de Jaguar Network visant à réparer les dommages causés par la mise en œuvre des Ressources par un Utilisateur ne disposant pas des connaissances, compétences et/ou expériences suffisantes sera facturée et fera l’objet d’un devis préalable et d’un bon de commande aux conditions des contrats Jaguar Network en vigueur.

Related Posts

System

Installation of a web server LEMP (Linux, Nginx, MySQL, PHP)

Vote The installation of a server LEMP Linux + Nginx + MySQL + PHP might be more useful and efficient than an Apache (server LAMP). Articles similaires

System

Operating load-balancing with HAproxy

Vote HAproxy is a software allowing Load-Balancing between several web servers by allocating requests in an almost transparent way for the user. Articles similaires

System

10 tips to write efficient scripts on Linux

Vote The shell script is the most simple type of programming you would write on Linux. Moreover, it is a necessary skill to automate your system administration tasks, to develop new simple features, … In Read more…