|
|
| Ligne 10 : |
Ligne 10 : |
| | | | |
| | = Le Shell et les commandes de base = | | = Le Shell et les commandes de base = |
| − | = Support de cours GNU/Linux =
| |
| − |
| |
| − | __TOC__
| |
| − |
| |
| − | = Introduction =
| |
| − |
| |
| − | == Présentation des systèmes d'exploitation ==
| |
| − | == Mode utilisateur et mode noyau ==
| |
| − | == Appels système ==
| |
| − |
| |
| − | = Le Shell et les commandes de base =
| |
| − |
| |
| − | = GNU/Linux - Introduction et commandes de base =
| |
| − |
| |
| − | __TOC__
| |
| − |
| |
| − | = Introduction =
| |
| − |
| |
| − | == Présentation du système GNU/Linux ==
| |
| − |
| |
| − | GNU/Linux est un système d'exploitation multi-utilisateur et multitâche inspiré d'UNIX.
| |
| − |
| |
| − | Il est constitué :
| |
| − |
| |
| − | * du noyau Linux ;
| |
| − | * des outils GNU ;
| |
| − | * d'un ensemble de programmes système ;
| |
| − | * d'interfaces utilisateur en mode texte ou graphique.
| |
| − |
| |
| − | Les principales caractéristiques de GNU/Linux sont :
| |
| − |
| |
| − | * Multi-utilisateur
| |
| − | * Multitâche
| |
| − | * Portable
| |
| − | * Stable
| |
| − | * Sécurisé
| |
| − | * Open Source
| |
| − |
| |
| − | == Architecture du système ==
| |
| − |
| |
| − | Le système est composé de deux parties principales :
| |
| − |
| |
| − | === Le noyau (Kernel) ===
| |
| − |
| |
| − | Le noyau est la partie centrale du système.
| |
| − |
| |
| − | Il assure notamment :
| |
| − |
| |
| − | * la gestion de la mémoire ;
| |
| − | * la gestion des processus ;
| |
| − | * la gestion des périphériques ;
| |
| − | * la gestion du système de fichiers ;
| |
| − | * les communications entre programmes.
| |
| − |
| |
| − | === Les programmes utilisateurs ===
| |
| − |
| |
| − | Les applications fonctionnent en mode utilisateur.
| |
| − |
| |
| − | Elles ne peuvent pas accéder directement :
| |
| − |
| |
| − | * à la mémoire physique ;
| |
| − | * aux périphériques ;
| |
| − | * aux instructions privilégiées du processeur.
| |
| − |
| |
| − | Les demandes au noyau sont effectuées par l'intermédiaire des appels système.
| |
| − |
| |
| − | == Modes d'exécution ==
| |
| − |
| |
| − | === Mode noyau ===
| |
| − |
| |
| − | Le processeur exécute le code du noyau avec tous les privilèges.
| |
| − |
| |
| − | Le noyau peut :
| |
| − |
| |
| − | * accéder à toute la mémoire ;
| |
| − | * gérer les périphériques ;
| |
| − | * manipuler les interruptions matérielles ;
| |
| − | * contrôler les ressources système.
| |
| − |
| |
| − | === Mode utilisateur ===
| |
| − |
| |
| − | Les programmes utilisateurs s'exécutent avec des privilèges limités.
| |
| − |
| |
| − | Ils ne peuvent accéder qu'aux ressources autorisées.
| |
| − |
| |
| − | Lorsqu'une ressource système est nécessaire, ils utilisent un appel système.
| |
| − |
| |
| − | = Le Shell =
| |
| − |
| |
| − | == Définition ==
| |
| − |
| |
| − | Le shell est l'interpréteur de commandes du système.
| |
| − |
| |
| − | Il sert d'interface entre :
| |
| − |
| |
| − | * l'utilisateur ;
| |
| − | * le système d'exploitation.
| |
| − |
| |
| − | Sous GNU/Linux, le shell le plus répandu est :
| |
| − |
| |
| − | <syntaxhighlight lang="bash">
| |
| − | bash
| |
| − | </syntaxhighlight>
| |
| − |
| |
| − | == Invite de commande ==
| |
| − |
| |
| − | Exemple :
| |
| − |
| |
| − | <syntaxhighlight lang="bash">
| |
| − | [root@serveur /root]#
| |
| − | </syntaxhighlight>
| |
| − |
| |
| − | Signification :
| |
| − |
| |
| − | {| class="wikitable"
| |
| − | ! Élément
| |
| − | ! Description
| |
| − | |-
| |
| − | | root
| |
| − | | Utilisateur connecté
| |
| − | |-
| |
| − | | serveur
| |
| − | | Nom de la machine
| |
| − | |-
| |
| − | | /root
| |
| − | | Répertoire courant
| |
| − | |-
| |
| − | | #
| |
| − | | Utilisateur administrateur
| |
| − | |}
| |
| − |
| |
| − | Exemple utilisateur standard :
| |
| − |
| |
| − | <syntaxhighlight lang="bash">
| |
| − | [max@poste /home/max]$
| |
| − | </syntaxhighlight>
| |
| − |
| |
| − | Le symbole `$` indique un utilisateur standard.
| |
| − |
| |
| − | == Erreurs de commande ==
| |
| − |
| |
| − | Exemple :
| |
| − |
| |
| − | <syntaxhighlight lang="bash">
| |
| − | abcde
| |
| − | </syntaxhighlight>
| |
| − |
| |
| − | Résultat :
| |
| − |
| |
| − | <syntaxhighlight lang="text">
| |
| − | bash: abcde: command not found
| |
| − | </syntaxhighlight>
| |
| − |
| |
| − | Cela signifie que la commande n'existe pas ou n'est pas accessible.
| |
| − |
| |
| − | = Commandes de base =
| |
| − |
| |
| − | == Lister les fichiers ==
| |
| | | | |
| | + | == L'invite de commande == |
| | + | == Bash == |
| | + | == Navigation dans le système de fichiers == |
| | === ls === | | === ls === |
| | + | === cd === |
| | + | === pwd === |
| | | | |
| − | Affiche le contenu du répertoire courant.
| + | == Manipulation des fichiers == |
| − | | |
| − | <syntaxhighlight lang="bash">
| |
| − | ls
| |
| − | </syntaxhighlight>
| |
| − | | |
| − | Affichage détaillé :
| |
| − | | |
| − | <syntaxhighlight lang="bash">
| |
| − | ls -l
| |
| − | </syntaxhighlight>
| |
| − | | |
| − | Affichage des fichiers cachés :
| |
| − | | |
| − | <syntaxhighlight lang="bash">
| |
| − | ls -la
| |
| − | </syntaxhighlight>
| |
| − | | |
| − | == Afficher le contenu d'un fichier == | |
| − | | |
| − | === more ===
| |
| − | | |
| − | Lecture page par page.
| |
| − | | |
| − | <syntaxhighlight lang="bash">
| |
| − | more fichier.txt
| |
| − | </syntaxhighlight>
| |
| − | | |
| − | Commandes utiles :
| |
| − | | |
| − | {| class="wikitable"
| |
| − | ! Touche
| |
| − | ! Action
| |
| − | |-
| |
| − | | Entrée
| |
| − | | Ligne suivante
| |
| − | |-
| |
| − | | Espace
| |
| − | | Page suivante
| |
| − | |-
| |
| − | | b
| |
| − | | Page précédente
| |
| − | |-
| |
| − | | q
| |
| − | | Quitter
| |
| − | |}
| |
| − | | |
| − | === cat ===
| |
| − | | |
| − | Affiche l'intégralité d'un fichier.
| |
| − | | |
| − | <syntaxhighlight lang="bash">
| |
| − | cat fichier.txt
| |
| − | </syntaxhighlight>
| |
| − | | |
| − | Afficher plusieurs fichiers :
| |
| − | | |
| − | <syntaxhighlight lang="bash">
| |
| − | cat fichier1.txt fichier2.txt
| |
| − | </syntaxhighlight>
| |
| − | | |
| − | == Copier des fichiers ==
| |
| − | | |
| | === cp === | | === cp === |
| − |
| |
| − | Copier un fichier :
| |
| − |
| |
| − | <syntaxhighlight lang="bash">
| |
| − | cp source.txt destination.txt
| |
| − | </syntaxhighlight>
| |
| − |
| |
| − | Copie d'un répertoire :
| |
| − |
| |
| − | <syntaxhighlight lang="bash">
| |
| − | cp -r dossier1 dossier2
| |
| − | </syntaxhighlight>
| |
| − |
| |
| − | == Déplacer ou renommer ==
| |
| − |
| |
| | === mv === | | === mv === |
| − |
| |
| − | Renommer :
| |
| − |
| |
| − | <syntaxhighlight lang="bash">
| |
| − | mv ancien.txt nouveau.txt
| |
| − | </syntaxhighlight>
| |
| − |
| |
| − | Déplacer :
| |
| − |
| |
| − | <syntaxhighlight lang="bash">
| |
| − | mv fichier.txt /home/user/
| |
| − | </syntaxhighlight>
| |
| − |
| |
| − | == Supprimer ==
| |
| − |
| |
| | === rm === | | === rm === |
| − |
| |
| − | Supprimer un fichier :
| |
| − |
| |
| − | <syntaxhighlight lang="bash">
| |
| − | rm fichier.txt
| |
| − | </syntaxhighlight>
| |
| − |
| |
| − | Supprimer un répertoire :
| |
| − |
| |
| − | <syntaxhighlight lang="bash">
| |
| − | rm -r dossier
| |
| − | </syntaxhighlight>
| |
| − |
| |
| − | Suppression forcée :
| |
| − |
| |
| − | <syntaxhighlight lang="bash">
| |
| − | rm -rf dossier
| |
| − | </syntaxhighlight>
| |
| − |
| |
| − | {{Attention|
| |
| − | La suppression est définitive.
| |
| − | }}
| |
| − |
| |
| − | == Rechercher des fichiers ==
| |
| − |
| |
| | === find === | | === find === |
| − |
| |
| − | Recherche dans une arborescence :
| |
| − |
| |
| − | <syntaxhighlight lang="bash">
| |
| − | find /home -name compta.txt
| |
| − | </syntaxhighlight>
| |
| − |
| |
| − | Recherche de tous les fichiers PDF :
| |
| − |
| |
| − | <syntaxhighlight lang="bash">
| |
| − | find /home -name "*.pdf"
| |
| − | </syntaxhighlight>
| |
| − |
| |
| − | == Rechercher du texte ==
| |
| − |
| |
| | === grep === | | === grep === |
| | | | |
| − | Recherche une chaîne dans un fichier.
| + | == Compression et archivage == |
| − | | + | === gzip === |
| − | <syntaxhighlight lang="bash">
| + | === tar === |
| − | grep "client" compta.txt
| |
| − | </syntaxhighlight>
| |
| − | | |
| − | Recherche récursive :
| |
| − | | |
| − | <syntaxhighlight lang="bash">
| |
| − | grep -r "erreur" /var/log
| |
| − | </syntaxhighlight>
| |
| − | | |
| − | = Navigation dans l'arborescence =
| |
| − | | |
| − | == Changer de répertoire ==
| |
| − | | |
| − | === cd ===
| |
| − | | |
| − | Répertoire personnel :
| |
| − | | |
| − | <syntaxhighlight lang="bash">
| |
| − | cd
| |
| − | </syntaxhighlight>
| |
| − | | |
| − | Répertoire spécifique :
| |
| − | | |
| − | <syntaxhighlight lang="bash">
| |
| − | cd /home/max
| |
| − | </syntaxhighlight>
| |
| − | | |
| − | Remonter d'un niveau :
| |
| − | | |
| − | <syntaxhighlight lang="bash">
| |
| − | cd ..
| |
| − | </syntaxhighlight>
| |
| − | | |
| − | == Afficher le répertoire courant ==
| |
| − | | |
| − | === pwd ===
| |
| − | | |
| − | <syntaxhighlight lang="bash">
| |
| − | pwd
| |
| − | </syntaxhighlight>
| |
| − | | |
| − | Exemple :
| |
| − | | |
| − | <syntaxhighlight lang="text">
| |
| − | /home/max/documents
| |
| − | </syntaxhighlight>
| |
| − | | |
| − | == Créer un répertoire ==
| |
| − | | |
| − | === mkdir ===
| |
| − | | |
| − | <syntaxhighlight lang="bash">
| |
| − | mkdir projet
| |
| − | </syntaxhighlight>
| |
| − | | |
| − | Créer plusieurs répertoires :
| |
| − | | |
| − | <syntaxhighlight lang="bash">
| |
| − | mkdir docs images sauvegardes
| |
| − | </syntaxhighlight>
| |
| − | | |
| − | == Supprimer un répertoire ==
| |
| − | | |
| − | === rmdir ===
| |
| − | | |
| − | Supprime un répertoire vide.
| |
| − | | |
| − | <syntaxhighlight lang="bash">
| |
| − | rmdir projet
| |
| − | </syntaxhighlight>
| |
| − | | |
| − | = Gestion de l'espace disque =
| |
| − | | |
| − | == df ==
| |
| − | | |
| − | Affiche l'espace disque disponible.
| |
| − | | |
| − | <syntaxhighlight lang="bash">
| |
| − | df -h
| |
| − | </syntaxhighlight>
| |
| − | | |
| − | == du ==
| |
| − | | |
| − | Affiche l'espace utilisé.
| |
| − | | |
| − | <syntaxhighlight lang="bash">
| |
| − | du -sh dossier
| |
| − | </syntaxhighlight>
| |
| − | | |
| − | = Compression et archivage = | |
| − | | |
| − | == gzip ==
| |
| − | | |
| − | Compression :
| |
| − | | |
| − | <syntaxhighlight lang="bash">
| |
| − | gzip fichier.log
| |
| − | </syntaxhighlight>
| |
| − | | |
| − | Décompression :
| |
| − | | |
| − | <syntaxhighlight lang="bash">
| |
| − | gzip -d fichier.log.gz | |
| − | </syntaxhighlight>
| |
| − | | |
| − | == tar ==
| |
| − | | |
| − | Créer une archive :
| |
| − | | |
| − | <syntaxhighlight lang="bash">
| |
| − | tar -cvf archive.tar dossier/
| |
| − | </syntaxhighlight>
| |
| − | | |
| − | Créer une archive compressée :
| |
| − | | |
| − | <syntaxhighlight lang="bash">
| |
| − | tar -czvf archive.tar.gz dossier/
| |
| − | </syntaxhighlight>
| |
| − | | |
| − | Extraire une archive :
| |
| − | | |
| − | <syntaxhighlight lang="bash">
| |
| − | tar -xvf archive.tar
| |
| − | </syntaxhighlight>
| |
| − | | |
| − | Extraire une archive compressée :
| |
| − | | |
| − | <syntaxhighlight lang="bash">
| |
| − | tar -xzvf archive.tar.gz
| |
| − | </syntaxhighlight>
| |
| − | | |
| − | Lister le contenu :
| |
| − | | |
| − | <syntaxhighlight lang="bash">
| |
| − | tar -tvf archive.tar
| |
| − | </syntaxhighlight>
| |
| − | | |
| − | = Gestion des processus =
| |
| − | | |
| − | == kill ==
| |
| − | | |
| − | Terminer un processus.
| |
| − | | |
| − | <syntaxhighlight lang="bash">
| |
| − | kill PID
| |
| − | </syntaxhighlight>
| |
| − | | |
| − | Exemple :
| |
| − | | |
| − | <syntaxhighlight lang="bash">
| |
| − | kill 1254
| |
| − | </syntaxhighlight>
| |
| − | | |
| − | = Obtenir de l'aide =
| |
| − | | |
| − | == man ==
| |
| − | | |
| − | Afficher le manuel d'une commande.
| |
| − | | |
| − | <syntaxhighlight lang="bash">
| |
| − | man ls
| |
| − | </syntaxhighlight>
| |
| − | | |
| − | Exemple :
| |
| − | | |
| − | <syntaxhighlight lang="bash">
| |
| − | man tar
| |
| − | </syntaxhighlight>
| |
| − | | |
| − | == help ==
| |
| − | | |
| − | Aide intégrée du shell :
| |
| − | | |
| − | <syntaxhighlight lang="bash">
| |
| − | help cd
| |
| − | </syntaxhighlight>
| |
| − | | |
| − | = Résumé des commandes essentielles =
| |
| − | | |
| − | {| class="wikitable sortable"
| |
| − | ! Commande
| |
| − | ! Fonction
| |
| − | |-
| |
| − | | ls
| |
| − | | Lister les fichiers
| |
| − | |-
| |
| − | | cd
| |
| − | | Changer de répertoire
| |
| − | |-
| |
| − | | pwd
| |
| − | | Afficher le répertoire courant
| |
| − | |-
| |
| − | | cp
| |
| − | | Copier
| |
| − | |-
| |
| − | | mv
| |
| − | | Déplacer / renommer
| |
| − | |-
| |
| − | | rm
| |
| − | | Supprimer
| |
| − | |-
| |
| − | | mkdir
| |
| − | | Créer un répertoire
| |
| − | |-
| |
| − | | rmdir
| |
| − | | Supprimer un répertoire vide
| |
| − | |-
| |
| − | | cat
| |
| − | | Afficher un fichier
| |
| − | |-
| |
| − | | more
| |
| − | | Lecture paginée
| |
| − | |-
| |
| − | | grep
| |
| − | | Recherche de texte
| |
| − | |-
| |
| − | | find
| |
| − | | Recherche de fichiers
| |
| − | |-
| |
| − | | gzip
| |
| − | | Compression
| |
| − | |-
| |
| − | | tar
| |
| − | | Archivage
| |
| − | |-
| |
| − | | df
| |
| − | | Espace disque disponible
| |
| − | |-
| |
| − | | du
| |
| − | | Espace disque utilisé
| |
| − | |-
| |
| − | | kill
| |
| − | | Arrêt d'un processus
| |
| − | |-
| |
| − | | man
| |
| − | | Documentation
| |
| − | |}
| |
| − | | |
| − | = Gestion des utilisateurs GNU/Linux =
| |
| − | | |
| − | == Concepts ==
| |
| − | | |
| − | Sous GNU/Linux, un utilisateur n'est pas nécessairement une personne physique.
| |
| − | | |
| − | Le système crée également des comptes techniques utilisés pour :
| |
| − | | |
| − | * Les services système
| |
| − | * Les démons
| |
| − | * Les tâches d'administration
| |
| − | * Les processus internes
| |
| − | | |
| − | Chaque utilisateur possède :
| |
| − | | |
| − | * un identifiant utilisateur (UID)
| |
| − | * un groupe principal (GID)
| |
| − | * un répertoire personnel
| |
| − | * un shell de connexion
| |
| − | | |
| − | == Commandes principales ==
| |
| − | | |
| − | {| class="wikitable"
| |
| − | ! Commande
| |
| − | ! Description
| |
| − | |-
| |
| − | | useradd
| |
| − | | Création d'un utilisateur
| |
| − | |-
| |
| − | | usermod
| |
| − | | Modification d'un utilisateur
| |
| − | |-
| |
| − | | userdel
| |
| − | | Suppression d'un utilisateur
| |
| − | |-
| |
| − | | passwd
| |
| − | | Modification du mot de passe
| |
| − | |-
| |
| − | | groupadd
| |
| − | | Création d'un groupe
| |
| − | |-
| |
| − | | groupdel
| |
| − | | Suppression d'un groupe
| |
| − | |}
| |
| − | | |
| − | == Création d'un utilisateur ==
| |
| − | | |
| − | <syntaxhighlight lang="bash">
| |
| − | useradd stagex
| |
| − | </syntaxhighlight>
| |
| − | | |
| − | Cette commande crée :
| |
| − | | |
| − | * un compte utilisateur
| |
| − | * une entrée dans <code>/etc/passwd</code>
| |
| − | * une entrée dans <code>/etc/group</code>
| |
| − | * un répertoire personnel
| |
| − | | |
| − | Définition du mot de passe :
| |
| − | | |
| − | <syntaxhighlight lang="bash">
| |
| − | passwd stagex
| |
| − | </syntaxhighlight>
| |
| − | | |
| − | == Suppression d'un utilisateur ==
| |
| − | | |
| − | <syntaxhighlight lang="bash">
| |
| − | userdel stagex
| |
| − | </syntaxhighlight>
| |
| − | | |
| − | Suppression avec le répertoire personnel :
| |
| − | | |
| − | <syntaxhighlight lang="bash">
| |
| − | userdel -r stagex
| |
| − | </syntaxhighlight>
| |
| − | | |
| − | == Fichier /etc/passwd ==
| |
| − | | |
| − | Le fichier contient les informations principales des comptes utilisateurs.
| |
| − | | |
| − | Format :
| |
| − | | |
| − | <syntaxhighlight lang="text">
| |
| − | login:x:uid:gid:commentaire:home:shell
| |
| − | </syntaxhighlight>
| |
| − | | |
| − | Exemple :
| |
| − | | |
| − | <syntaxhighlight lang="text">
| |
| − | alice:x:1000:1000:Alice Martin:/home/alice:/bin/bash
| |
| − | </syntaxhighlight>
| |
| − | | |
| − | == Fichier /etc/group ==
| |
| − | | |
| − | Format :
| |
| − | | |
| − | <syntaxhighlight lang="text">
| |
| − | groupe:x:gid:liste-utilisateurs
| |
| − | </syntaxhighlight>
| |
| − | | |
| − | Exemple :
| |
| − | | |
| − | <syntaxhighlight lang="text">
| |
| − | admins:x:1001:alice,bob
| |
| − | </syntaxhighlight>
| |
| − | | |
| − | == Fichier /etc/shadow ==
| |
| − | | |
| − | Contient les mots de passe chiffrés.
| |
| − | | |
| − | Accès :
| |
| − | | |
| − | * Lecture : root uniquement
| |
| − | * Écriture : root uniquement
| |
| − | | |
| − | = Gestion du système de fichiers ==
| |
| − | | |
| − | == Arborescence Linux ==
| |
| − | == Répertoire racine ==
| |
| − | == /etc ==
| |
| − | == /home ==
| |
| − | == /usr ==
| |
| − | == /var ==
| |
| − | | |
| − | = Permissions et sécurité ==
| |
| − | | |
| − | == Types de fichiers ==
| |
| − | == Permissions Unix ==
| |
| − | == chmod ==
| |
| − | == chown ==
| |
| − | == chgrp ==
| |
| − | == umask ==
| |
| − | == SUID == | |
| − | == SGID ==
| |
| − | == Sticky Bit ==
| |
| − | | |
| − | = Outils de gestion ==
| |
| − | == Commandes d'administration ==
| |
| − | == Outils de visualisation ==
| |
| − | | |
| − | = Éditeurs de texte ==
| |
| − | == vi ==
| |
| − | == Emacs ==
| |
| − | | |
| − | = Gestion des utilisateurs GNU/Linux =
| |
| − | | |
| − | == Concepts ==
| |
| − | | |
| − | Sous GNU/Linux, un utilisateur n'est pas nécessairement une personne physique.
| |
| − | | |
| − | Le système crée également des comptes techniques utilisés pour :
| |
| − | | |
| − | * Les services système
| |
| − | * Les démons
| |
| − | * Les tâches d'administration
| |
| − | * Les processus internes
| |
| − | | |
| − | Chaque utilisateur possède :
| |
| − | | |
| − | * un identifiant utilisateur (UID)
| |
| − | * un groupe principal (GID)
| |
| − | * un répertoire personnel
| |
| − | * un shell de connexion
| |
| − | | |
| − | == Commandes principales ==
| |
| − | | |
| − | {| class="wikitable"
| |
| − | ! Commande
| |
| − | ! Description
| |
| − | |-
| |
| − | | useradd
| |
| − | | Création d'un utilisateur
| |
| − | |-
| |
| − | | usermod
| |
| − | | Modification d'un utilisateur
| |
| − | |-
| |
| − | | userdel
| |
| − | | Suppression d'un utilisateur
| |
| − | |-
| |
| − | | passwd
| |
| − | | Modification du mot de passe
| |
| − | |-
| |
| − | | groupadd
| |
| − | | Création d'un groupe
| |
| − | |-
| |
| − | | groupdel
| |
| − | | Suppression d'un groupe
| |
| − | |}
| |
| − | | |
| − | == Création d'un utilisateur ==
| |
| − | | |
| − | <syntaxhighlight lang="bash">
| |
| − | useradd stagex
| |
| − | </syntaxhighlight>
| |
| − | | |
| − | Cette commande crée :
| |
| − | | |
| − | * un compte utilisateur
| |
| − | * une entrée dans <code>/etc/passwd</code>
| |
| − | * une entrée dans <code>/etc/group</code>
| |
| − | * un répertoire personnel
| |
| − | | |
| − | Définition du mot de passe :
| |
| − | | |
| − | <syntaxhighlight lang="bash">
| |
| − | passwd stagex
| |
| − | </syntaxhighlight>
| |
| − | | |
| − | == Suppression d'un utilisateur ==
| |
| − | | |
| − | <syntaxhighlight lang="bash">
| |
| − | userdel stagex
| |
| − | </syntaxhighlight>
| |
| − | | |
| − | Suppression avec le répertoire personnel :
| |
| − | | |
| − | <syntaxhighlight lang="bash">
| |
| − | userdel -r stagex
| |
| − | </syntaxhighlight>
| |
| − | | |
| − | == Fichier /etc/passwd ==
| |
| − | | |
| − | Le fichier contient les informations principales des comptes utilisateurs.
| |
| − | | |
| − | Format :
| |
| − | | |
| − | <syntaxhighlight lang="text">
| |
| − | login:x:uid:gid:commentaire:home:shell
| |
| − | </syntaxhighlight>
| |
| − | | |
| − | Exemple :
| |
| − | | |
| − | <syntaxhighlight lang="text">
| |
| − | alice:x:1000:1000:Alice Martin:/home/alice:/bin/bash
| |
| − | </syntaxhighlight>
| |
| − | | |
| − | == Fichier /etc/group ==
| |
| − | | |
| − | Format :
| |
| − | | |
| − | <syntaxhighlight lang="text">
| |
| − | groupe:x:gid:liste-utilisateurs
| |
| − | </syntaxhighlight>
| |
| − | | |
| − | Exemple :
| |
| − | | |
| − | <syntaxhighlight lang="text">
| |
| − | admins:x:1001:alice,bob
| |
| − | </syntaxhighlight>
| |
| − | | |
| − | == Fichier /etc/shadow ==
| |
| − | | |
| − | Contient les mots de passe chiffrés.
| |
| | | | |
| − | Accès :
| + | = Gestion des utilisateurs = |
| | | | |
| − | * Lecture : root uniquement
| + | == Comptes utilisateurs == |
| − | * Écriture : root uniquement
| + | == Groupes == |
| | + | == useradd == |
| | + | == usermod == |
| | + | == userdel == |
| | + | == passwd == |
| | + | == /etc/passwd == |
| | + | == /etc/group == |
| | + | == /etc/shadow == |
| | | | |
| | = Gestion du système de fichiers == | | = Gestion du système de fichiers == |