Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Prochaine révision
Révision précédente
elearning:workbooks:centos:8:admin:l120 [2021/11/01 15:52] – created adminelearning:workbooks:centos:8:admin:l120 [2022/06/05 18:00] (Version actuelle) admin
Ligne 1: Ligne 1:
 ~~PDF:LANDSCAPE~~ ~~PDF:LANDSCAPE~~
  
-Dernière mise-à-jour ~~LASTMOD~~+Version **2022.01**
  
-======LCF514 - Gestion du Serveur NFS======+Last updated : ~~LASTMOD~~
  
-=====Contenu du Module=====+======LCE514 - Training Validation======
  
-  * **LCF514 - Gestion du Serveur NFS** +=====Contents=====
-    * Contenu du Module +
-    * Présentation +
-      * Les Services et Processus du Serveur NFSv3 +
-        * Les Services RPC +
-      * Options d'un Partage NFS +
-      * Commandes de Base +
-    * Installation +
-    * Mise en Place +
-      * Configuration du Serveur +
-      * Configuration du Client +
-    * Surveillance du Serveur +
-      * La Commande rpcinfo +
-      * La Commande nfsstat+
  
-=====Présentation=====+  * **LCE514 - Training Validation** 
 +    * Contents 
 +    * Course Materials 
 +    * Reminder of the Training Program 
 +    * Training Evaluation 
 +    * Exam - Acquired knowledge
  
-Quand on parle de NFS, on parle d'**exportation** d'un répertoire sur le serveur afin que celui-ci puisse être vu par des clients sur le réseau. Ces clients peuvent ensuite monter le répertoire et l'utiliser comme si celui-ci faisait partie de son propre filesystem.+=====Course Materials=====
  
-Le Network File System (NFS) est le protocole de partage de fichiers historique sur des systèmes Unix. Lors de l'introduction de SambaNFS vu sa popularité diminuée, essentiellement parce que la connexion est non-sécurisée :+Access to the course materialsLABS and tests requires per trainee subscription to our LMS on the Internet.
  
-  le partage ainsi que ses caractéristiques sont configurés par rapport à l'adresse IP du client, or l'IP Spoofing est de plus en plus répandu, +You have been given a **free** 365 day subscription to your Course Materials on our LMS.
-  aucun mot de passe n'est demandé lors de la connexion d'un utilisateur à une ressource car le serveur NFS présume que l'utilisateur //jean// distant est le même utilisateur du compte //jean// sur le serveur NFS.+
  
-Cependant l'arrivée sur le marché de serveurs NAS domestiques ainsi que l'utilisation de la virtualisation dans le milieu professionnel fait que NFS connait un regain d'intérêt en tant que stockage mutualisé raid, simple à mettre en œuvre.+=====Reminder of the Training Program=====
  
-Il existe actuellement 3 versions de NFS :+  * **LCE500 - CentOS 8 Linux (RHEL 8 / Oracle Linux 8) - System Administrator** 
 +    * Contents 
 +    * Prerequisites 
 +      * Hardware 
 +      * Software 
 +      * Internet 
 +    * Using our infrastructure 
 +    * Training Program 
 +    * Skills Assessment
  
-^ Version ^ Protocole Utilisé ^ Dépendance ^ +  * **LCE501 - Managing Users and Groups** 
-**NFSv2** | TCP et UDP | portmap | +    Contents 
-**NFSv3** | TCP et UDP | portmap | +    Presentation 
-**NFSv4** | TCP | Aucune les fonctions de portmap sont incluses dans NFSv4 |+      /etc/nsswitch.conf 
 +      The getent Command 
 +      The /etc/group and /etc/gshadow files 
 +      The /etc/passwd and /etc/shadow files 
 +    Commands 
 +      Groups 
 +        groupadd 
 +        groupdel 
 +        groupmod 
 +        newgrp 
 +        * gpasswd 
 +      * Users 
 +        * useradd 
 +        * userdel 
 +        * usermod 
 +        * passwd 
 +        * chage 
 +    * Configuration 
 +    * LAB #1 Managing Users and Groups 
 +    * LAB #2 - su and su - 
 +    * sudo
  
-La version utilisée par défaut sous CentOS/Redhat est **NFSv3**.+  * **LCE502 - Package Management** 
 +    * Contents 
 +    * LAB #1 - Compiling Software 
 +      * 1.1 - ./configure 
 +      1.2 - make 
 +      1.3 - make check 
 +      1.4 - make install 
 +    LAB #2 - The rpm Command 
 +      * 2.1 - Configuration 
 +      * 2.2 - Usage 
 +    * LAB #3 - The dnf Command 
 +      * 3.1 - Presentation 
 +      * 3.2 - Configuration 
 +      * 3.3 - Repositories 
 +      * 3.4 - Searching for Packages 
 +      * 3.5 - Viewing Information on and Downloading a Package 
 +      * 3.6 - Installing a Package 
 +      * 3.7 - Updating Packages 
 +      * 3.8 - Deleting Packages 
 +    * Shared Libraries 
 +      * Presentation 
 +        * Introduction 
 +        * Shared Object Locations 
 +        * ld-linux.so.2 
 +      * The ldd Command 
 +      * The /etc/ld.so.conf File 
 +      * The ldconfig Command
  
-====Les Services et Processus du Serveur NFSv3====+  * **LCE503 - Managing File Permissions** 
 +    * Contents 
 +    * Presentation 
 +    * Preparation 
 +    * LAB #1 - Basic Unix File Permissions 
 +      * 1.1 - Changing Permissions with chmod 
 +        * Symbolic Mode 
 +        * Octal Mode 
 +        * The umask Command 
 +      * 1.2 - Changing the Owner or the Group with chown and chgrp 
 +        * The chown Command 
 +        * The chgrp Command 
 +    * LAB #2 - Advanced Unix Permissions 
 +      * 2.1 - SUID/SGID bit 
 +      * 2.2 - Inheritance Flag 
 +      * 2.3 - Sticky bit 
 +    * LAB #3 - Extending Linux Permissions using ACLs and Attributes 
 +      * 3.1 - ACLs 
 +      * 3.2 - Attributes
  
-La version NFSv3 utilise les services suivants :+  * **LCE504 - Managing Disks and Filesystems** 
 +    * Contents 
 +    * Peripherals 
 +    * Partitions 
 +    * Partitioning 
 +      * LAB #1 - Partioning your Disk with the fdisk Command 
 +      * LAB #2 - Modifier les Drapeaux des Partitions avec fdisk 
 +    * Logical Volume Manager (LVM) 
 +      * LAB #3 - Linear Logical Volumes 
 +        * Physical Volumes (PV) 
 +        * Volume Groups (VG) and Physical Extents (PE) 
 +        * Logical Volumes (LV) 
 +      * LAB #4 - Grow a Volume 
 +      * LAB #5 - Snapshots 
 +      * LAB #6 - Deleting Volumes 
 +      * LAB #7 - Mirrored Volumes 
 +      * LAB #8 - Changing LVM Attributes 
 +      * LAB #9 - Striped Volumes 
 +      * LAB #10 - Managing Meta-data 
 +    * Journaled Filesystems 
 +      * Ext3 
 +        * Managing Ext3 
 +        * LAB #11 - Converting Ext3 to Ext2 
 +        * LAB #12 - Converting Ext2 to Ext3 
 +        * LAB #13 - Using another PArtition for the Journal 
 +        * LAB #14 - Changing the File System Check interval on an ext3 Filesystem 
 +      * Ext4 
 +        * LAB #15 - Creating an Ext4 Filesystem 
 +        * LAB #16 - Adding a Label to an Ext4 Filesystem 
 +        * LAB #17 - Converting Ext3 to Ext4 
 +      * XFS 
 +        * LAB #18 - Creating an XFS Filesystem 
 +        * LAB #19 - Adding a Label to an XFS Filesystem
  
-^ Services ^ Fonction ^ +  * **LCE505 - Process Scheduling** 
-**nfs** | Démarre le service NFS ainsi que les processus RPC pour recevoir et traiter les demandes des clients | +    Contents 
-**nfslock** | Démarre les processus RPC qui permettent aux clients de verrouiller les fichiers sur le serveur  | +    cron 
-**portmap*| Gestion des réservations des ports pour les services RPC locaux afin que les services RPC distants puissent se connecter |+      The /etc/crontab file 
 +      Time Fields 
 +      User Crontabs 
 +    anacron 
 +    at
  
-===Les Services RPC===+  * **LCE506 - Archiving and Compression** 
 +    * Contents 
 +    * Traditional Backup Tools 
 +      * Preparation 
 +      * The tar Command 
 +        * Presentation 
 +        * LAB #1 - Working with the tar Command 
 +        * The GPL tar Commande and Compression 
 +      * The cpio Command 
 +        * Presentation 
 +        * LAB #2 - Working with the cpio Command 
 +      * The dd Command 
 +        * Presentation 
 +        * LAB #3 - Working with the dd Command 
 +      * The dump et restore Commands 
 +        * Presentation 
 +      * LAB #4 - System Backups 
 +        * Backing up the Installed Package List 
 +        * Backing up the Disk Structure 
 +        * Backing up Mount Points 
 +        * Backing up the Boot Loader 
 +          * GRUB Legacy 
 +          * GRUB 2 on BIOS 
 +          * GRUB 2 on EFI 
 +        * Backing up User Files 
 +      * Rsync 
 +        * Presentation 
 +        * LAB #5 - Working with the rsync Command 
 +    * Compression 
 +      * The gzip Command 
 +        * Presentation 
 +        * LAB #4 - Working with the gzip Command 
 +      * The bzip2 Command 
 +        * Presentation 
 +        * LAB #5 - Working with the bzip2 Command 
 +      * The xz Command 
 +        * Presentation 
 +        * LAB #6 - Working with the xz Command 
 +      * Other Compression Utilities
  
-Les services RPC ( //Remote Procedure Calls// ou appel de procédures distantes ) ont été inventé par SUN Microsystem pour faciliter le travail des développeurs  de pous des échanges entre mchines distantes. Les RPC s'appuient sur des numéros de programmes.+  * **LCE507 - Process Management** 
 +    * Contents 
 +    * Presentation 
 +    * Process Types 
 +    * Process Commands 
 +      * The ps Command 
 +      * The pgrep Command 
 +      * The pstree Command 
 +      * The top Command 
 +      * The fg, bg and jobs Commands 
 +      * The wait Command 
 +      * The nice Command 
 +      * The renice Command 
 +      * The nohup Command 
 +      * The kill Command 
 +      * The pkill Command
  
-Lorsque le client veut faire une requête à un service RPC, il contacte en premier lieu le service **rpcbind** qui assigne un numéro de port au délà du numéro **32768** à un numéro de programme RPC.+  * **LCE508 - Managing Logs** 
 +    Contents 
 +    Presentation 
 +    The dmesg Command 
 +    * Security Logging 
 +      * The last Command 
 +      * The lastlog Command 
 +      * The lastb Command 
 +      * The /var/log/secure File 
 +    * The /var/log/audit/audit.log File 
 +      * Managing Audit Events 
 +        * auditd 
 +        * auditctl 
 +      * Viewing Audit Events 
 +        * The aureport Command 
 +        * The ausearch Command 
 +    * The /var/log/messages File 
 +    * Applications 
 +    * rsyslog 
 +      * Priorities 
 +      * Facilitiess 
 +      * The /etc/rsyslog.conf File 
 +        * Modules 
 +        * Global Directives 
 +        * Rules 
 +          * Facility.Priority 
 +          * Facility!Priority 
 +          * Facility=Priority 
 +          * Using the * Wildcard 
 +          * n Facilities with Identical Priorities 
 +          * n Selectors with Identical Actions 
 +    * The logger Command 
 +    * The logrotate Command 
 +    * journald 
 +      * Using Journald 
 +        * Application Specific Messages 
 +        * Boot Messages 
 +        * Priority Specific Messages 
 +        * Messages from a Specific Date Range 
 +        * Real Time Messages 
 +        * Searching with Key Words
  
 +  * **LCE509 - Printer Management** 
 +    * Contents
 +    * Cups
 +      * Protocols
 +      * Packages
 +      * Daemon
 +      * The /etc/cups/cupsd.conf File
 +      * Filters
 +      * Backends
 +      * Logs
 +      * Printers
 +      * Administration
 +        * The lpstat Command
 +        * The lpadmin Command
 +        * The accept et cupsenable Commands
 +        * Classes
 +        * The /etc/cups/printers.conf File
 +        * The /etc/cups/classes.conf File
 +        * The cancel Command
 +        * The lpmove Command
 +        * Web Interface
  
-====Options d'un Partage NFS====+  * **LCE510 - System Startup and Shutdown** 
 +    * Contents 
 +    * System Startup 
 +      * Boot Loader 
 +        * BIOS Systems 
 +        * EFI Systems 
 +        * GRUB 2 
 +          * The /boot/grub/grub.cfg File 
 +          * The /etc/default/grub file 
 +          * Files in the /etc/grub.directory 
 +      * Initramfs 
 +        * The init Script  
 +      * Kernel Booting Process 
 +    * Systemd 
 +      * LAB #1 - The systemctl Command 
 +      * LAB #2 - Configuration Files 
 +        * 2.1 - Default Configuration Files 
 +        * 2.1 - Overloading Default Configuration Files 
 +      * LAB #3 - The systemd-analyze Command 
 +      * LAB #4 - Targets 
 +        * 4.1 - Checking the Target Dependencies 
 +        * 4.2 - The Default Target 
 +          * Checking the Default Target 
 +          * Changing the Default Target 
 +          * Changing the Default Target for the Current Session 
 +      * LAB #5 - Managing Services 
 +        * 5.1 - Single Service Instances 
 +        * 5.2 - Multiple Instance Services 
 +        * 5.3 - Disallowing Modifications to a Service Status 
 +    * LAB #6 - System Shutdown 
 +      * 6.1 - The shutdown Command 
 +      * 6.2 - The reboot Command 
 +      * 6.3 - The halt Command 
 +      * 6.4 - The poweroff Command
  
-Certaines options, appliquées à un partage, modifient le comportement du serveur NFS pour le partage concerné lors de son démarrage :+  * **LCE511 - Training Validation** 
 +    * Course Materials 
 +    * Reminder of the Training Program 
 +      * Day #1 
 +      * Day #2 
 +      * Day #3 
 +      * Day #4 
 +    * Training Evaluation 
 +    * Exam - Acquired knowledge
  
-^ Option ^ Comportement ^ +=====Training Evaluation=====
-| **ro** | Accès en lecture seule | +
-| **rw** | Accès en lecture / écriture | +
-| **sync** | Ecriture synchrone ( écriture immédiate sur disque ) | +
-| **async** | Ecriture asynchrone ( écriture sur disque en utilisant une cache ) | +
-| **root_squash** | Root perd ses prérogatives sur le partage concerné | +
-| **no_root_squash** | Root garde ses prérogatives sur le partage concerné | +
-| **no_lock** | Pas de verrous sur les fichiers accédés | +
-| **all_squash** | Force la mapping de tous les utilisateurs vers l'utilisateur **nobody** | +
-| **anonuid** | Fixe l'UID de l'utilisateur anonyme | +
-| **anongid** | Fixe le GID de l'utilisateur anonyme |+
  
-<WRAP center round important> +Please complete and submit the training evaluation form.
-**Important** : Si plusieurs options sont spécifiées, celles-ci doivent être séparées par des virgules. +
-</WRAP>+
  
-====Commandes de Base====+=====Exam - Acquired knowledge=====
  
-Plusieurs commandes permettent de gérer et de s'informer sur l'activité du serveur NFS : +Please take the final examination.
- +
-^ Commande ^ Comportement ^ +
-| **exportfs** | Affiche les partages actifs sur le serveur courant | +
-| **nfsstat** | Affiche les statistiques de l'activité NFS | +
-| **rpcinfo** | Affiche les démons gérés en effectuant une requête RPC sur le serveur courant | +
-| **showmount** | Affiche les partages actifs sur un serveur distant | +
-| **mount** | Permet de monter un partage distant sur un répertoire local | +
- +
-=====Mise en Place===== +
- +
-====Configuration du Serveur==== +
- +
-<WRAP center round important> +
-**Important** : Arrêtez votre VMDans la fenêtre de Oracle VM VirtualBox, cliquez sur **Fichier > Paramètres > Réseau** et créez un réseau NAT appelé **NatNetwork**. Dans les paramètres de votre VM, cliquez sur **Réseau** et configurez la Carte 1 en Réseau NAT dans le réseau NatNetwork. Démarrez votre VM. +
-</WRAP> +
- +
-Configurez votre interface réseau si ce n'est pas déjà fait : +
- +
-<code> +
-[root@centos7 ~]# nmcli connection add con-name ip_fixe ifname enp0s3 type ethernet ip4 10.0.2.16/24 gw4 10.0.2.2 +
-Connection 'ip_fixe' (5ac899e6-3f7b-415e-b9d7-c950fab007d5) successfully added. +
-[root@centos7 ~]# nmcli connection mod ip_fixe ipv4.dns 8.8.8.8 +
-[root@centos7 ~]# nmcli connection up ip_fixe  +
-Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/1) +
-[root@centos7 ~]# systemctl restart NetworkManager.service +
-</code> +
- +
-Ajoutez une autre adresse IP pour le NFS : +
- +
-<code> +
-[root@centos7 ~]# nmcli connection mod ip_fixe +ipv4.addresses 192.168.1.2/24 +
-</code> +
- +
-Continuez maintenant par la mise en place du service **nfs** : +
- +
-<code> +
-[root@centos7 ~]# systemctl status nfs.service +
-nfs-server.service - NFS server and services +
-   Loaded: loaded (/usr/lib/systemd/system/nfs-server.service; disabled) +
-   Active: inactive (dead) +
- +
-[root@centos7 ~]# systemctl enable nfs-server.service +
-ln -s '/usr/lib/systemd/system/nfs-server.service' '/etc/systemd/system/multi-user.target.wants/nfs-server.service' +
-[root@centos7 ~]# systemctl status nfs.service +
-nfs-server.service - NFS server and services +
-   Loaded: loaded (/usr/lib/systemd/system/nfs-server.service; enabled) +
-   Active: inactive (dead) +
-</code> +
- +
-La mise en place d'un partage ponctuel se fait en utilisant la commande **exportfs** en indiquant en argument le répertoire sous la forme de //adresse_ip_du_serveur:chemin_du_partage// :  +
- +
-<code> +
-[root@centos7 ~]# exportfs +
-[root@centos7 ~]# exportfs 192.168.1.2:/home/trainee +
-[root@centos7 ~]# exportfs +
-/home/trainee 192.168.1.2 +
-</code> +
- +
-Démarrez maintenant le service **nfs** : +
- +
-<code> +
-[root@centos7 ~]# systemctl start nfs.service +
-[root@centos7 ~]# systemctl status nfs.service +
-nfs-server.service - NFS server and services +
-   Loaded: loaded (/usr/lib/systemd/system/nfs-server.service; enabled) +
-   Active: active (exited) since Thu 2015-10-01 13:18:13 CEST; 4s ago +
-  Process: 9552 ExecStart=/usr/sbin/rpc.nfsd $RPCNFSDARGS (code=exited, status=0/SUCCESS) +
-  Process: 9551 ExecStartPre=/usr/sbin/exportfs -r (code=exited, status=0/SUCCESS) +
- Main PID: 9552 (code=exited, status=0/SUCCESS) +
-   CGroup: /system.slice/nfs-server.service +
- +
-Oct 01 13:18:13 centos7.fenestros.loc systemd[1]: Starting NFS server and services... +
-Oct 01 13:18:13 centos7.fenestros.loc systemd[1]: Started NFS server and services. +
-</code> +
- +
-Afin de mettre en place un ou des partages **permanents**, il est nécessaire d'éditer le fichier **/etc/exports** : +
- +
-<code> +
-/home/trainee 192.168.1.1 +
-/tmp *(fsid=0) +
-</code> +
- +
-<WRAP center round important> +
-**Important** : Dans ce cas, nous avons partagé le répertoire **/home/trainee** pour la seule adresse IP 192.168.1.1. +
-</WRAP> +
- +
-Redémarrez maintenant le service nfs afin que le fichier **/etc/exports** soit re-lu : +
- +
-<code> +
-[root@centos7 ~]# systemctl restart nfs.service +
-[root@centos7 ~]# systemctl status nfs.service +
-nfs-server.service - NFS server and services +
-   Loaded: loaded (/usr/lib/systemd/system/nfs-server.service; enabled) +
-   Active: active (exited) since Thu 2015-10-01 14:24:50 CEST; 18s ago +
-  Process: 4642 ExecStopPost=/usr/sbin/exportfs -f (code=exited, status=0/SUCCESS) +
-  Process: 4639 ExecStopPost=/usr/sbin/exportfs -au (code=exited, status=0/SUCCESS) +
-  Process: 4638 ExecStop=/usr/sbin/rpc.nfsd 0 (code=exited, status=0/SUCCESS) +
-  Process: 4650 ExecStart=/usr/sbin/rpc.nfsd $RPCNFSDARGS (code=exited, status=0/SUCCESS) +
-  Process: 4649 ExecStartPre=/usr/sbin/exportfs -r (code=exited, status=0/SUCCESS) +
- Main PID: 4650 (code=exited, status=0/SUCCESS) +
-   CGroup: /system.slice/nfs-server.service +
- +
-Oct 01 14:24:50 centos7.fenestros.loc systemd[1]: Starting NFS server and services... +
-Oct 01 14:24:50 centos7.fenestros.loc exportfs[4649]: exportfs: No options for /home/trainee 192.168.1.1: suggest 192.168.1.1(sync) to avoid warning +
-Oct 01 14:24:50 centos7.fenestros.loc exportfs[4649]: exportfs: No options for /tmp *: suggest *(sync) to avoid warning +
-Oct 01 14:24:50 centos7.fenestros.loc systemd[1]: Started NFS server and services. +
-</code> +
- +
-Puisque aucune option ne soit spécifiée pour les montages, ceux-ci ont été exportés avec des option par défaut. En utilisant l'option **-v** de la commande **exportfs**, il est possible de consulter ces options : +
- +
-<code> +
-[root@centos7 ~]# exportfs -v +
-/home/trainee 192.168.1.1(ro,wdelay,root_squash,no_subtree_check,sec=sys,ro,secure,root_squash,no_all_squash) +
-/tmp          <world>(ro,wdelay,root_squash,no_subtree_check,fsid=0,sec=sys,ro,secure,root_squash,no_all_squash) +
-</code> +
- +
-====Configuration du Client==== +
- +
-<WRAP center round important> +
-**Important** : Arrêtez votre VM. Créez une clône de votre VM. Démarrez la VM clonée. +
-</WRAP> +
- +
-Re-configurez ensuite l'interface réseau de votre VM Client : +
- +
-<code> +
-[root@centos7 ~]# nmcli connection del ip_fixe +
- +
-[root@centos7 ~]# nmcli connection show ip_fixe +
-Error: ip_fixe - no such connection profile. +
- +
-[root@centos7 ~]# nmcli connection add con-name ip_fixe ifname enp0s3 type ethernet ip4 10.0.2.17/24 gw4 10.0.2.2 +
-Connection 'ip_fixe' (5b54ad20-c3e2-4606-b54d-38b225cc578f) successfully added. +
- +
-[root@centos7 ~]# nmcli connection mod ip_fixe ipv4.dns 8.8.8.8 +
- +
-[root@centos7 ~]# nmcli connection mod ip_fixe +ipv4.addresses 192.168.1.1/24 +
- +
-[root@centos7 ~]# nmcli connection up ip_fixe  +
-Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/1) +
- +
-[root@centos7 ~]# systemctl restart NetworkManager.service +
-</code> +
- +
-<WRAP center round important > +
-**Important** : Démarrez la VM d'origine. +
-</WRAP> +
- +
-Dans la VM d'origine (serveur) passez SELinux en mode permissive et arrêtez le pare-feu : +
- +
-<code> +
-[root@centos7 ~]# getenforce +
-Enforcing +
-[root@centos7 ~]# setenforce permissive +
-[root@centos7 ~]# systemctl status firewalld.service +
-firewalld.service - firewalld - dynamic firewall daemon +
-   Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled) +
-   Active: active (running) since Thu 2015-10-01 14:54:57 CEST; 19min ago +
- Main PID: 479 (firewalld) +
-   CGroup: /system.slice/firewalld.service +
-           └─479 /usr/bin/python -Es /usr/sbin/firewalld --nofork --nopid +
- +
-Oct 01 14:54:57 centos7.fenestros.loc systemd[1]: Started firewalld - dynamic firewall daemon. +
-[root@centos7 ~]# systemctl stop firewalld.service +
-</code> +
- +
-A partir de votre client, consultez les répertoire exportés du serveur : +
- +
-<code> +
-[root@centos7 ~]# showmount --exports 192.168.1.2 +
-Export list for 192.168.1.2: +
-/tmp          * +
-/home/trainee 192.168.1.1 +
-</code> +
- +
-Créez maintenant le répertoire **/nfs** dans le client et montez le partage **192.168.1.2:/home/trainee** : +
- +
-<code> +
-[root@centos7 ~]# mkdir /nfs +
-[root@centos7 ~]# mount -t nfs 192.168.1.2:/home/trainee /nfs +
-</code> +
- +
-Notez que quand vous essayer de rentrer dans le répertoire en tant que root, vous obtenez le message **-bash: cd: /nfs: Permission non accordée** : +
- +
-<code> +
-[root@centos7 ~]# cd /nfs +
--bash: cd: /nfs: Permission denied +
-</code> +
- +
-<WRAP center round important> +
-**Important** : Puisque le répertoire **/home/trainee** a été exporté avec l'option par défaut **root_squash**. Ceci implique que root perd ses droits sur le répertoire quand il est monté. En fait, le service nfs remplace l'UID de 0 avec l'UID de l'utilisateur **nobody**. +
-</WRAP> +
- +
-Retournez donc dans le serveur et modifiez le fichier **/etc/exports** ainsi : +
- +
-<code> +
-[root@centos7 ~]# cat /etc/exports +
-/home/trainee 192.168.1.1(async,rw,no_root_squash)  +
-/tmp * +
-</code> +
- +
-Redémarrez le service nfs : +
- +
-<code> +
-[root@centos7 ~]# systemctl restart nfs.service +
-</code> +
- +
-Vous noterez que maintenant vous êtes capable de vous positionner dans le répertoire **/nfs** du client en tant que **root**  +
- +
-<code> +
-[root@centos7 ~]# cd /nfs +
-[root@centos7 nfs]#  +
-</code> +
- +
-=====Surveillance du Serveur===== +
- +
-====La Commande rpcinfo==== +
- +
-La commande **rpcinfo** permet de faire une requête RPC sur le serveur et de voir les démons gérés : +
- +
-<code> +
-[root@centos6 ~]# rpcinfo +
-   program version netid     address                service    owner +
-    100000    4    tcp6      ::.0.111               portmapper superuser +
-    100000    3    tcp6      ::.0.111               portmapper superuser +
-    100000    4    udp6      ::.0.111               portmapper superuser +
-    100000    3    udp6      ::.0.111               portmapper superuser +
-    100000    4    tcp       0.0.0.0.0.111          portmapper superuser +
-    100000    3    tcp       0.0.0.0.0.111          portmapper superuser +
-    100000    2    tcp       0.0.0.0.0.111          portmapper superuser +
-    100000    4    udp       0.0.0.0.0.111          portmapper superuser +
-    100000    3    udp       0.0.0.0.0.111          portmapper superuser +
-    100000    2    udp       0.0.0.0.0.111          portmapper superuser +
-    100000    4    local     /var/run/rpcbind.sock  portmapper superuser +
-    100000    3    local     /var/run/rpcbind.sock  portmapper superuser +
-    100024    1    udp       0.0.0.0.182.127        status     29 +
-    100024    1    tcp       0.0.0.0.182.157        status     29 +
-    100024    1    udp6      ::.146.50              status     29 +
-    100024    1    tcp6      ::.139.119             status     29 +
-    100011    1    udp       0.0.0.0.3.107          rquotad    superuser +
-    100011    2    udp       0.0.0.0.3.107          rquotad    superuser +
-    100011    1    tcp       0.0.0.0.3.107          rquotad    superuser +
-    100011    2    tcp       0.0.0.0.3.107          rquotad    superuser +
-    100005    1    udp       0.0.0.0.204.191        mountd     superuser +
-    100005    1    tcp       0.0.0.0.196.122        mountd     superuser +
-    100005    1    udp6      ::.177.18              mountd     superuser +
-    100005    1    tcp6      ::.229.141             mountd     superuser +
-    100005    2    udp       0.0.0.0.215.201        mountd     superuser +
-    100005    2    tcp       0.0.0.0.174.127        mountd     superuser +
-    100005    2    udp6      ::.199.96              mountd     superuser +
-    100005    2    tcp6      ::.147.162             mountd     superuser +
-    100005    3    udp       0.0.0.0.210.10         mountd     superuser +
-    100005    3    tcp       0.0.0.0.155.14         mountd     superuser +
-    100005    3    udp6      ::.147.130             mountd     superuser +
-    100005    3    tcp6      ::.220.126             mountd     superuser +
-    100003    2    tcp       0.0.0.0.8.1            nfs        superuser +
-    100003    3    tcp       0.0.0.0.8.1            nfs        superuser +
-    100003    4    tcp       0.0.0.0.8.1            nfs        superuser +
-    100227    2    tcp       0.0.0.0.8.1            nfs_acl    superuser +
-    100227    3    tcp       0.0.0.0.8.1            nfs_acl    superuser +
-    100003    2    udp       0.0.0.0.8.1            nfs        superuser +
-    100003    3    udp       0.0.0.0.8.1            nfs        superuser +
-    100003    4    udp       0.0.0.0.8.1            nfs        superuser +
-    100227    2    udp       0.0.0.0.8.1            nfs_acl    superuser +
-    100227    3    udp       0.0.0.0.8.1            nfs_acl    superuser +
-    100003    2    tcp6      ::.8.1                 nfs        superuser +
-    100003    3    tcp6      ::.8.1                 nfs        superuser +
-    100003    4    tcp6      ::.8.1                 nfs        superuser +
-    100227    2    tcp6      ::.8.1                 nfs_acl    superuser +
-    100227    3    tcp6      ::.8.1                 nfs_acl    superuser +
-    100003    2    udp6      ::.8.1                 nfs        superuser +
-    100003    3    udp6      ::.8.1                 nfs        superuser +
-    100003    4    udp6      ::.8.1                 nfs        superuser +
-    100227    2    udp6      ::.8.1                 nfs_acl    superuser +
-    100227    3    udp6      ::.8.1                 nfs_acl    superuser +
-    100021    1    udp       0.0.0.0.163.78         nlockmgr   superuser +
-    100021    3    udp       0.0.0.0.163.78         nlockmgr   superuser +
-    100021    4    udp       0.0.0.0.163.78         nlockmgr   superuser +
-    100021    1    tcp       0.0.0.0.137.82         nlockmgr   superuser +
-    100021    3    tcp       0.0.0.0.137.82         nlockmgr   superuser +
-    100021    4    tcp       0.0.0.0.137.82         nlockmgr   superuser +
-    100021    1    udp6      ::.175.250             nlockmgr   superuser +
-    100021    3    udp6      ::.175.250             nlockmgr   superuser +
-    100021    4    udp6      ::.175.250             nlockmgr   superuser +
-    100021    1    tcp6      ::.188.197             nlockmgr   superuser +
-    100021    3    tcp6      ::.188.197             nlockmgr   superuser +
-    100021    4    tcp6      ::.188.197             nlockmgr   superuser +
-</code> +
- +
-<code> +
-[root@centos7 ~]# rpcinfo +
-   program version netid     address                service    owner +
-    100000    4    tcp6      ::.0.111               portmapper superuser +
-    100000    3    tcp6      ::.0.111               portmapper superuser +
-    100000    4    udp6      ::.0.111               portmapper superuser +
-    100000    3    udp6      ::.0.111               portmapper superuser +
-    100000    4    tcp       0.0.0.0.0.111          portmapper superuser +
-    100000    3    tcp       0.0.0.0.0.111          portmapper superuser +
-    100000    2    tcp       0.0.0.0.0.111          portmapper superuser +
-    100000    4    udp       0.0.0.0.0.111          portmapper superuser +
-    100000    3    udp       0.0.0.0.0.111          portmapper superuser +
-    100000    2    udp       0.0.0.0.0.111          portmapper superuser +
-    100000    4    local     /var/run/rpcbind.sock  portmapper superuser +
-    100000    3    local     /var/run/rpcbind.sock  portmapper superuser +
-    100024    1    udp       0.0.0.0.231.232        status     29 +
-    100024    1    tcp       0.0.0.0.176.90         status     29 +
-    100024    1    udp6      ::.168.173             status     29 +
-    100024    1    tcp6      ::.234.102             status     29 +
-    100005    1    udp       0.0.0.0.78.80          mountd     superuser +
-    100005    1    tcp       0.0.0.0.78.80          mountd     superuser +
-    100005    1    udp6      ::.78.80               mountd     superuser +
-    100005    1    tcp6      ::.78.80               mountd     superuser +
-    100005    2    udp       0.0.0.0.78.80          mountd     superuser +
-    100005    2    tcp       0.0.0.0.78.80          mountd     superuser +
-    100005    2    udp6      ::.78.80               mountd     superuser +
-    100005    2    tcp6      ::.78.80               mountd     superuser +
-    100005    3    udp       0.0.0.0.78.80          mountd     superuser +
-    100005    3    tcp       0.0.0.0.78.80          mountd     superuser +
-    100005    3    udp6      ::.78.80               mountd     superuser +
-    100005    3    tcp6      ::.78.80               mountd     superuser +
-    100003    3    tcp       0.0.0.0.8.1            nfs        superuser +
-    100003    4    tcp       0.0.0.0.8.1            nfs        superuser +
-    100227    3    tcp       0.0.0.0.8.1            nfs_acl    superuser +
-    100003    3    udp       0.0.0.0.8.1            nfs        superuser +
-    100003    4    udp       0.0.0.0.8.1            nfs        superuser +
-    100227    3    udp       0.0.0.0.8.1            nfs_acl    superuser +
-    100003    3    tcp6      ::.8.1                 nfs        superuser +
-    100003    4    tcp6      ::.8.1                 nfs        superuser +
-    100227    3    tcp6      ::.8.1                 nfs_acl    superuser +
-    100003    3    udp6      ::.8.1                 nfs        superuser +
-    100003    4    udp6      ::.8.1                 nfs        superuser +
-    100227    3    udp6      ::.8.1                 nfs_acl    superuser +
-    100021    1    udp       0.0.0.0.193.97         nlockmgr   superuser +
-    100021    3    udp       0.0.0.0.193.97         nlockmgr   superuser +
-    100021    4    udp       0.0.0.0.193.97         nlockmgr   superuser +
-    100021    1    tcp       0.0.0.0.132.11         nlockmgr   superuser +
-    100021    3    tcp       0.0.0.0.132.11         nlockmgr   superuser +
-    100021    4    tcp       0.0.0.0.132.11         nlockmgr   superuser +
-    100021    1    udp6      ::.151.89              nlockmgr   superuser +
-    100021    3    udp6      ::.151.89              nlockmgr   superuser +
-    100021    4    udp6      ::.151.89              nlockmgr   superuser +
-    100021    1    tcp6      ::.234.241             nlockmgr   superuser +
-    100021    3    tcp6      ::.234.241             nlockmgr   superuser +
-    100021    4    tcp6      ::.234.241             nlockmgr   superuser +
-</code> +
- +
-====La Commande nfsstat==== +
- +
-La Commande **nfsstat** permet de vérifier l'activité sur le serveur NFS : +
- +
-<code> +
-[root@centos6 ~]# nfsstat +
-Server rpc stats: +
-calls      badcalls   badauth    badclnt    xdrcall +
-50                  0          0          0        +
- +
-Server nfs v4: +
-null         compound      +
-2         4% 48       96%  +
- +
-Server nfs v4 operations: +
-op0-unused   op1-unused   op2-future   access       close        commit        +
-0         0% 0         0% 0         0% 5         4% 0         0% 0         0%  +
-create       delegpurge   delegreturn  getattr      getfh        link          +
-0         0% 0         0% 0         0% 45       41% 5         4% 0         0%  +
-lock         lockt        locku        lookup       lookup_root  nverify       +
-0         0% 0         0% 0         0% 3         2% 0         0% 0         0%  +
-open         openattr     open_conf    open_dgrd    putfh        putpubfh      +
-0         0% 0         0% 0         0% 0         0% 46       42% 0         0%  +
-putrootfh    read         readdir      readlink     remove       rename        +
-2         1% 0         0% 3         2% 0         0% 0         0% 0         0%  +
-renew        restorefh    savefh       secinfo      setattr      setcltid      +
-0         0% 0         0% 0         0% 0         0% 0         0% 0         0%  +
-setcltidconf verify       write        rellockowner bc_ctl       bind_conn     +
-0         0% 0         0% 0         0% 0         0% 0         0% 0         0%  +
-exchange_id  create_ses   destroy_ses  free_stateid getdirdeleg  getdevinfo    +
-0         0% 0         0% 0         0% 0         0% 0         0% 0         0%  +
-getdevlist   layoutcommit layoutget    layoutreturn secinfononam sequence      +
-0         0% 0         0% 0         0% 0         0% 0         0% 0         0%  +
-set_ssv      test_stateid want_deleg   destroy_clid reclaim_comp  +
-0         0% 0         0% 0         0% 0         0% 0         0%  +
-</code> +
- +
-<code> +
-[root@centos7 ~]# nfsstat +
-Server rpc stats: +
-calls      badcalls   badclnt    badauth    xdrcall +
-34                  0          0          0        +
- +
-Server nfs v4: +
-null         compound      +
-1         2% 33       97%  +
- +
-Server nfs v4 operations: +
-op0-unused   op1-unused   op2-future   access       close        commit        +
-0         0% 0         0% 0         0% 5         7% 0         0% 0         0%  +
-create       delegpurge   delegreturn  getattr      getfh        link          +
-0         0% 0         0% 0         0% 22       31% 4         5% 0         0%  +
-lock         lockt        locku        lookup       lookup_root  nverify       +
-0         0% 0         0% 0         0% 5         7% 0         0% 0         0%  +
-open         openattr     open_conf    open_dgrd    putfh        putpubfh      +
-0         0% 0         0% 0         0% 0         0% 23       33% 0         0%  +
-putrootfh    read         readdir      readlink     remove       rename        +
-1         1% 0         0% 0         0% 0         0% 0         0% 0         0%  +
-renew        restorefh    savefh       secinfo      setattr      setcltid      +
-5         7% 0         0% 0         0% 0         0% 0         0% 2         2%  +
-setcltidconf verify       write        rellockowner bc_ctl       bind_conn     +
-2         2% 0         0% 0         0% 0         0% 0         0% 0         0%  +
-exchange_id  create_ses   destroy_ses  free_stateid getdirdeleg  getdevinfo    +
-0         0% 0         0% 0         0% 0         0% 0         0% 0         0%  +
-getdevlist   layoutcommit layoutget    layoutreturn secinfononam sequence      +
-0         0% 0         0% 0         0% 0         0% 0         0% 0         0%  +
-set_ssv      test_stateid want_deleg   destroy_clid reclaim_comp  +
-0         0% 0         0% 0         0% 0         0% 0         0%  +
-</code>+
  
 ----- -----
-<html> +Copyright © 2022 Hugh Norris - Non-contractual document. The Training Program may be modified without notice.
-<div align="center"> +
-Copyright © 2020 Hugh Norris +
-</div> +
-</html> +
------ +
Menu