Différences
Ci-dessous, les différences entre deux révisions de la page.
Prochaine révision | Révision précédente | ||
elearning:workbooks:debian:10:junior:l108 [2022/05/17 08:16] – created admin | elearning:workbooks:debian:10:junior:l108 [2024/03/08 08:31] (Version actuelle) – admin | ||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
~~PDF: | ~~PDF: | ||
- | Version : **2022.01** | + | Version : **2024.01** |
Dernière mise-à-jour : ~~LASTMOD~~ | Dernière mise-à-jour : ~~LASTMOD~~ | ||
- | ======LCF503 | + | ======LDF503 |
=====Contenu du Module===== | =====Contenu du Module===== | ||
- | * **LCF503 | + | * **LDF503 |
* Contenu du Module | * Contenu du Module | ||
* Présentation | * Présentation | ||
Ligne 42: | Ligne 42: | ||
< | < | ||
- | [root@centos8 | + | root@debian11:~# exit |
logout | logout | ||
- | [trainee@centos8 | + | |
+ | trainee@debian11:~$ pwd | ||
/ | / | ||
- | [trainee@centos8 | + | |
- | [trainee@centos8 | + | trainee@debian11:~$ touch tux.jpg |
- | -rw-rw-r--. 1 trainee | + | |
+ | trainee@debian11:~$ ls -l | grep tux.jpg | ||
+ | -rw-r--r-- 1 trainee | ||
</ | </ | ||
- | <WRAP center round important | + | <WRAP center round important> |
**Important** : Notez que le fichier créé est un fichier **texte**. En effet, Linux ne tient pas compte de l' | **Important** : Notez que le fichier créé est un fichier **texte**. En effet, Linux ne tient pas compte de l' | ||
</ | </ | ||
Ligne 104: | Ligne 107: | ||
< | < | ||
- | [trainee@centos8 | + | trainee@debian11:~$ chmod o+w tux.jpg |
- | [trainee@centos8 | + | |
- | -rw-rw-rw-. 1 trainee | + | trainee@debian11:~$ ls -l | grep tux.jpg |
+ | -rw-r--rw- 1 trainee | ||
</ | </ | ||
Ligne 112: | Ligne 116: | ||
< | < | ||
- | [trainee@centos8 | + | trainee@debian11:~$ chmod ug-w tux.jpg |
- | [trainee@centos8 | + | |
- | -r--r--rw-. 1 trainee | + | trainee@debian11:~$ ls -l | grep tux.jpg |
+ | -r--r--rw- 1 trainee | ||
</ | </ | ||
- | <WRAP center round important | + | <WRAP center round important> |
**Important** : Seul le propriétaire du fichier ou root peuvent modifier les permissions. | **Important** : Seul le propriétaire du fichier ou root peuvent modifier les permissions. | ||
</ | </ | ||
Ligne 127: | Ligne 132: | ||
{{free: | {{free: | ||
- | <WRAP center round important | + | <WRAP center round important> |
**Important** : Ainsi les droits rwx rwx rwx correspondent à un chiffre de 777. | **Important** : Ainsi les droits rwx rwx rwx correspondent à un chiffre de 777. | ||
</ | </ | ||
Ligne 138: | Ligne 143: | ||
< | < | ||
- | [trainee@centos8 | + | trainee@debian11:~$ chmod 644 tux.jpg |
- | [trainee@centos8 | + | |
- | -rw-r--r--. 1 trainee | + | trainee@debian11:~$ ls -l | grep tux.jpg |
+ | -rw-r--r-- 1 trainee | ||
</ | </ | ||
- | <WRAP center round important | + | <WRAP center round important> |
**Important** : Les droits d’accès par défaut lors de la création d’un objet sont : | **Important** : Les droits d’accès par défaut lors de la création d’un objet sont : | ||
^ Répertoires | rwx rwx rwx | 777 | | ^ Répertoires | rwx rwx rwx | 777 | | ||
^ Fichier normal | rw– rw– rw- | 666 | | ^ Fichier normal | rw– rw– rw- | 666 | | ||
</ | </ | ||
- | |||
- | ==Options de la Commande== | ||
Les options de cette commande sont : | Les options de cette commande sont : | ||
< | < | ||
- | [trainee@centos8 | + | trainee@debian11:~$ chmod --help |
Usage: chmod [OPTION]... MODE[, | Usage: chmod [OPTION]... MODE[, | ||
or: chmod [OPTION]... OCTAL-MODE FILE... | or: chmod [OPTION]... OCTAL-MODE FILE... | ||
Ligne 174: | Ligne 178: | ||
GNU coreutils online help: < | GNU coreutils online help: < | ||
- | Full documentation | + | Full documentation < |
or available locally via: info ' | or available locally via: info ' | ||
</ | </ | ||
Ligne 185: | Ligne 189: | ||
< | < | ||
- | [trainee@centos8 | + | trainee@debian11:~$ umask |
- | 0002 | + | 0022 |
- | [trainee@centos8 | + | trainee@debian11:~$ su - |
- | Password: | + | Password: |
- | [root@centos8 | + | root@debian11:~# umask |
0022 | 0022 | ||
- | [root@centos8 | + | root@debian11:~# exit |
logout | logout | ||
</ | </ | ||
Ligne 201: | Ligne 205: | ||
avant de créer son fichier. | avant de créer son fichier. | ||
- | <WRAP center round important | + | <WRAP center round important> |
umask sert à enlever des droits des droits maximaux : | umask sert à enlever des droits des droits maximaux : | ||
^ Masque maximum lors de la création d’un fichier | rw- rw- rw- | 666 | | ^ Masque maximum lors de la création d’un fichier | rw- rw- rw- | 666 | | ||
Ligne 211: | Ligne 215: | ||
< | < | ||
- | [trainee@centos8 | + | trainee@debian11:~$ umask 044 |
- | [trainee@centos8 ~]$ touch tux1.jpg | + | |
- | [trainee@centos8 ~]$ ls -l | grep tux1.jpg | + | |
- | -rw--w--w-. 1 trainee trainee | + | |
- | [trainee@centos8 ~]$ umask 002 | + | |
- | [trainee@centos8 ~]$ umask | + | |
- | 0002 | + | |
- | </ | + | |
- | ==Options de la Commande== | + | trainee@debian11: |
+ | |||
+ | trainee@debian11: | ||
+ | -rw--w--w- 1 trainee sudo 0 Jun 5 16:38 tux1.jpg | ||
+ | |||
+ | trainee@debian11: | ||
+ | |||
+ | trainee@debian11: | ||
+ | 0022 | ||
+ | </ | ||
Les options de cette commande sont : | Les options de cette commande sont : | ||
< | < | ||
- | [trainee@centos8 | + | trainee@debian11:~$ help umask |
umask: umask [-p] [-S] [mode] | umask: umask [-p] [-S] [mode] | ||
Display or set file mode mask. | Display or set file mode mask. | ||
Ligne 236: | Ligne 242: | ||
| | ||
Options: | Options: | ||
- | -p if MODE is omitted, output in a form that may be reused as input | + | -p if MODE is omitted, output in a form that may be reused as input |
- | -S makes the output symbolic; otherwise an octal number is output | + | -S makes the output symbolic; otherwise an octal number is output |
| | ||
Exit Status: | Exit Status: | ||
Ligne 245: | Ligne 251: | ||
====1.2 - Modifier le propriétaire ou le groupe==== | ====1.2 - Modifier le propriétaire ou le groupe==== | ||
- | <WRAP center round important | + | <WRAP center round important> |
**Important** - Le changement de propriétaire d’un fichier se fait uniquement par l' | **Important** - Le changement de propriétaire d’un fichier se fait uniquement par l' | ||
</ | </ | ||
Ligne 254: | Ligne 260: | ||
< | < | ||
- | [trainee@centos8 | + | trainee@debian11:~$ su - |
Password: fenestros | Password: fenestros | ||
- | [root@centos8 ~]# cd / | ||
- | [root@centos8 trainee]# chown root tux.jpg | ||
- | [root@centos8 trainee]# ls -l | grep tux.jpg | ||
- | -rw-r--r--. 1 root trainee | ||
- | </ | ||
- | ==Options de la Commande== | + | root@debian11: |
+ | |||
+ | root@debian11:/ | ||
+ | |||
+ | root@debian11:/ | ||
+ | -rw-r--r-- 1 root sudo 0 Jun 5 16:32 tux.jpg | ||
+ | </ | ||
Les options de cette commande sont : | Les options de cette commande sont : | ||
< | < | ||
- | [root@centos8 | + | root@debian11:/ |
Usage: chown [OPTION]... [OWNER][: | Usage: chown [OPTION]... [OWNER][: | ||
or: chown [OPTION]... --reference=RFILE FILE... | or: chown [OPTION]... --reference=RFILE FILE... | ||
Ligne 315: | Ligne 322: | ||
GNU coreutils online help: < | GNU coreutils online help: < | ||
- | Full documentation | + | Full documentation < |
or available locally via: info ' | or available locally via: info ' | ||
</ | </ | ||
Ligne 324: | Ligne 331: | ||
< | < | ||
- | [root@centos8 | + | root@debian11:/ |
- | [root@centos8 | + | |
- | -rw-r--r--. 1 root root 0 Apr 21 03:42 tux.jpg | + | root@debian11:/ |
+ | -rw-r--r-- 1 root root | ||
</ | </ | ||
- | <WRAP center round important | + | <WRAP center round important> |
**Important** : Le droit de supprimer un fichier dépend des droits sur le répertoire dans lequel le fichier est stocké et non des droits du fichier lui-même. | **Important** : Le droit de supprimer un fichier dépend des droits sur le répertoire dans lequel le fichier est stocké et non des droits du fichier lui-même. | ||
</ | </ | ||
- | |||
- | ==Options de la Commande== | ||
Les options de cette commande sont : | Les options de cette commande sont : | ||
< | < | ||
- | [root@centos8 | + | root@debian11:/ |
Usage: chgrp [OPTION]... GROUP FILE... | Usage: chgrp [OPTION]... GROUP FILE... | ||
or: chgrp [OPTION]... --reference=RFILE FILE... | or: chgrp [OPTION]... --reference=RFILE FILE... | ||
Ligne 376: | Ligne 382: | ||
GNU coreutils online help: < | GNU coreutils online help: < | ||
- | Full documentation | + | Full documentation < |
or available locally via: info ' | or available locally via: info ' | ||
</ | </ | ||
Ligne 387: | Ligne 393: | ||
< | < | ||
- | [root@centos8 | + | root@debian11:/ |
- | -rw-r--r--. 1 root root | + | -rw-r--r-- 1 root root |
- | -rwsr-xr-x. 1 root root 33600 Apr 6 2020 / | + | -rwsr-xr-x 1 root root 63960 Feb 7 2020 / |
</ | </ | ||
Ligne 416: | Ligne 422: | ||
< | < | ||
- | [root@centos8 | + | root@debian11:/ |
- | find: ‘/proc/17916/task/17916/fdinfo/5’: No such file or directory | + | find: ‘/proc/27625/task/27625/fdinfo/6’: No such file or directory |
- | find: ‘/proc/17916/fdinfo/6’: No such file or directory | + | find: ‘/proc/27625/fdinfo/5’: No such file or directory |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
/usr/bin/su | /usr/bin/su | ||
- | /usr/bin/umount | + | /usr/bin/fusermount |
- | / | + | |
/ | / | ||
- | /usr/bin/chfn | + | /usr/bin/dotlockfile |
+ | / | ||
/ | / | ||
/ | / | ||
- | /usr/bin/at | + | /usr/bin/mount |
/ | / | ||
- | /usr/bin/locate | + | /usr/bin/chage |
+ | / | ||
+ | / | ||
+ | / | ||
/ | / | ||
- | /usr/bin/fusermount | + | /usr/bin/write.ul |
- | /usr/bin/screen | + | /usr/bin/gpasswd |
- | /usr/sbin/grub2-set-bootflag | + | /usr/bin/ssh-agent |
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
/ | / | ||
- | /usr/sbin/pam_timestamp_check | + | /usr/sbin/pppd |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
</ | </ | ||
Ligne 460: | Ligne 461: | ||
< | < | ||
- | [root@centos8 | + | root@debian11:/ |
- | [root@centos8 | + | |
- | [root@centos8 | + | root@debian11:/tmp# mkdir inherit |
- | [root@centos8 | + | |
- | [root@centos8 | + | root@debian11:/tmp# chown root: |
- | [root@centos8 | + | |
- | [root@centos8 | + | root@debian11:/tmp# chmod g+s inherit |
- | total 0 | + | |
- | drwxr-sr-x. 2 root trainee | + | root@debian11:/tmp# touch inherit/ |
- | -rw-r--r--. 1 root trainee 0 Apr 21 04:50 test.txt | + | |
+ | root@debian11:/tmp# mkdir inherit/ | ||
+ | |||
+ | root@debian11:/tmp# cd inherit; ls -l | ||
+ | total 4 | ||
+ | drwxr-sr-x 2 root trainee | ||
+ | -rw-r--r-- 1 root trainee | ||
</ | </ | ||
- | <WRAP center round important | + | <WRAP center round important> |
**Important** : Notez que malgré le fait que root a créé les deux objets, ceux-ci ne sont pas associés avec le groupe **root** mais avec le groupe **trainee**, | **Important** : Notez que malgré le fait que root a créé les deux objets, ceux-ci ne sont pas associés avec le groupe **root** mais avec le groupe **trainee**, | ||
</ | </ | ||
Ligne 489: | Ligne 496: | ||
< | < | ||
- | [root@centos8 | + | root@debian11:/ |
- | [root@centos8 | + | root@debian11:/tmp# ls -l | grep repertoire_public |
- | drwxr-xr-t. 2 root root 6 Apr 21 04:53 repertoire_public | + | drwxr-xr-t 2 root root 4096 Jun 5 17:19 repertoire_public |
</ | </ | ||
Ligne 503: | Ligne 510: | ||
< | < | ||
- | [root@centos8 | + | root@debian11:/tmp# getfacl / |
getfacl: Removing leading '/' | getfacl: Removing leading '/' | ||
# file: home/ | # file: home/ | ||
Ligne 516: | Ligne 523: | ||
< | < | ||
- | [root@centos8 | + | root@debian11:/tmp# setfacl --set u:: |
- | [root@centos8 | + | |
+ | root@debian11:/tmp# getfacl / | ||
getfacl: Removing leading '/' | getfacl: Removing leading '/' | ||
# file: home/ | # file: home/ | ||
Ligne 529: | Ligne 537: | ||
</ | </ | ||
- | <WRAP center round important | + | <WRAP center round important> |
**Important** - Veuillez noter l' | **Important** - Veuillez noter l' | ||
</ | </ | ||
Ligne 536: | Ligne 544: | ||
< | < | ||
- | [root@centos8 | + | root@debian11:/tmp# mkdir / |
</ | </ | ||
Ligne 542: | Ligne 550: | ||
< | < | ||
- | [root@centos8 | + | root@debian11:/tmp# setfacl --set d: |
</ | </ | ||
Ligne 550: | Ligne 558: | ||
< | < | ||
- | [root@centos8 | + | root@debian11:/tmp# touch / |
</ | </ | ||
Ligne 556: | Ligne 564: | ||
< | < | ||
- | [root@centos8 | + | root@debian11:/tmp# getfacl / |
getfacl: Removing leading '/' | getfacl: Removing leading '/' | ||
# file: home/ | # file: home/ | ||
Ligne 568: | Ligne 576: | ||
default: | default: | ||
- | [root@centos8 | + | root@debian11:/tmp# getfacl / |
getfacl: Removing leading '/' | getfacl: Removing leading '/' | ||
# file: home/ | # file: home/ | ||
Ligne 583: | Ligne 591: | ||
< | < | ||
- | [root@centos8 | + | root@debian11:/tmp# cd / |
- | [root@centos8 | + | |
- | [root@centos8 | + | root@debian11:/ |
+ | |||
+ | root@debian11:/ | ||
# file: . | # file: . | ||
# owner: root | # owner: root | ||
Ligne 600: | Ligne 610: | ||
# setfacl --restore=backup.acl [Entrée] | # setfacl --restore=backup.acl [Entrée] | ||
- | |||
- | ==Options des Commandes=== | ||
Les options de la commande **getfacl** sont : | Les options de la commande **getfacl** sont : | ||
< | < | ||
- | [root@centos8 tmp]# getfacl --help | + | root@debian11:/ |
getfacl 2.2.53 -- get file access control lists | getfacl 2.2.53 -- get file access control lists | ||
Usage: getfacl [-aceEsRLPtpndvh] file ... | Usage: getfacl [-aceEsRLPtpndvh] file ... | ||
Ligne 628: | Ligne 636: | ||
< | < | ||
- | [root@centos8 tmp]# setfacl --help | + | root@debian11:/ |
setfacl 2.2.53 -- set file access control lists | setfacl 2.2.53 -- set file access control lists | ||
Usage: setfacl [-bkndRLP] { -m|-M|-x|-X ... } file ... | Usage: setfacl [-bkndRLP] { -m|-M|-x|-X ... } file ... | ||
Ligne 665: | Ligne 673: | ||
| A | La date et l' | | A | La date et l' | ||
- | <WRAP center round important | + | <WRAP center round important> |
**Important** - Un fichier synchrone et un répertoire synchrone impliquent que les modifications seront immédiatement inscrites sur disque. | **Important** - Un fichier synchrone et un répertoire synchrone impliquent que les modifications seront immédiatement inscrites sur disque. | ||
</ | </ | ||
Ligne 678: | Ligne 686: | ||
< | < | ||
- | [root@centos8 | + | root@debian11:/ |
- | [root@centos8 | + | |
+ | root@debian11:~# mkdir -p attributs/ | ||
</ | </ | ||
Ligne 685: | Ligne 694: | ||
< | < | ||
- | [root@centos8 | + | root@debian11:~# touch attributs/ |
- | [root@centos8 | + | |
+ | root@debian11:~# touch attributs/ | ||
</ | </ | ||
Ligne 692: | Ligne 702: | ||
< | < | ||
- | [root@centos8 | + | root@debian11:~# chattr +i -R attributs/ |
</ | </ | ||
Ligne 698: | Ligne 708: | ||
< | < | ||
- | [root@centos8 | + | root@debian11:~# lsattr -R attributs |
- | ----i----------- attributs/ | + | ----i---------e------- attributs/ |
attributs/ | attributs/ | ||
- | ----i----------- attributs/ | + | ----i---------e------- attributs/ |
- | ----i----------- attributs/ | + | ----i---------e------- attributs/ |
</ | </ | ||
- | <WRAP center round important | + | <WRAP center round important> |
**Important** - Notez que l' | **Important** - Notez que l' | ||
</ | </ | ||
Ligne 714: | Ligne 724: | ||
< | < | ||
- | [root@centos8 | + | root@debian11:~# cd attributs; mv / |
mv: cannot move '/ | mv: cannot move '/ | ||
</ | </ | ||
----- | ----- | ||
- | Copyright © 2022 Hugh Norris. | + | Copyright © 2024 Hugh Norris. |