Différences

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

Lien vers cette vue comparative

Les deux révisions précédentesRévision précédente
Prochaine révision
Révision précédente
elearning:workbooks:centos:8:avance:l103 [2021/08/23 10:17] adminelearning:workbooks:centos:8:avance:l103 [2022/03/09 18:44] (Version actuelle) admin
Ligne 1: Ligne 1:
 ~~PDF:LANDSCAPE~~ ~~PDF:LANDSCAPE~~
 +
 +Version : **2022.01**
  
 Dernière mise-à-jour : ~~LASTMOD~~ Dernière mise-à-jour : ~~LASTMOD~~
  
-======LCF603 - Gestion du Noyau et des Quotas======+======LCF603 - Gestion du Réseau======
  
 =====Contenu du Module===== =====Contenu du Module=====
  
-  * **LCF603 - Gestion du Noyau et des Quotas**+  * **LCF603 - Gestion du Réseau**
     * Contenu du Module     * Contenu du Module
-    * Rôle du noyau +    * Présentation 
-    * LAB #1 - Modules +      * La Commande nmcli 
-    LAB #2 Compilation et installation du noyau et des modules +    * LAB #1 - Configuration du Réseau 
-      * 2.1 - Déplacer /home +      1.1 Connections et Profils 
-      * 2.Préparer l'Environnement +      * 1.- Résolution des Noms  
-      * 2.Préparer l'Arborescence Source du Noyau +      * 1.3 - Ajouter une Deuxième Adresse IP à un Profil 
-        Le Fichier .config +      * 1.4 La Commande hostname 
-        * Le Fichier Makefile +      * 1.La Commande ip 
-      * 2.Paramétrage du noyau +      * 1.Activer/Désactiver une Interface Manuellement 
-      * 2.Compiler le Noyau +      1.7 - Routage Statique 
-      * 2.Installer le Nouveau Noyau +        * La commande ip 
-    * LAB #3 - Gestion des Quotas +        * Activer/désactiver le routage sur le serveur 
-      * 3.1 - La Commande quotacheck +    * LAB #2 - Diagnostique du Réseau 
-      * 3.2 - La Commande edquota +      * 2.ping 
-      * 3.3 - La Commande quotaon +      * 2.netstat -i 
-      * 3.4 - La Commande repquota +      * 2.traceroute 
-      * 3.5 - La Commande quota +    * LAB #3 - Connexions à Distance 
-      * 3.6 - La Commande warnquota+      * 3.1 - Telnet 
 +      * 3.2 - wget 
 +      * 3.3 - ftp 
 +      * 3.4 - SSH 
 +        * Présentation 
 +          * SSH-1 
 +          * SSH-2 
 +        * Authentification par mot de passe 
 +        * Authentification par clef asymétrique 
 +        * Configuration du Serveur 
 +        * Configuration du Client 
 +        * Tunnels SSH 
 +      * 3.5 - SCP 
 +        * Présentation 
 +        * Utilisation 
 +      * 3.6 - Mise en Place des Clefs Asymétriques
  
-=====Rôle du noyau=====+=====Présentation=====
  
-Le noyau ou //kernel// est la partie du système d'exploitation qui gère les entrées/sorties avec des périphériquesDans certains cas il est préférable de recompiler le noyau de Linux. La motivation de cette recompilation peut être :+RHEL/CentOS 8 utilise **Network Manager** pour gérer le réseauNetwork Manager est composé de deux éléments :
  
-  * la diminution de la taille du noyau+  * un service qui gère les connexions réseaux et rapporte leurs états
-  * la prise en charge de nouveau matériel, +  * des front-ends qui passent par un API de configuration du service.
-  * l'ajout de fonctionnalités, +
-  * l'optimisation du code, +
-  * la correction de bogues, +
-  * le besoin d'une fonctionnalité expérimentale. +
-   +
-Commencez par mettre à jour CentOS 8 :+
  
-<code+<WRAP center round important 60%
-[root@centos8 ~]# dnf update +**Important** : Notez qu'avec cette version de NetworkManager, IPv6 est activée par défaut
-... +</WRAP>
-[root@centos8 ~]# reboot +
-</code>+
  
-Identifiez ensuite le noyau utilisé par votre machine virtuelle :+Le service NetworkManager doit toujours être lancé :
  
 <code> <code>
-[root@centos8 ~]# uname -r +[root@centos8 ~]# systemctl status NetworkManager.service 
-4.18.0-305.7.1.el8_4.x86_64+● NetworkManager.service Network Manager 
 +   Loaded: loaded (/usr/lib/systemd/system/NetworkManager.service; enabled; vendor pr> 
 +   Active: active (running) since Thu 2021-07-22 05:05:29 EDT; 1 months days ago 
 +     Docs: man:NetworkManager(8) 
 + Main PID: 1002 (NetworkManager) 
 +    Tasks: 3 (limit: 23535) 
 +   Memory: 6.8M 
 +   CGroup: /system.slice/NetworkManager.service 
 +           └─1002 /usr/sbin/NetworkManager --no-daemon 
 + 
 +Warning: Journal has been rotated since unit was started. Log output is incomplete or> 
 +lines 1-11/11 (END) 
 +[^q]
 </code> </code>
  
-=====LAB #1 - Modules=====+===La Commande nmcli===
  
-Dans le cas d'une utilisation courante de Linux, il est cependant préférable de faire appel aux **modules**. Les modules se trouvent dans le répertoire **/lib/modules/<version-du-noyau>** :+La commande **nmcli** (Network Manager Command Line Interface) est utilisée pour configurer NetworkManager. 
 + 
 +Les options et les sous-commandes peuvent être consultées en utilisant les commandes suivantes :
  
 <code> <code>
-[root@centos8 ~]# ls /lib/modules/`uname -r`/ +[root@centos8 ~]# nmcli help 
-bls.conf           modules.builtin      modules.networking   System.map +Usage: nmcli [OPTIONS] OBJECT { COMMAND | help } 
-build              modules.builtin.bin  modules.order        updates + 
-config             modules.dep          modules.softdep      vdso +OPTIONS 
-kernel             modules.dep.bin      modules.symbols      vmlinuz +  -a, --ask                                ask for missing parameters 
-modules.alias      modules.devname      modules.symbols.bin  weak-updates +  -c, --colors auto|yes|no                 whether to use colors in output 
-modules.alias.bin  modules.drm          source +  -e, --escape yes|no                      escape columns separators in values 
-modules.block      modules.modesetting  symvers.gz+  -f, --fields <field,...>|all|common      specify fields to output 
 +  -g, --get-values <field,...>|all|common  shortcut for -m tabular -t -f 
 +  -h, --help                               print this help 
 +  -m, --mode tabular|multiline             output mode 
 +  -o, --overview                           overview mode 
 +  -p, --pretty                             pretty output 
 +  -s, --show-secrets                       allow displaying passwords 
 +  -t, --terse                              terse output 
 +  -v, --version                            show program version 
 +  -w, --wait <seconds>                     set timeout waiting for finishing operations 
 + 
 +OBJECT 
 +  g[eneral]       NetworkManager's general status and operations 
 +  n[etworking]    overall networking control 
 +  r[adio]         NetworkManager radio switches 
 +  c[onnection]    NetworkManager's connections 
 +  d[evice]        devices managed by NetworkManager 
 +  a[gent]         NetworkManager secret agent or polkit agent 
 +  m[onitor]       monitor NetworkManager changes
 </code> </code>
  
-Les commandes pour manipuler les modules sont :+=====LAB #1 - Configuration du Réseau=====
  
-  * insmod +====1.1 - Connections et Profils====
-  * rmmod +
-  * lsmod +
-  * modprobe+
  
-Par exemple :+NetworkManager inclus la notion de **connections** ou **profils** permettant des configurations différentes en fonction de la localisation. Pour voir les connections actuelles, utilisez la commande **nmcli c** avec la sous-commande **show** :
  
 <code> <code>
-[root@centos8 ~]# lsmod +[root@centos8 ~]# nmcli c show 
-Module                  Size  Used by +NAME    UUID                                  TYPE      DEVICE  
-xt_CHECKSUM            16384  1 +ens18   fc4a4d23-b15e-47a7-bcfa-b2e08f49553e  ethernet  ens18   
-ipt_MASQUERADE         16384 +virbr0  03f6c432-2a09-47e7-9693-208431a572ee  bridge    virbr0 
-xt_conntrack           16384 +
-ipt_REJECT             16384 +
-nft_compat             20480  16 +
-nf_nat_tftp            16384  0 +
-nft_objref             16384 +
-nf_conntrack_tftp      16384  3 nf_nat_tftp +
-nft_counter            16384  33 +
-tun                    53248  +
-bridge                192512  0 +
-stp                    16384  1 bridge +
-llc                    16384  bridge,stp +
-nft_fib_inet           16384 +
-nft_fib_ipv4           16384  1 nft_fib_inet +
-nft_fib_ipv6           16384  1 nft_fib_inet +
-nft_fib                16384  3 nft_fib_ipv6,nft_fib_ipv4,nft_fib_inet +
-nft_reject_inet        16384  5 +
-nf_reject_ipv4         16384  2 nft_reject_inet,ipt_REJECT +
-nf_reject_ipv6         16384  1 nft_reject_inet +
-nft_reject             16384  1 nft_reject_inet +
-nft_ct                 20480  19 +
-nf_tables_set          49152  21 +
-nft_chain_nat          16384  12 +
-nf_nat                 45056  3 ipt_MASQUERADE,nf_nat_tftp,nft_chain_nat +
-nf_conntrack          172032  6 xt_conntrack,nf_nat,nf_conntrack_tftp,nft_ct,ipt_MASQUERADE,nf_nat_tftp +
-nf_defrag_ipv6         20480  1 nf_conntrack +
-nf_defrag_ipv4         16384  1 nf_conntrack +
-ip_set                 49152 +
-nf_tables             172032  414 nft_ct,nft_compat,nft_reject_inet,nft_fib_ipv6,nft_objref,nft_fib_ipv4,nft_counter,nft_chain_nat,nf_tables_set,nft_reject,nft_fib,nft_fib_inet +
-nfnetlink              16384  4 nft_compat,nf_tables,ip_set +
-sunrpc                540672 +
-ext4                  761856 +
-mbcache                16384  1 ext4 +
-jbd2                  131072  1 ext4 +
-virtio_balloon         20480 +
-pcspkr                 16384 +
-i2c_piix4              24576  0 +
-joydev                 24576 +
-ip_tables              28672  0 +
-xfs                  1515520 +
-libcrc32c              16384  4 nf_conntrack,nf_nat,nf_tables,xfs +
-sr_mod                 28672 +
-sd_mod                 53248 +
-cdrom                  65536  1 sr_mod +
-t10_pi                 16384  1 sd_mod +
-sg                     40960 +
-ata_generic            16384  0 +
-bochs_drm              16384  1 +
-drm_vram_helper        28672  1 bochs_drm +
-drm_kms_helper        233472  4 drm_vram_helper,bochs_drm +
-syscopyarea            16384  1 drm_kms_helper +
-sysfillrect            16384  1 drm_kms_helper +
-sysimgblt              16384  1 drm_kms_helper +
-fb_sys_fops            16384  1 drm_kms_helper +
-drm_ttm_helper         16384  1 drm_vram_helper +
-ttm                   114688  2 drm_vram_helper,drm_ttm_helper +
-drm                   569344  7 drm_kms_helper,drm_vram_helper,bochs_drm,drm_ttm_helper,ttm +
-ahci                   40960 +
-libahci                40960  1 ahci +
-virtio_net             53248 +
-net_failover           24576  1 virtio_net +
-ata_piix               36864 +
-serio_raw              16384  0 +
-failover               16384  1 net_failover +
-libata                270336  4 ata_piix,libahci,ahci,ata_generic +
-dm_mirror              28672  0 +
-dm_region_hash         20480  1 dm_mirror +
-dm_log                 20480  2 dm_region_hash,dm_mirror +
-dm_mod                151552  8 dm_log,dm_mirror +
-fuse                  151552  3+
 </code> </code>
  
-Pour ajouter un module, on peut utiliser la commande **insmod** ou **modprobe**. Cette dernière ajoute non seulement le module passé en argument mais également ses dépendances :+Créez donc un profil IP fixe rattaché au périphérique **ens18** :
  
 <code> <code>
-[root@centos8 ~]# modprobe bonding +[root@centos8 ~]# nmcli connection add con-name ip_fixe ifname ens18 type ethernet ip4 10.0.2.46/24 gw4 10.0.2.
-[root@centos8 ~]# lsmod | more +Connection 'ip_fixe' (0f48c74d-5d16-4c37-8220-24644507b589) successfully added.
-Module                  Size  Used by +
-bonding               196608  0 +
-xt_CHECKSUM            16384  1 +
-ipt_MASQUERADE         16384 +
-xt_conntrack           16384 +
-ipt_REJECT             16384  2 +
-nft_compat             20480  16 +
-nf_nat_tftp            16384  0 +
-nft_objref             16384 +
-nf_conntrack_tftp      16384  3 nf_nat_tftp +
-nft_counter            16384  33 +
-tun                    53248  1 +
-bridge                192512 +
-stp                    16384  1 bridge +
-llc                    16384  bridge,stp +
-nft_fib_inet           16384 +
-nft_fib_ipv4           16384  1 nft_fib_inet +
-nft_fib_ipv6           16384  1 nft_fib_inet +
-nft_fib                16384  3 nft_fib_ipv6,nft_fib_ipv4,nft_fib_inet +
-nft_reject_inet        16384  5 +
-nf_reject_ipv4         16384  2 nft_reject_inet,ipt_REJECT +
-nf_reject_ipv6         16384  nft_reject_inet +
---More--+
 </code> </code>
  
-Pour supprimer un module, on peut utiliser la commande **rmmod** ou **modprobe -r**. Cette dernière essaie de supprimer les dépendances non-utilisées :+Constatez sa présence :
  
 <code> <code>
-[root@centos8 ~]# modprobe -r bonding +[root@centos8 ~]# nmcli c show 
-[root@centos8 ~]# lsmod | more +NAME     UUID                                  TYPE      DEVICE  
-Module                  Size  Used by +ens18    fc4a4d23-b15e-47a7-bcfa-b2e08f49553e  ethernet  ens18   
-xt_CHECKSUM            16384  1 +virbr0   03f6c432-2a09-47e7-9693-208431a572ee  bridge    virbr0  
-ipt_MASQUERADE         16384 +ip_fixe  0f48c74d-5d16-4c37-8220-24644507b589  ethernet  --   
-xt_conntrack           16384 +
-ipt_REJECT             16384 +
-nft_compat             20480  16 +
-nf_nat_tftp            16384  0 +
-nft_objref             16384 +
-nf_conntrack_tftp      16384  3 nf_nat_tftp +
-nft_counter            16384  33 +
-tun                    53248  +
-bridge                192512  0 +
-stp                    16384  bridge +
-llc                    16384  2 bridge,stp +
-nft_fib_inet           16384  +
-nft_fib_ipv4           16384  1 nft_fib_inet +
-nft_fib_ipv6           16384  1 nft_fib_inet +
-nft_fib                16384  3 nft_fib_ipv6,nft_fib_ipv4,nft_fib_inet +
-nft_reject_inet        16384  5 +
-nf_reject_ipv4         16384  2 nft_reject_inet,ipt_REJECT +
-nf_reject_ipv6         16384  1 nft_reject_inet +
-nft_reject             16384  1 nft_reject_inet +
---More--+
 </code> </code>
  
-Les dépendances des modules sont résolues par la commande **modprobe** grâce aux fichier **/lib/modules/<version-du-noyau>/modules.dep**. Ce dernier peut être créé manuellement grâce à la commande **depmod** :+Notez que la sortie n'indique pas que le profil **ip_fixe** soit associé au periphérique **ens18** car le profil **ip_fixe** n'est pas activé :
  
 <code> <code>
-[root@centos8 ~]# more /lib/modules/`uname -r`/modules.dep +[root@centos8 ~]# nmcli d show 
-kernel/arch/x86/events/amd/power.ko.xz+GENERAL.DEVICE:                         ens18 
-kernel/arch/x86/events/intel/intel-uncore.ko.xz+GENERAL.TYPE                          ethernet 
-kernel/arch/x86/events/intel/intel-cstate.ko.xz+GENERAL.HWADDR:                         4E:B1:31:BD:5D:B2 
-kernel/arch/x86/events/rapl.ko.xz+GENERAL.MTU                           1500 
-kernel/arch/x86/kernel/cpu/mce/mce-inject.ko.xz+GENERAL.STATE                         100 (connected) 
-kernel/arch/x86/crypto/des3_ede-x86_64.ko.xzkernel/crypto/des_generic.ko.xz +GENERAL.CONNECTION                    ens18 
-kernel/arch/x86/crypto/camellia-x86_64.ko.xz+GENERAL.CON-PATH                      /org/freedesktop/NetworkManager/ActiveConnect> 
-kernel/arch/x86/crypto/blowfish-x86_64.ko.xzkernel/crypto/blowfish_common.ko.xz +WIRED-PROPERTIES.CARRIER              on 
-kernel/arch/x86/crypto/twofish-x86_64.ko.xz: kernel/crypto/twofish_common.ko.xz +IP4.ADDRESS[1]                        10.0.2.45/24 
-kernel/arch/x86/crypto/twofish-x86_64-3way.ko.xzkernel/arch/x86/crypto/twofish-x86_64.ko. +IP4.GATEWAY                           10.0.2.1 
-xz kernel/crypto/twofish_common.ko.xz +IP4.ROUTE[1]                          dst = 10.0.2.0/24, nh = 0.0.0.0, mt = 100 
-kernel/arch/x86/crypto/chacha20-x86_64.ko.xzkernel/crypto/chacha20_generic.ko.xz +IP4.ROUTE[2]                          dst = 0.0.0.0/0, nh = 10.0.2.1, mt = 100 
-kernel/arch/x86/crypto/serpent-sse2-x86_64.ko.xz: kernel/crypto/serpent_generic.ko.xz +IP4.DNS[1]                            8.8.8.8 
-kernel/arch/x86/crypto/ghash-clmulni-intel.ko.xz: +IP6.ADDRESS[1]:                         fe80::86b6:8d39:cab2:d84d/64 
-kernel/arch/x86/crypto/crc32c-intel.ko.xz: +IP6.GATEWAY:                            -- 
-kernel/arch/x86/crypto/crc32-pclmul.ko.xz: +IP6.ROUTE[1]:                           dst = fe80::/64, nh = ::, mt = 100 
-kernel/arch/x86/crypto/sha512-ssse3.ko.xz: kernel/crypto/sha512_generic.ko.xz +IP6.ROUTE[2]:                           dst = ff00::/8, nh = ::, mt = 256, table=255
-kernel/arch/x86/crypto/crct10dif-pclmul.ko.xz: +
-kernel/arch/x86/crypto/poly1305-x86_64.ko.xz: kernel/crypto/poly1305_generic.ko.xz +
-kernel/arch/x86/crypto/camellia-aesni-avx-x86_64.ko.xzkernel/arch/x86/crypto/camellia-x86 +
-_64.ko.xz +
-kernel/arch/x86/crypto/cast5-avx-x86_64.ko.xzkernel/crypto/cast5_generic.ko.xz kernel/cry +
---More--(0%) +
-</code>+
  
-Il est possible d'obtenir des informations sur un module grâce à la commande **modinfo** :+GENERAL.DEVICE                        virbr0 
 +GENERAL.TYPE:                           bridge 
 +GENERAL.HWADDR:                         52:54:00:79:02:66 
 +GENERAL.MTU:                            1500 
 +GENERAL.STATE:                          100 (connected (externally)) 
 +GENERAL.CONNECTION:                     virbr0 
 +GENERAL.CON-PATH:                       /org/freedesktop/NetworkManager/ActiveConnect> 
 +IP4.ADDRESS[1]:                         192.168.122.1/24 
 +IP4.GATEWAY:                            -- 
 +IP4.ROUTE[1]:                           dst = 192.168.122.0/24, nh = 0.0.0.0, mt = 0 
 +IP6.GATEWAY:                            --
  
-<code> +GENERAL.DEVICE                        lo 
-[root@centos8 ~]# modinfo bonding +GENERAL.TYPE                          loopback 
-filename:       /lib/modules/4.18.0-305.7.1.el8_4.x86_64/kernel/drivers/net/bonding/bonding.ko.xz +GENERAL.HWADDR                        00:00:00:00:00:00 
-author        Thomas Davis, tadavis@lbl.gov and many others +GENERAL.MTU                           65536 
-description:    Ethernet Channel Bonding Driver +GENERAL.STATE                         10 (unmanaged
-license:        GPL +GENERAL.CONNECTION                    -- 
-alias:          rtnl-link-bond +GENERAL.CON-PATH                      -- 
-rhelversion:    8.+IP4.ADDRESS[1]                        127.0.0.1/8 
-srcversion    445F4CC9A2F7E64E3A87FD0 +IP4.GATEWAY                           -- 
-depends:         +IP6.ADDRESS[1]                        ::1/128 
-intree:         Y +IP6.GATEWAY                           -- 
-name:           bonding +IP6.ROUTE[1]                          dst = ::1/128nh = ::, mt = 256 
-vermagic:       4.18.0-305.7.1.el8_4.x86_64 SMP mod_unload modversions  + 
-sig_id        PKCS#7 +GENERAL.DEVICE                        virbr0-nic 
-signer        CentOS kernel signing key +GENERAL.TYPE                          tun 
-sig_key       3B:5A:0A:B8:8E:4A:51:C0:AA:FF:97:FD:CB:94:D6:B6:D2:46:B8:17 +GENERAL.HWADDR                        52:54:00:79:02:66 
-sig_hashalgo:   sha256 +GENERAL.MTU                           1500 
-signature:      B2:3A:20:BE:2B:F3:E0:5A:1A:74:0E:69:76:40:2A:D4:80:10:2C:5A: +GENERAL.STATE                         10 (unmanaged
-                B7:F1:1E:7A:71:13:29:F0:0A:4A:28:EE:81:33:C8:C2:5C:BD:FF:E4: +GENERAL.CONNECTION                    -
-                3F:A9:15:A3:9A:0E:A7:98:9E:99:06:23:10:47:D3:B2:48:B3:F1:61: +GENERAL.CON-PATH                      -- 
-                BE:4B:B0:FC:62:B9:3B:D6:64:CC:E3:29:01:4D:91:92:32:FD:EB:54: +lines 28-50/50 (END
-                44:F1:2C:1B:23:30:F1:3E:EE:69:EA:94:54:D9:A0:8D:16:53:F5:20: +[q]
-                DE:38:A0:13:E8:2F:89:66:CB:11:D7:AA:30:37:7B:EC:DF:A1:69:29: +
-                7F:4E:80:4D:34:6E:F2:07:01:FA:18:23:94:58:10:C6:97:27:68:B9: +
-                D8:08:5E:9D:00:17:F4:1B:48:BE:CA:BF:5C:5A:A8:6D:36:EE:3F:95: +
-                BA:BE:59:82:EE:7B:CA:BB:32:1E:E3:05:ED:C9:C2:C8:10:64:B9:29: +
-                B8:09:4B:79:42:65:1A:FA:99:96:BA:7E:2D:6E:75:F1:91:0E:F4:9A: +
-                8F:11:10:9F:70:BD:35:06:BE:F0:4C:D8:AB:D5:C4:E1:B3:A2:2A:CA: +
-                58:CA:9E:16:1D:0C:BE:9C:37:A1:82:20:6F:24:CD:23:63:F7:F5:BC: +
-                6E:81:14:F0:52:DA:04:0E:9D:CC:17:60:2D:B0:D8:BD:6E:2C:AD:E7: +
-                50:48:49:B6:57:96:AC:FD:A4:29:33:01:43:92:32:88:A2:AC:CB:93: +
-                2F:C3:29:F3:01:77:84:00:AB:AA:C8:59:43:F1:DA:90:7B:5F:9A:A9: +
-                CA:60:97:34:85:5E:98:56:73:03:0D:D7:8D:A6:AB:51:D4:8C:92:91+
-                0C:0A:BA:6B:92:01:16:FE:8B:86:80:11:5F:8E:21:BD:C2:2F:02:58: +
-                A6:CF:6C:E3:87:28:8B:4D:CE:54:8C:00:B3:F7:AE:9E:01:81:1E:83: +
-                AE:6D:58:B0:10:98:36:D9:69:76:E2:C0:E2:15:94:3B:D4:14:19:D9: +
-                59:86:75:31 +
-parm:           max_bonds:Max number of bonded devices (int+
-parm          tx_queues:Max number of transmit queues (default = 16) (int) +
-parm          num_grat_arp:Number of peer notifications to send on failover event (alias of num_unsol_na) (int) +
-parm:           num_unsol_na:Number of peer notifications to send on failover event (alias of num_grat_arp) (int) +
-parm          miimon:Link check interval in milliseconds (int) +
-parm          updelay:Delay before considering link up, in milliseconds (int) +
-parm          downdelay:Delay before considering link down, in milliseconds (int) +
-parm:           use_carrier:Use netif_carrier_ok (vs MII ioctls) in miimon; 0 for off, for on (default) (int) +
-parm          mode:Mode of operation; 0 for balance-rr, 1 for active-backup, 2 for balance-xor, 3 for broadcast, 4 for 802.3ad, 5 for balance-tlb, 6 for balance-alb (charp) +
-parm          primary:Primary network device to use (charp) +
-parm          primary_reselect:Reselect primary slave once it comes up; 0 for always (default), for only if speed of primary is better2 for only on active slave failure (charp) +
-parm          lacp_rate:LACPDU tx rate to request from 802.3ad partner; 0 for slow1 for fast (charp) +
-parm          ad_select:802.3ad aggregation selection logic; 0 for stable (default), 1 for bandwidth, 2 for count (charp) +
-parm          min_links:Minimum number of available links before turning on carrier (int) +
-parm          xmit_hash_policy:balance-alb, balance-tlb, balance-xor, 802.3ad hashing method; 0 for layer 2 (default), 1 for layer 3+4, 2 for layer 2+3, 3 for encap layer 2+3, 4 for encap layer 3+4, 5 for vlan+srcmac (charp) +
-parm          arp_interval:arp interval in milliseconds (int) +
-parm:           arp_ip_target:arp targets in n.n.n.n form (array of charp) +
-parm          arp_validate:validate src/dst of ARP probes; 0 for none (default), 1 for active, 2 for backup, 3 for all (charp) +
-parm          arp_all_targets:fail on any/all arp targets timeout; 0 for any (default), 1 for all (charp+
-parm:           fail_over_mac:For active-backup, do not set all slaves to the same MAC; 0 for none (default), 1 for active, 2 for follow (charp) +
-parm:           all_slaves_active:Keep all frames received on an interface by setting active flag for all slaves; 0 for never (default), 1 for always(int) +
-parm          resend_igmp:Number of IGMP membership reports to send on link failure (int) +
-parm:           packets_per_slave:Packets to send per slave in balance-rr mode; 0 for a random slave, 1 packet per slave (default), >1 packets per slave. (int+
-parm:           lp_interval:The number of seconds between instances where the bonding driver sends learning packets to each slaves peer switch. The default is 1. (uint)+
 </code> </code>
  
-Dernièrement, les fichiers dans le repertoire **/etc/modprobe.d** sont utilisés pour spécifier les options éventuelles à passer aux modules lors de leur chargement ainsi que les alias utilisés pour leur faire référence :+Pour activer le profil ip_fixe, utilisez la commande suivante :
  
 <code> <code>
-[root@centos8 ~]# ls /etc/modprobe.d +[root@centos8 ~]# nmcli connection up ip_fixe
-firewalld-sysctls.conf  lockd.conf  nvdimm-security.conf  tuned.conf +
-kvm.conf                mlx4.conf   truescale.conf        vhost.conf+
  
-[root@centos8 ~]# cat /etc/modprobe.d/kvm.conf  
-# Setting modprobe kvm_intel/kvm_amd nested = 1 
-# only enables Nested Virtualization until the next reboot or 
-# module reload. Uncomment the option applicable 
-# to your system below to enable the feature permanently. 
-# 
-# User changes in this file are preserved across upgrades. 
-# 
-# For Intel 
-#options kvm_intel nested=1 
-# 
-# For AMD 
-#options kvm_amd nested=1 
 </code> </code>
  
-=====LAB #2 - Compilation et installation du noyau et des modules=====+Notez que votre terminal est bloqué à cause du changement de l'adresse IP. 
  
-Activez le dépôt **CentOS-Linux-PowerTools** en passant la directive **enabled** à **1** :+<WRAP center round todo 60%> 
 +**A faire** - Revenez à l'accueil du cloud IT Training et re-connectez-vous à la VM en tant que trainee en utilisant la connexion **CentOS8_SSH_10.0.2.46**
 +</WRAP> 
 + 
 +Le profil ip_fixe est maintenant activé tandis que le profil enp0s3 a été désactivé :
  
 <code> <code>
-[root@centos8 ~]# vi /etc/yum.repos.d/CentOS-Linux-PowerTools.repo  +[root@centos8 ~]# nmcli c show 
-[root@centos8 ~]# cat /etc/yum.repos.d/CentOS-Linux-PowerTools.repo  +NAME     UUID                                  TYPE      DEVICE  
-# CentOS-Linux-PowerTools.repo +ip_fixe  0f48c74d-5d16-4c37-8220-24644507b589  ethernet  ens18   
-# +virbr0   03f6c432-2a09-47e7-9693-208431a572ee  bridge    virbr0  
-# The mirrorlist system uses the connecting IP address of the client and the +ens18    fc4a4d23-b15e-47a7-bcfa-b2e08f49553e  ethernet  --   
-# update status of each mirror to pick current mirrors that are geographically +    
-# close to the client You should use this for CentOS updates unless you are +[root@centos8 ~]# nmcli d show 
-# manually picking other mirrors+GENERAL.DEVICE:                         ens18 
-# +GENERAL.TYPE:                           ethernet 
-# If the mirrorlist does not work for you, you can try the commented out +GENERAL.HWADDR:                         4E:B1:31:BD:5D:B2 
-# baseurl line instead.+GENERAL.MTU:                            1500 
 +GENERAL.STATE:                          100 (connected) 
 +GENERAL.CONNECTION:                     ip_fixe 
 +GENERAL.CON-PATH:                       /org/freedesktop/NetworkManager/ActiveConnect> 
 +WIRED-PROPERTIES.CARRIER:               on 
 +IP4.ADDRESS[1]:                         10.0.2.46/24 
 +IP4.GATEWAY:                            10.0.2.1 
 +IP4.ROUTE[1]:                           dst = 10.0.2.0/24, nh = 0.0.0.0, mt = 100 
 +IP4.ROUTE[2]:                           dst = 0.0.0.0/0, nh = 10.0.2.1, mt = 100 
 +IP6.ADDRESS[1]:                         fe80::5223:aee1:998e:9f27/64 
 +IP6.GATEWAY:                            -- 
 +IP6.ROUTE[1]:                           dst = fe80::/64, nh = ::, mt = 100 
 +IP6.ROUTE[2]:                           dst = ff00::/8, nh = ::, mt = 256, table=255 
 + 
 +GENERAL.DEVICE:                         virbr0 
 +GENERAL.TYPE:                           bridge 
 +GENERAL.HWADDR:                         52:54:00:79:02:66 
 +GENERAL.MTU:                            1500 
 +GENERAL.STATE:                          100 (connected (externally)) 
 +GENERAL.CONNECTION:                     virbr0 
 +GENERAL.CON-PATH:                       /org/freedesktop/NetworkManager/ActiveConnect> 
 +IP4.ADDRESS[1]:                         192.168.122.1/24 
 +IP4.GATEWAY:                            -- 
 +IP4.ROUTE[1]:                           dst = 192.168.122.0/24, nh = 0.0.0.0, mt = 0 
 +IP6.GATEWAY:                            -- 
 + 
 +GENERAL.DEVICE:                         lo 
 +GENERAL.TYPE:                           loopback 
 +GENERAL.HWADDR:                         00:00:00:00:00:00 
 +GENERAL.MTU:                            65536 
 +GENERAL.STATE:                          10 (unmanaged) 
 +GENERAL.CONNECTION:                     -- 
 +GENERAL.CON-PATH:                       -- 
 +IP4.ADDRESS[1]:                         127.0.0.1/8 
 +IP4.GATEWAY:                            -- 
 +IP6.ADDRESS[1]:                         ::1/128 
 +IP6.GATEWAY:                            -- 
 +IP6.ROUTE[1]:                           dst = ::1/128, nh = ::, mt = 256
  
-[powertools] +GENERAL.DEVICE:                         virbr0-nic 
-name=CentOS Linux $releasever PowerTools +GENERAL.TYPE                          tun 
-mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=PowerTools&infra=$infra +GENERAL.HWADDR:                         52:54:00:79:02:66 
-#baseurl=http://mirror.centos.org/$contentdir/$releasever/PowerTools/$basearch/os/ +GENERAL.MTU                           1500 
-gpgcheck=1 +GENERAL.STATE:                          10 (unmanaged) 
-enabled=1 +GENERAL.CONNECTION                    -- 
-gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial+GENERAL.CON-PATH:                       -
 +lines 27-49/49 (END) 
 +[q]
 </code> </code>
  
-Installez maintenant les paquets necessaires :+Pour consulter les paramètres du profil **ens18**, utilisez la commande suivante :
  
 <code> <code>
-[root@centos8 ~]# dnf groupinstall "Development Tools" +[root@centos8 ~]# nmcli -p connection show ens18 
-... +=============================================================================== 
-[root@centos8 ~]# dnf install asciidoc audit-libs-devel bash bc binutils binutils-devel bison diffutils elfutils elfutils-devel elfutils-libelf-devel findutils flex gawk gcc gettext gzip hmaccalc hostname make module-init-tools ncurses-devel net-tools newt-devel numactl-devel openssl patch pciutils-devel perl perl-ExtUtils-Embed pesign redhat-rpm-config rpm-build rpmdevtools sh-utils tar xmlto xz zlib-devel +                      Connection profile details (ens18) 
-...+=============================================================================== 
 +connection.id:                          ens18 
 +connection.uuid:                        fc4a4d23-b15e-47a7-bcfa-b2e08f49553e 
 +connection.stable-id:                   -- 
 +connection.type:                        802-3-ethernet 
 +connection.interface-name:              ens18 
 +connection.autoconnect:                 yes 
 +connection.autoconnect-priority:        0 
 +connection.autoconnect-retries:         -1 (default) 
 +connection.multi-connect:               0 (default) 
 +connection.auth-retries:                -1 
 +connection.timestamp:                   1630224060 
 +connection.read-only:                   no 
 +connection.permissions:                 -- 
 +connection.zone:                        -- 
 +connection.master:                      -- 
 +connection.slave-type:                  -- 
 +connection.autoconnect-slaves:          -1 (default) 
 +connection.secondaries:                 -- 
 +connection.gateway-ping-timeout:        0 
 +connection.metered:                     unknown 
 +connection.lldp:                        default 
 +connection.mdns:                        -1 (default) 
 +connection.llmnr:                       -1 (default) 
 +connection.wait-device-timeout:         -1 
 +------------------------------------------------------------------------------- 
 +802-3-ethernet.port:                    -- 
 +802-3-ethernet.speed:                   0 
 +802-3-ethernet.duplex:                  -- 
 +802-3-ethernet.auto-negotiate:          no 
 +802-3-ethernet.mac-address:             -- 
 +802-3-ethernet.cloned-mac-address:      -- 
 +802-3-ethernet.generate-mac-address-mask:-- 
 +802-3-ethernet.mac-address-blacklist:   -- 
 +802-3-ethernet.mtu:                     auto 
 +802-3-ethernet.s390-subchannels:        -- 
 +802-3-ethernet.s390-nettype:            -- 
 +802-3-ethernet.s390-options:            -- 
 +802-3-ethernet.wake-on-lan:             default 
 +802-3-ethernet.wake-on-lan-password:    -- 
 +------------------------------------------------------------------------------- 
 +ipv4.method:                            manual 
 +ipv4.dns:                               8.8.8.8 
 +ipv4.dns-search:                        ittraining.loc 
 +ipv4.dns-options:                       -- 
 +ipv4.dns-priority:                      0 
 +ipv4.addresses:                         10.0.2.45/24 
 +ipv4.gateway:                           10.0.2.1 
 +ipv4.routes:                            -- 
 +ipv4.route-metric:                      -1 
 +ipv4.route-table:                       0 (unspec) 
 +ipv4.routing-rules:                     -- 
 +ipv4.ignore-auto-routes:                no 
 +ipv4.ignore-auto-dns:                   no 
 +ipv4.dhcp-client-id:                    -- 
 +ipv4.dhcp-iaid:                         -- 
 +ipv4.dhcp-timeout:                      0 (default) 
 +ipv4.dhcp-send-hostname:                yes 
 +ipv4.dhcp-hostname:                     -- 
 +ipv4.dhcp-fqdn:                         -- 
 +ipv4.dhcp-hostname-flags:               0x0 (none) 
 +ipv4.never-default:                     no 
 +ipv4.may-fail:                          yes 
 +ipv4.dad-timeout:                       -1 (default) 
 +ipv4.dhcp-vendor-class-identifier:      -- 
 +ipv4.dhcp-reject-servers:               -- 
 +------------------------------------------------------------------------------- 
 +ipv6.method:                            auto 
 +ipv6.dns:                               -- 
 +ipv6.dns-search:                        -- 
 +ipv6.dns-options:                       -- 
 +ipv6.dns-priority:                      0 
 +ipv6.addresses:                         -- 
 +ipv6.gateway:                           -- 
 +ipv6.routes:                            -- 
 +ipv6.route-metric:                      -1 
 +ipv6.route-table:                       0 (unspec) 
 +ipv6.routing-rules:                     -- 
 +ipv6.ignore-auto-routes:                no 
 +ipv6.ignore-auto-dns:                   no 
 +ipv6.never-default:                     no 
 +ipv6.may-fail:                          yes 
 +ipv6.ip6-privacy:                       0 (disabled) 
 +ipv6.addr-gen-mode:                     stable-privacy 
 +ipv6.ra-timeout:                        0 (default) 
 +ipv6.dhcp-duid:                         -- 
 +ipv6.dhcp-iaid:                         -- 
 +ipv6.dhcp-timeout:                      0 (default) 
 +ipv6.dhcp-send-hostname:                yes 
 +ipv6.dhcp-hostname:                     -- 
 +ipv6.dhcp-hostname-flags:               0x0 (none) 
 +ipv6.token:                             -- 
 +------------------------------------------------------------------------------- 
 +proxy.method:                           none 
 +proxy.browser-only:                     no 
 +proxy.pac-url:                          -- 
 +proxy.pac-script:                       -- 
 +------------------------------------------------------------------------------- 
 +lines 56-100/100 (END) 
 +[q]
 </code> </code>
  
-====2.1 - Déplacer /home====+De même, pour consulter les paramètres du profil **ip_fixe**, utilisez la commande suivante :
  
-<WRAP center round alert+<code
-**Important** - Il n'est pas conseillé de compiler en tant que root pour des raisons de sécuritéPour pouvoir utiliser le compte d'un utilisateur pour créer un nouveau noyau, celui-ci doit disposer de plus de 10 Go d'espace libre+[root@centos8 ~]# nmcli -p connection show ip_fixe 
-</WRAP>+=============================================================================== 
 +                     Connection profile details (ip_fixe) 
 +=============================================================================== 
 +connection.id:                          ip_fixe 
 +connection.uuid:                        0f48c74d-5d16-4c37-8220-24644507b589 
 +connection.stable-id:                   -- 
 +connection.type:                        802-3-ethernet 
 +connection.interface-name:              ens18 
 +connection.autoconnect:                 yes 
 +connection.autoconnect-priority:        0 
 +connection.autoconnect-retries:         -1 (default) 
 +connection.multi-connect:               0 (default) 
 +connection.auth-retries:                -1 
 +connection.timestamp:                   1630224329 
 +connection.read-only:                   no 
 +connection.permissions:                 -- 
 +connection.zone:                        -- 
 +connection.master:                      -- 
 +connection.slave-type:                  -- 
 +connection.autoconnect-slaves:          -1 (default) 
 +connection.secondaries:                 -- 
 +connection.gateway-ping-timeout:        0 
 +connection.metered:                     unknown 
 +connection.lldp:                        default 
 +connection.mdns:                        -1 (default) 
 +connection.llmnr:                       -1 (default) 
 +connection.wait-device-timeout:         -1 
 +------------------------------------------------------------------------------- 
 +802-3-ethernet.port:                    -- 
 +802-3-ethernet.speed:                   0 
 +802-3-ethernet.duplex:                  -- 
 +802-3-ethernet.auto-negotiate:          no 
 +802-3-ethernet.mac-address:             -- 
 +802-3-ethernet.cloned-mac-address:      -- 
 +802-3-ethernet.generate-mac-address-mask:-- 
 +802-3-ethernet.mac-address-blacklist:   -- 
 +802-3-ethernet.mtu:                     auto 
 +802-3-ethernet.s390-subchannels:        -- 
 +802-3-ethernet.s390-nettype:            -- 
 +802-3-ethernet.s390-options:            -- 
 +802-3-ethernet.wake-on-lan:             default 
 +802-3-ethernet.wake-on-lan-password:    -- 
 +------------------------------------------------------------------------------- 
 +ipv4.method:                            manual 
 +ipv4.dns:                               -- 
 +ipv4.dns-search:                        -- 
 +ipv4.dns-options:                       -- 
 +ipv4.dns-priority:                      0 
 +ipv4.addresses:                         10.0.2.46/24 
 +ipv4.gateway:                           10.0.2.1 
 +ipv4.routes:                            -- 
 +ipv4.route-metric:                      -1 
 +ipv4.route-table:                       0 (unspec) 
 +ipv4.routing-rules:                     -- 
 +ipv4.ignore-auto-routes:                no 
 +ipv4.ignore-auto-dns:                   no 
 +ipv4.dhcp-client-id:                    -- 
 +ipv4.dhcp-iaid:                         -- 
 +ipv4.dhcp-timeout:                      0 (default) 
 +ipv4.dhcp-send-hostname:                yes 
 +ipv4.dhcp-hostname:                     -- 
 +ipv4.dhcp-fqdn:                         -- 
 +ipv4.dhcp-hostname-flags:               0x0 (none) 
 +ipv4.never-default:                     no 
 +ipv4.may-fail:                          yes 
 +ipv4.dad-timeout:                       -1 (default) 
 +ipv4.dhcp-vendor-class-identifier:      -- 
 +ipv4.dhcp-reject-servers:               -- 
 +------------------------------------------------------------------------------- 
 +ipv6.method:                            auto 
 +ipv6.dns:                               -- 
 +ipv6.dns-search:                        -- 
 +ipv6.dns-options:                       -- 
 +ipv6.dns-priority:                      0 
 +ipv6.addresses:                         -- 
 +ipv6.gateway:                           -- 
 +ipv6.routes:                            -- 
 +ipv6.route-metric:                      -1 
 +ipv6.route-table:                       0 (unspec) 
 +ipv6.routing-rules:                     -- 
 +ipv6.ignore-auto-routes:                no 
 +ipv6.ignore-auto-dns:                   no 
 +ipv6.never-default:                     no 
 +ipv6.may-fail:                          yes 
 +ipv6.ip6-privacy:                       -1 (unknown) 
 +ipv6.addr-gen-mode:                     stable-privacy 
 +ipv6.ra-timeout:                        0 (default) 
 +ipv6.dhcp-duid:                         -- 
 +ipv6.dhcp-iaid:                         -- 
 +ipv6.dhcp-timeout:                      0 (default) 
 +ipv6.dhcp-send-hostname:                yes 
 +ipv6.dhcp-hostname:                     -- 
 +ipv6.dhcp-hostname-flags:               0x0 (none) 
 +ipv6.token:                             -- 
 +------------------------------------------------------------------------------- 
 +proxy.method:                           none 
 +proxy.browser-only:                     no 
 +proxy.pac-url:                          -- 
 +proxy.pac-script:                       -- 
 +------------------------------------------------------------------------------- 
 +=============================================================================== 
 +      Activate connection details (0f48c74d-5d16-4c37-8220-24644507b589) 
 +=============================================================================== 
 +GENERAL.NAME:                           ip_fixe 
 +GENERAL.UUID:                           0f48c74d-5d16-4c37-8220-24644507b589 
 +GENERAL.DEVICES:                        ens18 
 +GENERAL.IP-IFACE:                       ens18 
 +GENERAL.STATE:                          activated 
 +GENERAL.DEFAULT:                        yes 
 +GENERAL.DEFAULT6:                       no 
 +GENERAL.SPEC-OBJECT:                    -- 
 +GENERAL.VPN:                            no 
 +GENERAL.DBUS-PATH:                      /org/freedesktop/NetworkManager/ActiveConnection/
 +GENERAL.CON-PATH:                       /org/freedesktop/NetworkManager/Settings/
 +GENERAL.ZONE:                           -- 
 +GENERAL.MASTER-PATH:                    -- 
 +------------------------------------------------------------------------------- 
 +IP4.ADDRESS[1]:                         10.0.2.46/24 
 +IP4.GATEWAY:                            10.0.2.1 
 +IP4.ROUTE[1]:                           dst = 10.0.2.0/24, nh = 0.0.0.0, mt = 100 
 +IP4.ROUTE[2]:                           dst = 0.0.0.0/0, nh = 10.0.2.1, mt = 100 
 +------------------------------------------------------------------------------- 
 +IP6.ADDRESS[1]:                         fe80::5223:aee1:998e:9f27/64 
 +IP6.GATEWAY:                            -- 
 +IP6.ROUTE[1]:                           dst = fe80::/64, nh = ::, mt = 100 
 +IP6.ROUTE[2]:                           dst = ff00::/8, nh = ::, mt = 256, table=255 
 +------------------------------------------------------------------------------- 
 +lines 83-127/127 (END) 
 +[q] 
 +</code>
  
-Connectez-vous directement en tant que root à la machine virtuelle CentOS 8 et créez une seule partition sur **/dev/sdc** :+Pour consulter la liste profils associés à un périphérique, utilisez la commande suivante :
  
 <code> <code>
-[root@centos8 ~]# fdisk /dev/sdc+[root@centos8 ~]# nmcli -f CONNECTIONS device show ens18 
 +CONNECTIONS.AVAILABLE-CONNECTION-PATHS: /org/freedesktop/NetworkManager/Settings/1,/org/freedesktop/NetworkManager/Settings/
 +CONNECTIONS.AVAILABLE-CONNECTIONS[1]:   fc4a4d23-b15e-47a7-bcfa-b2e08f49553e | ens18 
 +CONNECTIONS.AVAILABLE-CONNECTIONS[2]:   0f48c74d-5d16-4c37-8220-24644507b589 | ip_fixe 
 +</code>
  
-Welcome to fdisk (util-linux 2.32.1). +Les fichiers de configuration pour le periphérique **ens18** se trouvent dans le répertoire **/etc/sysconfig/network-scripts/** :
-Changes will remain in memory only, until you decide to write them. +
-Be careful before using the write command.+
  
-Device does not contain a recognized partition table+<code> 
-Created a new DOS disklabel with disk identifier 0xc321702b. +[root@centos8 ~]# ls -l /etc/sysconfig/network-scripts/ | grep ifcfg 
- +-rw-r--r--1 root root 417 Jun 16 06:39 ifcfg-ens18 
-Command (m for help)n +-rw-r--r--1 root root 326 Aug 29 03:58 ifcfg-ip_fixe 
-Partition type +</code>
-     primary (0 primary, 0 extended, 4 free) +
-     extended (container for logical partitions) +
-Select (default p): +
  
-Using default response p. +====1.Résolution des Noms====
-Partition number (1-4, default 1):  +
-First sector (2048-41943039, default 2048):  +
-Last sector, +sectors or +size{K,M,G,T,P} (2048-41943039, default 41943039): +
  
-Created a new partition 1 of type 'Linuxand of size 20 GiB.+L'étude du fichier **/etc/sysconfig/network-scripts/ifcfg-ip_fixe** démontre l'abscence de directives concernant les DNS :
  
-Command (m for help): w +<code> 
-The partition table has been altered. +[root@centos8 ~]# cat /etc/sysconfig/network-scripts/ifcfg-ip_fixe 
-Calling ioctl() to re-read partition table+TYPE=Ethernet 
-Syncing disks.+PROXY_METHOD=none 
 +BROWSER_ONLY=no 
 +BOOTPROTO=none 
 +IPADDR=10.0.2.46 
 +PREFIX=24 
 +GATEWAY=10.0.2.1 
 +DEFROUTE=yes 
 +IPV4_FAILURE_FATAL=no 
 +IPV6INIT=yes 
 +IPV6_AUTOCONF=yes 
 +IPV6_DEFROUTE=yes 
 +IPV6_FAILURE_FATAL=no 
 +IPV6_ADDR_GEN_MODE=stable-privacy 
 +NAME=ip_fixe 
 +UUID=0f48c74d-5d16-4c37-8220-24644507b589 
 +DEVICE=ens18 
 +ONBOOT=yes
 </code> </code>
  
-Créez maintenant un système de fichiers ext4 sur **/dev/sdc1** :+La résolution des noms est donc inactive :
  
 <code> <code>
-[root@centos8 ~]# mkfs.ext4 /dev/sdc1 +[root@centos8 ~]# ping www.free.fr 
-mke2fs 1.45.6 (20-Mar-2020) +ping: www.free.frName or service not known
-Discarding device blocks: done                             +
-Creating filesystem with 16776960 4k blocks and 4194304 inodes +
-Filesystem UUID: dc92c0d7-919b-4fff-8719-53e9e7e628dd +
-Superblock backups stored on blocks:  +
-        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,  +
-        4096000, 7962624, 11239424 +
- +
-Allocating group tables: done                             +
-Writing inode tables: done                             +
-Creating journal (65536 blocks): done +
-Writing superblocks and filesystem accounting informationdone +
 </code> </code>
  
-Montez **/dev/sdc1** sur /mnt :+Modifiez donc la configuration du profil **ip_fixe** :
  
 <code> <code>
-[root@centos8 ~]# mount /dev/sdc1 /mnt+[root@centos8 ~]# nmcli connection mod ip_fixe ipv4.dns 8.8.8.8
 </code> </code>
  
-Copiez le contenu de /home vers /mnt :+L'étude du fichier **/etc/sysconfig/network-scripts/ifcfg-ip_fixe** démontre que la directive concernant le serveur DNS a été ajoutée :
  
 <code> <code>
-[root@centos8 ~]# cp -a /home//mnt+[root@centos8 ~]# cat /etc/sysconfig/network-scripts/ifcfg-ip_fixe 
 +TYPE=Ethernet 
 +PROXY_METHOD=none 
 +BROWSER_ONLY=no 
 +BOOTPROTO=none 
 +IPADDR=10.0.2.46 
 +PREFIX=24 
 +GATEWAY=10.0.2.1 
 +DEFROUTE=yes 
 +IPV4_FAILURE_FATAL=no 
 +IPV6INIT=yes 
 +IPV6_AUTOCONF=yes 
 +IPV6_DEFROUTE=yes 
 +IPV6_FAILURE_FATAL=no 
 +IPV6_ADDR_GEN_MODE=stable-privacy 
 +NAME=ip_fixe 
 +UUID=0f48c74d-5d16-4c37-8220-24644507b589 
 +DEVICE=ens18 
 +ONBOOT=yes 
 +DNS1=8.8.8.8
 </code> </code>
  
-Démontez /dev/sdc1 et déplacez /home vers /root :+Afin que la modification du serveur DNS soit prise en compte, re-démarrez le service NetworkManager :
  
 <code> <code>
-[root@centos8 ~]# umount /mnt +root@centos8 ~]# systemctl restart NetworkManager.service 
-[root@centos8 ~]# mv /home /root+[root@centos8 ~]# systemctl status NetworkManager.service 
 +● NetworkManager.service - Network Manager 
 +   Loaded: loaded (/usr/lib/systemd/system/NetworkManager.service; enabled; vendor preset: enabled) 
 +   Active: active (running) since Sun 2021-08-29 04:15:11 EDT; 8s ago 
 +     Docs: man:NetworkManager(8) 
 + Main PID: 973390 (NetworkManager) 
 +    Tasks: 4 (limit: 23535) 
 +   Memory: 4.6M 
 +   CGroup: /system.slice/NetworkManager.service 
 +           └─973390 /usr/sbin/NetworkManager --no-daemon 
 + 
 +Aug 29 04:15:12 centos8.ittraining.loc NetworkManager[973390]: <info>  [1630224912.2235] device (ens18): state change: ip-check -> secondaries (reas> 
 +Aug 29 04:15:12 centos8.ittraining.loc NetworkManager[973390]: <info>  [1630224912.2237] device (virbr0): state change: secondaries -> activated (re> 
 +Aug 29 04:15:12 centos8.ittraining.loc NetworkManager[973390]: <info>  [1630224912.2241] manager: NetworkManager state is now CONNECTED_LOCAL 
 +Aug 29 04:15:12 centos8.ittraining.loc NetworkManager[973390]: <info>  [1630224912.2251] policy: set 'ip_fixe' (ens18) as default for IPv4 routing a> 
 +Aug 29 04:15:12 centos8.ittraining.loc NetworkManager[973390]: <info>  [1630224912.3090] device (virbr0): Activation: successful, device activated. 
 +Aug 29 04:15:12 centos8.ittraining.loc NetworkManager[973390]: <info>  [1630224912.3098] device (ens18): state change: secondaries -> activated (rea> 
 +Aug 29 04:15:12 centos8.ittraining.loc NetworkManager[973390]: <info>  [1630224912.3102] manager: NetworkManager state is now CONNECTED_SITE 
 +Aug 29 04:15:12 centos8.ittraining.loc NetworkManager[973390]: <info>  [1630224912.3111] device (ens18): Activation: successful, device activated. 
 +Aug 29 04:15:12 centos8.ittraining.loc NetworkManager[973390]: <info>  [1630224912.3116] manager: NetworkManager state is now CONNECTED_GLOBAL 
 +Aug 29 04:15:12 centos8.ittraining.loc NetworkManager[973390]: <info>  [1630224912.3121] manager: startup complete 
 +lines 1-20/20 (END) 
 +[q]
 </code> </code>
  
-Identifiez l'UUID de /dev/sdc1 :+Vérifiez que le fichier **/etc/resolv.conf** ait été modifié par NetworkManager :
  
 <code> <code>
-[root@centos8 ~]# ls -l /dev/disk/by-uuid/ | grep sdc1 +[root@centos8 ~]# cat /etc/resolv.conf 
-lrwxrwxrwx1 root root 10 Jul 19 12:02 f76d6b66-985b-4a91-af9c-4987e8c1443c -> ../../sdc +# Generated by NetworkManager 
-[root@centos8 ~]# +search ittraining.loc 
 +nameserver 8.8.8.8
 </code> </code>
  
-Editez le fichier **/etc/fstab** et ajoutez une ligne pour /dev/sdc1 :+Dernièrement vérifiez la resolution des noms :
  
 <code> <code>
-[root@centos8 ~]# vi /etc/fstab +[root@centos8 ~]# ping www.free.fr 
-[root@centos8 ~]# cat /etc/fstab+PING www.free.fr (212.27.48.10) 56(84) bytes of data. 
 +64 bytes from www.free.fr (212.27.48.10): icmp_seq=1 ttl=47 time=29.3 ms 
 +64 bytes from www.free.fr (212.27.48.10): icmp_seq=2 ttl=47 time=29.4 ms 
 +64 bytes from www.free.fr (212.27.48.10): icmp_seq=3 ttl=47 time=29.4 ms 
 +64 bytes from www.free.fr (212.27.48.10): icmp_seq=4 ttl=47 time=29.4 ms 
 +^C 
 +--- www.free.fr ping statistics --- 
 +4 packets transmitted, 4 received, 0% packet loss, time 3005ms 
 +rtt min/avg/max/mdev = 29.266/29.377/29.428/0.183 ms 
 +</code>
  
-# +<WRAP center round important 60%> 
-# /etc/fstab +**Important** Notez qu'il existe un front-end graphique en mode texte**nmtui**pour configurer NetworkManager
-# Created by anaconda on Wed Jun 16 06:21:32 2021 +</WRAP> 
-+ 
-# Accessible filesystemsby referenceare maintained under '/dev/disk/'+====1.3 - Ajouter une Deuxième Adresse IP à un Profil==== 
-# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info+ 
-# +Pour ajouter une deuxième adresse IP à un profil sous RHEL/CentOS 8il convient d'utiliser la commande suivante : 
-# After editing this filerun 'systemctl daemon-reload' to update systemd + 
-# units generated from this file. +<code> 
-# +[root@centos8 ~]# nmcli connection mod ip_fixe +ipv4.addresses 192.168.1.2/24
-/dev/mapper/cl_centos8-root /                       xfs     defaults        0 0 +
-UUID=1c04981e-5317-4b73-9695-3ce25246835d /boot                   ext4    defaults        1 2 +
-/dev/mapper/cl_centos8-swap swap                    swap    defaults        0 0 +
-UUID=f76d6b66-985b-4a91-af9c-4987e8c1443c /home     ext4          defaults            1 2+
 </code> </code>
  
-Créez le point de montage /home :+Rechargez la configuration du profil :
  
 <code> <code>
-[root@centos8 ~]# mkdir /home+[root@centos8 ~]# nmcli con up ip_fixe
 </code> </code>
  
-Montez /dev/sdc1 :+Saisissez ensuite la commande suivante :
  
 <code> <code>
-[root@centos8 ~]# mount -a +[root@centos8 ~]# nmcli connection show ip_fixe 
-[root@centos8 ~]# mount +connection.id:                          ip_fixe 
-sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime,seclabel) +connection.uuid:                        0f48c74d-5d16-4c37-8220-24644507b589 
-proc on /proc type proc (rw,nosuid,nodev,noexec,relatime) +connection.stable-id:                   -- 
-devtmpfs on /dev type devtmpfs (rw,nosuid,seclabel,size=1882880k,nr_inodes=470720,mode=755+connection.type:                        802-3-ethernet 
-securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime+connection.interface-name:              ens18 
-tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev,seclabel+connection.autoconnect:                 yes 
-devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,seclabel,gid=5,mode=620,ptmxmode=000+connection.autoconnect-priority:        0 
-tmpfs on /run type tmpfs (rw,nosuid,nodev,seclabel,mode=755+connection.autoconnect-retries:         -1 (default
-tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,seclabel,mode=755) +connection.multi-connect:               (default
-cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,seclabel,xattr,release_agent=/usr/lib/systemd/systemd-cgroups-agent,name=systemd) +connection.auth-retries:                -1 
-pstore on /sys/fs/pstore type pstore (rw,nosuid,nodev,noexec,relatime,seclabel) +connection.timestamp:                   1630225792 
-bpf on /sys/fs/bpf type bpf (rw,nosuid,nodev,noexec,relatime,mode=700+connection.read-only:                   no 
-cgroup on /sys/fs/cgroup/hugetlb type cgroup (rw,nosuid,nodev,noexec,relatime,seclabel,hugetlb) +connection.permissions:                 -- 
-cgroup on /sys/fs/cgroup/memory type cgroup (rw,nosuid,nodev,noexec,relatime,seclabel,memory) +connection.zone:                        -- 
-cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,seclabel,cpu,cpuacct) +connection.master:                      -- 
-cgroup on /sys/fs/cgroup/rdma type cgroup (rw,nosuid,nodev,noexec,relatime,seclabel,rdma+connection.slave-type:                  -- 
-cgroup on /sys/fs/cgroup/pids type cgroup (rw,nosuid,nodev,noexec,relatime,seclabel,pids+connection.autoconnect-slaves:          -1 (default
-cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,seclabel,cpuset+connection.secondaries:                 -- 
-cgroup on /sys/fs/cgroup/perf_event type cgroup (rw,nosuid,nodev,noexec,relatime,seclabel,perf_event+connection.gateway-ping-timeout:        0 
-cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,seclabel,freezer+connection.metered:                     unknown 
-cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,seclabel,blkio+connection.lldp:                        default 
-cgroup on /sys/fs/cgroup/net_cls,net_prio type cgroup (rw,nosuid,nodev,noexec,relatime,seclabel,net_cls,net_prio+connection.mdns:                        -1 (default
-cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,seclabel,devices+connection.llmnr:                       -1 (default
-none on /sys/kernel/tracing type tracefs (rw,relatime,seclabel) +connection.wait-device-timeout:         -1 
-configfs on /sys/kernel/config type configfs (rw,relatime) +802-3-ethernet.port:                    -- 
-/dev/mapper/cl_centos8-root on / type xfs (rw,relatime,seclabel,attr2,inode64,logbufs=8,logbsize=32k,noquota) +802-3-ethernet.speed:                   0 
-selinuxfs on /sys/fs/selinux type selinuxfs (rw,relatime) +802-3-ethernet.duplex:                  -- 
-mqueue on /dev/mqueue type mqueue (rw,relatime,seclabel) +802-3-ethernet.auto-negotiate:          no 
-hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime,seclabel,pagesize=2M) +802-3-ethernet.mac-address:             -- 
-debugfs on /sys/kernel/debug type debugfs (rw,relatime,seclabel) +802-3-ethernet.cloned-mac-address:      -- 
-systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=40,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=6022) +802-3-ethernet.generate-mac-address-mask:-- 
-fusectl on /sys/fs/fuse/connections type fusectl (rw,relatime) +802-3-ethernet.mac-address-blacklist:   -- 
-/dev/sda1 on /boot type ext4 (rw,relatime,seclabel) +802-3-ethernet.mtu:                     auto 
-sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw,relatime) +802-3-ethernet.s390-subchannels:        -- 
-tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,seclabel,size=382500k,mode=700,uid=1000,gid=1000) +802-3-ethernet.s390-nettype:            -- 
-tmpfs on /run/user/42 type tmpfs (rw,nosuid,nodev,relatime,seclabel,size=382500k,mode=700,uid=42,gid=42) +802-3-ethernet.s390-options:            -- 
-gvfsd-fuse on /run/user/1000/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,relatime,user_id=1000,group_id=1000) +802-3-ethernet.wake-on-lan:             default 
-tmpfs on /run/user/0 type tmpfs (rw,nosuid,nodev,relatime,seclabel,size=382500k,mode=700) +802-3-ethernet.wake-on-lan-password:    -- 
-gvfsd-fuse on /run/user/0/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,relatime,user_id=0,group_id=0+ipv4.method:                            manual 
-/dev/sdc1 on /home type ext4 (rw,relatime,seclabel)+ipv4.dns:                               8.8.8.8 
 +ipv4.dns-search:                        -- 
 +ipv4.dns-options:                       -- 
 +ipv4.dns-priority:                      0 
 +ipv4.addresses:                         10.0.2.46/24192.168.1.2/24 
 +ipv4.gateway:                           10.0.2.1 
 +ipv4.routes:                            -- 
 +ipv4.route-metric:                      -1 
 +ipv4.route-table:                       (unspec
 +ipv4.routing-rules:                     -- 
 +ipv4.ignore-auto-routes:                no 
 +ipv4.ignore-auto-dns:                   no 
 +ipv4.dhcp-client-id:                    -- 
 +ipv4.dhcp-iaid:                         -- 
 +ipv4.dhcp-timeout:                      0 (default
 +ipv4.dhcp-send-hostname:                yes 
 +ipv4.dhcp-hostname:                     -- 
 +ipv4.dhcp-fqdn:                         -- 
 +ipv4.dhcp-hostname-flags:               0x0 (none
 +ipv4.never-default:                     no 
 +ipv4.may-fail:                          yes 
 +ipv4.dad-timeout:                       -1 (default
 +ipv4.dhcp-vendor-class-identifier:      -- 
 +ipv4.dhcp-reject-servers:               -- 
 +ipv6.method:                            auto 
 +ipv6.dns:                               -- 
 +ipv6.dns-search:                        -- 
 +ipv6.dns-options:                       -- 
 +ipv6.dns-priority:                      0 
 +ipv6.addresses:                         -- 
 +ipv6.gateway:                           -- 
 +ipv6.routes:                            -- 
 +ipv6.route-metric:                      -1 
 +ipv6.route-table:                       (unspec
 +ipv6.routing-rules:                     -- 
 +ipv6.ignore-auto-routes:                no 
 +ipv6.ignore-auto-dns:                   no 
 +ipv6.never-default:                     no 
 +ipv6.may-fail:                          yes 
 +ipv6.ip6-privacy:                       -1 (unknown
 +ipv6.addr-gen-mode:                     stable-privacy 
 +ipv6.ra-timeout:                        0 (default
 +ipv6.dhcp-duid:                         -- 
 +ipv6.dhcp-iaid:                         -- 
 +ipv6.dhcp-timeout:                      0 (default
 +ipv6.dhcp-send-hostname:                yes 
 +ipv6.dhcp-hostname:                     -- 
 +ipv6.dhcp-hostname-flags:               0x0 (none
 +ipv6.token:                             -- 
 +proxy.method:                           none 
 +proxy.browser-only:                     no 
 +proxy.pac-url:                          -
 +proxy.pac-script:                       -- 
 +GENERAL.NAME:                           ip_fixe 
 +GENERAL.UUID:                           0f48c74d-5d16-4c37-8220-24644507b589 
 +GENERAL.DEVICES:                        ens18 
 +GENERAL.IP-IFACE:                       ens18 
 +GENERAL.STATE:                          activated 
 +GENERAL.DEFAULT:                        yes 
 +GENERAL.DEFAULT6:                       no 
 +GENERAL.SPEC-OBJECT:                    -- 
 +GENERAL.VPN:                            no 
 +GENERAL.DBUS-PATH:                      /org/freedesktop/NetworkManager/ActiveConnection/3 
 +GENERAL.CON-PATH:                       /org/freedesktop/NetworkManager/Settings/2 
 +GENERAL.ZONE:                           -
 +GENERAL.MASTER-PATH:                    -- 
 +IP4.ADDRESS[1]:                         10.0.2.46/24 
 +IP4.ADDRESS[2]:                         192.168.1.2/24 
 +IP4.GATEWAY:                            10.0.2.1 
 +IP4.ROUTE[1]:                           dst = 10.0.2.0/24nh 0.0.0.0mt 100 
 +IP4.ROUTE[2]:                           dst = 192.168.1.0/24nh 0.0.0.0, mt 100 
 +IP4.ROUTE[3]:                           dst = 0.0.0.0/0nh 10.0.2.1mt 100 
 +IP4.DNS[1]:                             8.8.8.8 
 +IP6.ADDRESS[1]:                         fe80::5223:aee1:998e:9f27/64 
 +IP6.GATEWAY:                            -- 
 +IP6.ROUTE[1]:                           dst fe80::/64nh ::mt 100 
 +IP6.ROUTE[2]:                           dst ff00::/8nh ::mt 256table=255 
 +lines 72-116/116 (END
 +[q]
 </code> </code>
  
-Notez la taille de /home :+<WRAP center round important 60%> 
 +**Important** : Notez l'ajout de l'adresse secondaire à la ligne **ipv4.addresses: ** ainsi que l'ajout de la ligne **IP4.ADDRESS[2]:**. 
 +</WRAP> 
 + 
 +Consultez maintenant le contenu du fichier **/etc/sysconfig/network-scripts/ifcfg-ip_fixe** :
  
 <code> <code>
-[root@centos8 ~]# df -h +[root@centos8 ~]# cat /etc/sysconfig/network-scripts/ifcfg-ip_fixe 
-Filesystem                   Size  Used Avail Use% Mounted on +TYPE=Ethernet 
-devtmpfs                     1.8G      1.8G   0% /dev +PROXY_METHOD=none 
-tmpfs                        1.9G      1.9G   0% /dev/shm +BROWSER_ONLY=no 
-tmpfs                        1.9G  9.4M  1.9G   1% /run +BOOTPROTO=none 
-tmpfs                        1.9G      1.9G   0% /sys/fs/cgroup +IPADDR=10.0.2.46 
-/dev/mapper/cl_centos8-root   28G  5.2G   23G  19% / +PREFIX=24 
-/dev/sda1                    976M  289M  620M  32% /boot +GATEWAY=10.0.2.1 
-tmpfs                        374M   16K  374M   1% /run/user/1000 +DEFROUTE=yes 
-tmpfs                        374M  1.2M  373M   1% /run/user/42 +IPV4_FAILURE_FATAL=no 
-/dev/sdc1                     63G   67M   60G   1% /home+IPV6INIT=yes 
 +IPV6_AUTOCONF=yes 
 +IPV6_DEFROUTE=yes 
 +IPV6_FAILURE_FATAL=no 
 +IPV6_ADDR_GEN_MODE=stable-privacy 
 +NAME=ip_fixe 
 +UUID=0f48c74d-5d16-4c37-8220-24644507b589 
 +DEVICE=ens18 
 +ONBOOT=yes 
 +DNS1=8.8.8.8 
 +IPADDR1=192.168.1.2 
 +PREFIX1=24
 </code> </code>
  
-<WRAP center round todo+<WRAP center round important 60%
-**A faire** - Fermez la session de root et connectez-vous en tant que trainee.+**Important** : Notez l'ajout de la ligne **IPADDR1=192.168.1.2**.
 </WRAP> </WRAP>
  
-====2.Préparer l'Environnement====+====1.La Commande hostname====
  
-Pour créer l'arborescence de l'environnement de création de paquets dans /home/trainee, utilisez la commande **rpmdev-setuptree** :+La procédure de la modification du hostname est simplifiée et sa prise en compte est immédiate :
  
 <code> <code>
-[trainee@centos8 ~]$ rpmdev-setuptree +[root@centos8 ~]# hostname 
-...> +centos8.ittraining.loc
-[trainee@centos8 ~]$ ls -laR rpmbuild/ +
-rpmbuild/: +
-total 28 +
-drwxrwxr-x 7 trainee trainee 4096 Jul 19 12:10 . +
-drwxr-xr-x. 17 trainee trainee 4096 Jul 19 12:10 .. +
-drwxrwxr-x.  2 trainee trainee 4096 Jul 19 12:10 BUILD +
-drwxrwxr-x.  2 trainee trainee 4096 Jul 19 12:10 RPMS +
-drwxrwxr-x.  2 trainee trainee 4096 Jul 19 12:10 SOURCES +
-drwxrwxr-x.  2 trainee trainee 4096 Jul 19 12:10 SPECS +
-drwxrwxr-x 2 trainee trainee 4096 Jul 19 12:10 SRPMS+
  
-rpmbuild/BUILD: +[root@centos8 ~]# nmcli general hostname centos.ittraining.loc
-total 8 +
-drwxrwxr-x. 2 trainee trainee 4096 Jul 19 12:10 . +
-drwxrwxr-x. 7 trainee trainee 4096 Jul 19 12:10 ..+
  
-rpmbuild/RPMS: +[root@centos8 ~]# cat /etc/hostname 
-total 8 +centos.ittraining.loc
-drwxrwxr-x. 2 trainee trainee 4096 Jul 19 12:10 . +
-drwxrwxr-x. 7 trainee trainee 4096 Jul 19 12:10 ..+
  
-rpmbuild/SOURCES: +[root@centos8 ~]# hostname 
-total 8 +centos.ittraining.loc
-drwxrwxr-x. 2 trainee trainee 4096 Jul 19 12:10 . +
-drwxrwxr-x. 7 trainee trainee 4096 Jul 19 12:10 ..+
  
-rpmbuild/SPECS: +[root@centos8 ~]# nmcli general hostname centos8.ittraining.loc
-total 8 +
-drwxrwxr-x. 2 trainee trainee 4096 Jul 19 12:10 . +
-drwxrwxr-x. 7 trainee trainee 4096 Jul 19 12:10 ..+
  
-rpmbuild/SRPMS: +[root@centos8 ~]# cat /etc/hostname 
-total 8 +centos8.ittraining.loc 
-drwxrwxr-x2 trainee trainee 4096 Jul 19 12:10 + 
-drwxrwxr-x. 7 trainee trainee 4096 Jul 19 12:10 ..+[root@centos8 ~]# hostname 
 +centos8.ittraining.loc
 </code> </code>
  
-Téléchargez le rpm source du noyau :+====1.5 - La Commande ip==== 
 + 
 +Sous RHEL/CentOS 8 la commande **ip** est préférée par rapport à la commande ifconfig :
  
 <code> <code>
-[trainee@centos8 ~]$ uname -a +[root@centos8 ~]# ip address 
-Linux centos8.ittraining.loc 4.18.0-305.7.1.el8_4.x86_64 #SMP Tue Jun 29 21:55:12 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux+1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 
 +    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 
 +    inet 127.0.0.1/8 scope host lo 
 +       valid_lft forever preferred_lft forever 
 +    inet6 ::1/128 scope host  
 +       valid_lft forever preferred_lft forever 
 +2: ens18: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000 
 +    link/ether 4e:b1:31:bd:5d:b2 brd ff:ff:ff:ff:ff:ff 
 +    inet 10.0.2.46/24 brd 10.0.2.255 scope global noprefixroute ens18 
 +       valid_lft forever preferred_lft forever 
 +    inet 192.168.1.2/24 brd 192.168.1.255 scope global noprefixroute ens18 
 +       valid_lft forever preferred_lft forever 
 +    inet6 fe80::5223:aee1:998e:9f27/64 scope link noprefixroute  
 +       valid_lft forever preferred_lft forever 
 +3: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000 
 +    link/ether 52:54:00:79:02:66 brd ff:ff:ff:ff:ff:ff 
 +    inet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0 
 +       valid_lft forever preferred_lft forever 
 +4: virbr0-nic: <BROADCAST,MULTICAST> mtu 1500 qdisc fq_codel master virbr0 state DOWN group default qlen 1000 
 +    link/ether 52:54:00:79:02:66 brd ff:ff:ff:ff:ff:ff 
 +</code>
  
-[trainee@centos8 ~]$ cat /etc/centos-release +===Options de la Commande ip===
-CentOS Linux release 8.4.2105+
  
-[trainee@centos8 ~]$ wget https://vault.centos.org/8.4.2105/BaseOS/Source/SPackages/kernel-4.18.0-305.7.1.el8_4.src.rpm +Les options de cette commande sont :
---2021-07-14 02:54:14--  https://vault.centos.org/8.4.2105/BaseOS/Source/SPackages/kernel-4.18.0-305.7.1.el8_4.src.rpm +
-Resolving vault.centos.org (vault.centos.org)... 81.171.33.194, 2a05:d014:10:7803:4af1:9320:7050:d28e +
-Connecting to vault.centos.org (vault.centos.org)|81.171.33.194|:443... connected. +
-HTTP request sent, awaiting response... 200 OK +
-Length: 123000617 (117M) [application/x-rpm] +
-Saving to: ‘kernel-4.18.0-305.7.1.el8_4.src.rpm’+
  
-kernel-4.18.0-305.7.1. 100%[===========================>117.30M  1.49MB/   in 79s     +<code> 
 +[root@centos8 ~]# ip --help 
 +Usage: ip OPTIONS ] OBJECT { COMMAND | help } 
 +       ip [ -force ] -batch filename 
 +where  OBJECT :{ link | address | addrlabel | route | rule | neigh | ntable | 
 +                   tunnel | tuntap | maddress | mroute | mrule | monitor | xfrm | 
 +                   netns | l2tp | fou | macsec | tcp_metrics | token | netconf | ila | 
 +                   vrf | sr | nexthop | mptcp } 
 +       OPTIONS :{ -V[ersion| -s[tatistics] | -d[etails] | -r[esolve] | 
 +                    -h[uman-readable] | -iec | -j[son] | -p[retty] | 
 +                    -f[amily] { inet | inet6 | mpls | bridge | link } | 
 +                    -4 | -6 | -I | -D | -M | -B | -0 | 
 +                    -l[oops] { maximum-addr-flush-attempts } | -br[ief] | 
 +                    -o[neline] | -t[imestamp] | -ts[hort] | -b[atch] [filename] | 
 +                    -rc[vbuf] [size] | -n[etns] name | -N[umeric] | -a[ll] | 
 +                    -c[olor]}
  
-2021-07-14 02:55:33 (1.49 MB/s) - ‘kernel-4.18.0-305.7.1.el8_4.src.rpm’ saved [123000617/123000617] 
 </code> </code>
  
-Installez maintenant les dépendances pour le rpm source en tant que root :+====1.6 - Activer/Désactiver une Interface Manuellement==== 
 + 
 +Deux commandes existent pour désactiver et activer manuellement une interface réseau :
  
 <code> <code>
-[trainee@centos8 ~]$ su - +# nmcli device disconnect enp0s3 
-Mot de passe : fenestros+# nmcli device connect enp0s3 
 +</code>
  
-[root@centos8 ~]# dnf install yum-utils +<WRAP center round important 60%> 
-...+**Important** : Veuillez ne **PAS** exécuter ces deux commandes. 
 +</WRAP> 
 + 
 +====1.7 - Routage Statique==== 
 + 
 +===La commande ip=== 
 + 
 +Sous RHEL/CentOS 8, pour supprimer la route vers le réseau 192.168.1.0 il convient d'utiliser la commande ip et non pas la commande route : 
 + 
 +<code> 
 +[root@centos8 ~]# ip route 
 +default via 10.0.2.1 dev ens18 proto static metric 100  
 +10.0.2.0/24 dev ens18 proto kernel scope link src 10.0.2.46 metric 100  
 +192.168.1.0/24 dev ens18 proto kernel scope link src 192.168.1.2 metric 100  
 +192.168.122.0/24 dev virbr0 proto kernel scope link src 192.168.122.1 linkdown
  
-[root@centos8 ~]# yum-builddep /home/trainee/kernel-4.18.0-305.7.1.el8_4.src.rpm  +root@centos8 ~]# ip route del 192.168.1.0/24 via 0.0.0.
-...+[root@centos8 ~]# ip route 
 +default via 10.0.2.1 dev ens18 proto static metric 100  
 +10.0.2.0/24 dev ens18 proto kernel scope link src 10.0.2.46 metric 100  
 +192.168.122.0/24 dev virbr0 proto kernel scope link src 192.168.122.1 linkdown 
 </code> </code>
  
-Installez maintenant le paquet **kernel-4.18.0-305.7.1.el8_4.src.rpm** :+Pour ajouter la route vers le réseau 192.168.1.:
  
 <code> <code>
-[root@centos8 ~]# exit +[root@centos8 ~]# ip route add 192.168.1.0/24 via 10.0.2.1 
-logout +[root@centos8 ~]# ip route 
-[trainee@centos8 ~]$ rpm -Uvh kernel-4.18.0-305.7.1.el8_4.src.rpm +default via 10.0.2.1 dev ens18 proto static metric 100  
-Updating installing... +10.0.2.0/24 dev ens18 proto kernel scope link src 10.0.2.46 metric 100  
-   1:kernel-4.18.0-305.7.1.el8_4      warning: user mockbuild does not exist - using root +192.168.1.0/24 via 10.0.2.1 dev ens18  
-warning: group mockbuild does not exist - using root +192.168.122.0/24 dev virbr0 proto kernel scope link src 192.168.122.1 linkdown 
-warning: user mockbuild does not exist - using root +
-warning: group mockbuild does not exist - using root +
-warning: user mockbuild does not exist - using root +
-warning: group mockbuild does not exist - using root +
-warning: user mockbuild does not exist - using root +
-warning: group mockbuild does not exist - using root +
-warning: user mockbuild does not exist - using root +
-warning: group mockbuild does not exist - using root +
-warning: user mockbuild does not exist - using root +
-warning: group mockbuild does not exist - using root +
-warning: user mockbuild does not exist - using root +
-warning: group mockbuild does not exist - using root +
-warning: user mockbuild does not exist - using root +
-warning: group mockbuild does not exist - using root +
-warning: user mockbuild does not exist - using root +
-warning: group mockbuild does not exist - using root +
-warning: user mockbuild does not exist - using root +
-warning: group mockbuild does not exist - using root +
-warning: user mockbuild does not exist - using root +
-warning: group mockbuild does not exist - using root +
-warning: user mockbuild does not exist - using root +
-warning: group mockbuild does not exist - using root +
-warning: user mockbuild does not exist - using root +
-warning: group mockbuild does not exist - using root +
-warning: user mockbuild does not exist - using root +
-warning: group mockbuild does not exist - using root +
-warning: user mockbuild does not exist - using root +
-warning: group mockbuild does not exist - using root +
-warning: user mockbuild does not exist - using root +
-warning: group mockbuild does not exist - using root +
-warning: user mockbuild does not exist - using root +
-warning: group mockbuild does not exist - using root +
-warning: user mockbuild does not exist - using root +
-warning: group mockbuild does not exist - using root +
-warning: user mockbuild does not exist - using root +
-warning: group mockbuild does not exist - using root +
-warning: user mockbuild does not exist - using root +
-warning: group mockbuild does not exist - using root +
-warning: user mockbuild does not exist - using root +
-warning: group mockbuild does not exist - using root +
-warning: user mockbuild does not exist - using root +
-warning: group mockbuild does not exist - using root +
-warning: user mockbuild does not exist - using root +
-warning: group mockbuild does not exist - using root +
-warning: user mockbuild does not exist - using root +
-warning: group mockbuild does not exist - using root +
-warning: user mockbuild does not exist - using root +
-warning: group mockbuild does not exist - using root +
-warning: user mockbuild does not exist - using root +
-warning: group mockbuild does not exist - using root +
-warning: user mockbuild does not exist - using root +
-warning: group mockbuild does not exist - using root +
-warning: user mockbuild does not exist - using root +
-warning: group mockbuild does not exist - using root +
-warning: user mockbuild does not exist - using root +
-warning: group mockbuild does not exist - using root +
-warning: user mockbuild does not exist - using root +
-warning: group mockbuild does not exist - using root +
-warning: user mockbuild does not exist - using root +
-warning: group mockbuild does not exist - using root +
-warning: user mockbuild does not exist - using root +
-warning: group mockbuild does not exist - using root +
-warning: user mockbuild does not exist - using root +
-warning: group mockbuild does not exist - using root +
-warning: user mockbuild does not exist - using root +
-warning: group mockbuild does not exist - using root +
-warning: user mockbuild does not exist - using root +
-warning: group mockbuild does not exist - using root +
-warning: user mockbuild does not exist - using root +
-warning: group mockbuild does not exist - using root +
-warning: user mockbuild does not exist - using root +
-warning: group mockbuild does not exist - using root +
-warning: user mockbuild does not exist - using root +
-warning: group mockbuild does not exist - using root +
-warning: user mockbuild does not exist - using root +
-warning: group mockbuild does not exist - using root +
-warning: user mockbuild does not exist - using root +
-warning: group mockbuild does not exist - using root +
-warning: user mockbuild does not exist - using root +
-warning: group mockbuild does not exist - using root +
-warning: user mockbuild does not exist - using root +
-warning: group mockbuild does not exist - using root +
-################################# [100%] +
-warning: user mockbuild does not exist - using root +
-warning: group mockbuild does not exist - using root +
-warning: user mockbuild does not exist - using root +
-warning: group mockbuild does not exist - using root +
-warning: user mockbuild does not exist - using root +
-warning: group mockbuild does not exist - using root +
-warning: user mockbuild does not exist - using root +
-warning: group mockbuild does not exist - using root +
-warning: user mockbuild does not exist - using root +
-warning: group mockbuild does not exist - using root +
-warning: user mockbuild does not exist - using root +
-warning: group mockbuild does not exist - using root +
-warning: user mockbuild does not exist - using root +
-warning: group mockbuild does not exist - using root +
-warning: user mockbuild does not exist - using root +
-warning: group mockbuild does not exist - using root+
 </code> </code>
  
-<WRAP center round important> +<WRAP center round important 60%
-**Important** - Les erreurs sont sans importance.+**Important** - La commande utilisée pour ajouter une passerelle par défaut prend la forme suivante **ip route add default via //adresse ip//**.
 </WRAP> </WRAP>
  
-====2.3 - Préparer l'Arborescence Source du Noyau====+===Désactiver/Activer le routage sur le serveur===
  
-Naviguez vers le repertoire **~/rpmbuild/SPECS** et utilisez la commande **rpmbuild** pour préparer l'arborescence source du noyau :+Pour désactiver le routage sur le serveur, il convient de désactiver la retransmission des paquets:
  
 <code> <code>
-[trainee@centos7 ~]$ cd ~/rpmbuild/SPECS +[root@centos8 ~]# cat /proc/sys/net/ipv4/ip_forward 
-[trainee@centos7 SPECS]$ rpmbuild -bp --target=$(uname -m) kernel.spec +
-...+[root@centos8 ~]# echo 0 > /proc/sys/net/ipv4/ip_forward 
 +[root@centos8 ~]# cat /proc/sys/net/ipv4/ip_forward 
 +0
 </code> </code>
  
-A l'issu du processusexaminez l'arborescence :+Pour activer le routage sur le serveuril convient d'activer la retransmission des paquets:
  
 <code> <code>
-[trainee@centos8 SPECS]$ ls -la ~/rpmbuild/BUILD/kernel-4.18.0-305.7.1.el8_4/linux-4.18.0-305.7.1.el8.x86_64+[root@centos8 ~]# echo 1 > /proc/sys/net/ipv4/ip_forward 
-total 812 +[root@centos8 ~]# cat /proc/sys/net/ipv4/ip_forward 
-drwxr-xr-x.  26 trainee trainee   4096 Jul 14 03:13 . +1
-drwxr-xr-x.   3 trainee trainee   4096 Jul 14 03:12 .. +
-drwxr-xr-x.  27 trainee trainee   4096 Jul 14 03:13 arch +
-drwxr-xr-x.   3 trainee trainee   4096 Jun 14 10:33 block +
-drwxr-xr-x.   2 trainee trainee   4096 Jul 14 03:13 certs +
--rw-r--r--.   1 trainee trainee  13079 Jun 14 10:33 .clang-format +
--rw-r--r--.   1 trainee trainee     59 Jun 14 10:33 .cocciconfig +
-drwxr-xr-x.   2 trainee trainee   4096 Jul 14 03:13 configs +
--rw-r--r--.   1 trainee trainee    423 Jun 14 10:33 COPYING-4.18.0 +
--rw-r--r--.   1 trainee trainee  98651 Jun 14 10:33 CREDITS +
-drwxr-xr-x.   4 trainee trainee   4096 Jun 14 10:33 crypto +
-drwxr-xr-x. 119 trainee trainee   4096 Jul 14 03:13 Documentation +
-drwxr-xr-x. 137 trainee trainee   4096 Jun 14 10:33 drivers +
-drwxr-xr-x.   2 trainee trainee   4096 Jul 14 03:13 firmware +
-drwxr-xr-x.  73 trainee trainee   4096 Jun 14 10:33 fs +
--rw-r--r--.   1 trainee trainee     68 Jun 14 10:33 .get_maintainer.conf +
--rw-r--r--.   1 trainee trainee     31 Jun 14 10:33 .get_maintainer.ignore +
--rw-r--r--.   1 trainee trainee     76 Jun 14 10:33 .gitattributes +
--rw-r--r--.   1 trainee trainee   1639 Jun 14 10:33 .gitlab-ci-private.yml +
--rw-r--r--.   1 trainee trainee   1668 Jun 14 10:33 .gitlab-ci.yml +
-drwxr-xr-x.  30 trainee trainee   4096 Jun 14 10:33 include +
-drwxr-xr-x.   2 trainee trainee   4096 Jun 14 10:33 init +
-drwxr-xr-x.   2 trainee trainee   4096 Jun 14 10:33 ipc +
--rw-r--r--.   1 trainee trainee   2245 Jun 14 10:33 Kbuild +
--rw-r--r--.   1 trainee trainee    575 Jun 14 10:33 Kconfig +
-drwxr-xr-x.  19 trainee trainee   4096 Jul 14 03:13 kernel +
-drwxr-xr-x.  20 trainee trainee  12288 Jul 14 03:13 lib +
-drwxr-xr-x.   5 trainee trainee   4096 Jun 14 10:33 LICENSES +
--rw-r--r--.   1 trainee trainee   9559 Jun 14 10:33 .mailmap +
--rw-r--r--.   1 trainee trainee 471696 Jun 14 10:33 MAINTAINERS +
--rw-r--r--.   1 trainee trainee  61558 Jun 14 10:33 Makefile +
--rw-r--r--.   1 trainee trainee   1324 Jun 14 10:33 Makefile.rhelver +
--rw-r--r--.   1 trainee trainee      0 Jul 14 03:13 .mismatches +
-drwxr-xr-x.   3 trainee trainee   4096 Jun 14 10:33 mm +
-drwxr-xr-x.  72 trainee trainee   4096 Jun 14 10:33 net +
--rw-r--r--.   trainee trainee    800 Jun 14 10:33 README +
-drwxr-xr-x.  28 trainee trainee   4096 Jun 14 10:33 samples +
--rw-r--r--.   1 trainee trainee      0 Jul 14 03:12 .scmversion +
-drwxr-xr-x.  14 trainee trainee   4096 Jul 14 03:13 scripts +
-drwxr-xr-x.  10 trainee trainee   4096 Jun 14 10:33 security +
-drwxr-xr-x.  26 trainee trainee   4096 Jun 14 10:33 sound +
-drwxr-xr-x.  33 trainee trainee   4096 Jun 14 10:33 tools +
-drwxr-xr-x.   2 trainee trainee   4096 Jul 14 03:13 usr +
-drwxr-xr-x.   4 trainee trainee   4096 Jun 14 10:33 virt+
 </code> </code>
  
-===Le Fichier .config===+=====LAB #2 - Diagnostique du Réseau===== 
 + 
 +====2.1 - ping====
  
-Changez de répertoire de travail :+Pour tester l'accessibilité d'une machine, vous devez utiliser la commande **ping** :
  
 <code> <code>
-[trainee@centos8 SPECS]$ cd ~/rpmbuild/BUILD/kernel-*/linux-*/+[root@centos8 ~]# ping -c4 10.0.2.1 
 +PING 10.0.2.1 (10.0.2.1) 56(84) bytes of data. 
 +64 bytes from 10.0.2.1: icmp_seq=1 ttl=64 time=0.104 ms 
 +64 bytes from 10.0.2.1: icmp_seq=2 ttl=64 time=0.325 ms 
 +64 bytes from 10.0.2.1: icmp_seq=3 ttl=64 time=0.250 ms 
 +64 bytes from 10.0.2.1: icmp_seq=4 ttl=64 time=0.123 ms 
 + 
 +--- 10.0.2.1 ping statistics --- 
 +4 packets transmitted, 4 received, 0% packet loss, time 3083ms 
 +rtt min/avg/max/mdev = 0.104/0.200/0.325/0.092 ms
 </code> </code>
  
-Copiez le fichier **configs/kernel-4.18.0-`uname -m`.config** vers **.config** dans le répertoire courant :+===Options de la commande ping=== 
 + 
 +Les options de cette commande sont :
  
 <code> <code>
-[trainee@centos8 linux-4.18.0-305.7.1.el8.x86_64]$ cp configs/kernel-4.18.0-`uname -m`.config .config+[root@centos8 ~]# ping --help 
 +ping: invalid option -- '-' 
 +Usage: ping [-aAbBdDfhLnOqrRUvV64] [-c count] [-i interval] [-I interface] 
 +            [-m mark] [-M pmtudisc_option] [-l preload] [-p pattern] [-Q tos] 
 +            [-s packetsize] [-S sndbuf] [-t ttl] [-T timestamp_option] 
 +            [-w deadline] [-W timeout] [hop1 ...] destination 
 +Usage: ping -6 [-aAbBdDfhLnOqrRUvV] [-c count] [-i interval] [-I interface] 
 +             [-l preload] [-m mark] [-M pmtudisc_option] 
 +             [-N nodeinfo_option] [-p pattern] [-Q tclass] [-s packetsize] 
 +             [-S sndbuf] [-t ttl] [-T timestamp_option] [-w deadline] 
 +             [-W timeout] destination
 </code> </code>
  
-Mettez à jour le fichier .config par rapport à la configuration actuelle du noyau :+====2.2 - netstat -i==== 
 + 
 +Pour visualiser les statistiques réseaux, vous disposez de la commande **netstat** :
  
 <code> <code>
-[trainee@centos8 linux-4.18.0-305.7.1.el8.x86_64]$ make oldconfig +[root@centos8 ~]# netstat -i 
-scripts/kconfig/conf  --oldconfig Kconfig +Kernel Interface table 
-# +Iface             MTU    RX-OK RX-ERR RX-DRP RX-OVR    TX-OK TX-ERR TX-DRP TX-OVR Flg 
-# configuration written to .config +ens18            1500   476056      0      0 0        363562      0      0      0 BMRU 
-#+lo              65536    10936      0      0 0         10936      0      0      0 LRU 
 +virbr0           1500        0      0      0 0                  0      0      0 BMU
 </code> </code>
  
-<WRAP center round important> +===Options de la commande netstat===
-**Important** - Cette commande lit le fichier .config du noyau actuel et le compare avec celui des sources du noyau. S'il existent des nouvelles configurations à effectuer dans les sources du noyau, la commande vous pose des questions. +
-</WRAP>+
  
-La configuration du noyau se trouve dans un fichier dénommé **.config**. Le fichier **.config** est généré par une des trois commandes suivantes et ne doit **pas** être édité manuellement : +Les options de cette commande sont :
- +
-  * make config +
-  * make menuconfig +
-  * make xconfig +
-   +
-Exécutez la commande **make menuconfig** :+
  
 <code> <code>
-[trainee@centos8 linux-4.18.0-305.7.1.el8.x86_64]$ make menuconfig +[root@centos8 ~]# netstat --help 
-  UPD     scripts/kconfig/.mconf-cfg +usage: netstat [-vWeenNcCF] [<Af>] -r         netstat {-V|--version|-h|--help} 
-  HOSTCC  scripts/kconfig/mconf.o +       netstat [-vWnNcaeol] [<Socket> ...] 
-  HOSTCC  scripts/kconfig/lxdialog/checklist.o +       netstat { [-vWeenNac] -I[<Iface>] | [-veenNac] -i | [-cnNe] -M | -s [-6tuw] } [delay] 
-  HOSTCC  scripts/kconfig/lxdialog/inputbox.o + 
-  HOSTCC  scripts/kconfig/lxdialog/menubox.o +        -r, --route              display routing table 
-  HOSTCC  scripts/kconfig/lxdialog/textbox.o +        -I, --interfaces=<Iface> display interface table for <Iface> 
-  HOSTCC  scripts/kconfig/lxdialog/util.o +        -i, --interfaces         display interface table 
-  HOSTCC  scripts/kconfig/lxdialog/yesno.+        -g, --groups             display multicast group memberships 
-  HOSTLD  scripts/kconfig/mconf +        -s, --statistics         display networking statistics (like SNMP) 
-scripts/kconfig/mconf  Kconfig +        -M, --masquerade         display masqueraded connections 
-# + 
-# using defaults found in /boot/config-4.18.0-305.7.1.el8_4.x86_64 +        -v, --verbose            be verbose 
-#+        -W, --wide               don't truncate IP addresses 
 +        -n, --numeric            don't resolve names 
 +        --numeric-hosts          don't resolve host names 
 +        --numeric-ports          don't resolve port names 
 +        --numeric-users          don't resolve user names 
 +        -N, --symbolic           resolve hardware names 
 +        -e, --extend             display other/more information 
 +        -p, --programs           display PID/Program name for sockets 
 +        -o, --timers             display timers 
 +        -c, --continuous         continuous listing 
 + 
 +        -l, --listening          display listening server sockets 
 +        -a, --all                display all sockets (default: connected) 
 +        -F, --fib                display Forwarding Information Base (default) 
 +        -C, --cache              display routing cache instead of FIB 
 +        -Z, --context            display SELinux security context for sockets 
 + 
 +  <Socket>={-t|--tcp} {-u|--udp} {-U|--udplite} {-S|--sctp} {-w|--raw} 
 +           {-x|--unix} --ax25 --ipx --netrom 
 +  <AF>=Use '-6|-4' or '-A <af>' or '--<af>'; default: inet 
 +  List of possible address families (which support routing): 
 +    inet (DARPA Internet) inet6 (IPv6) ax25 (AMPR AX.25)  
 +    netrom (AMPR NET/ROM) ipx (Novell IPX) ddp (Appletalk DDP)  
 +    x25 (CCITT X.25)
 </code> </code>
  
-Dans l'interface, vous pouvez constater la présence de lignes correspondantes à des fonctionalités suivies par une lettre ou une valeurDans le cas d'une lettre, la signification est la suivante :+====2.3 - traceroute====
  
-  * **y**, +La commande ping est à la base de la commande **traceroute**. Cette commande sert à découvrir la route empruntée pour accéder à un site donné :
-    * la fonctionalité est incluse dans le noyau monolithique ou dans le cas d'une dépendance d'un module, dans le module concerné, +
-  * **m**, +
-    * la fonctionalité est incluse en tant que module, +
-  * **n**, +
-    * la fonctionalité n'est pas incluse.+
  
-<WRAP center round important+<code> 
-**Important** - Cette commande permet la modification de la configuration du noyau+[root@centos8 ~]# traceroute www.ittraining.network 
-</WRAP+bash: traceroute: command not found... 
-   +Install package 'traceroute' to provide command 'traceroute'? [N/y] y 
-Sauvegardez simplement la configuration actuelle et sortez de l'interface :+ 
 + 
 + Waiting in queue...  
 +The following packages have to be installed: 
 + traceroute-3:2.1.0-6.el8.x86_64        Traces the route taken by packets over an IPv4/IPv6 network 
 +Proceed with changes? [N/y] y 
 + 
 + 
 + Waiting in queue...  
 + Waiting for authentication...  
 + Waiting in queue...  
 + * Downloading packages...  
 + * Requesting data...  
 + * Testing changes...  
 + * Installing packages...  
 +traceroute to www.ittraining.network (109.228.56.52), 30 hops max, 60 byte packets 
 +  _gateway (10.0.2.1)  0.132 ms  0.101 ms  0.078 ms 
 +  79.137.68.252 (79.137.68.252)  0.542 ms  0.656 ms  0.809 ms 
 +  10.50.24.61 (10.50.24.61)  0.238 ms  0.219 ms 10.50.24.60 (10.50.24.60)  0.239 ms 
 +  10.50.0.16 (10.50.0.16)  0.172 ms 10.50.0.22 (10.50.0.22)  0.194 ms  0.173 ms 
 +  10.73.248.192 (10.73.248.192)  0.766 ms 10.73.248.194 (10.73.248.194)  0.730 ms 10.73.248.192 (10.73.248.192)  0.757 ms 
 +  waw-wa2-sbb1-nc5.pl.eu (91.121.131.150)  1.102 ms  1.396 ms  1.099 ms 
 +  fra-fr5-sbb1-nc5.de.eu (213.251.128.113)  18.309 ms fra-fr5-sbb2-nc5.de.eu (54.36.50.116)  21.881 ms fra-fr5-sbb1-nc5.de.eu (213.251.128.113)  16.764 ms 
 +  10.200.0.6 (10.200.0.6)  20.922 ms 10.200.0.0 (10.200.0.0)  16.959 ms 10.200.0.4 (10.200.0.4)  21.143 ms 
 +  decix.bb-a.fra3.fra.de.oneandone.net (80.81.192.123)  18.789 ms decix.bb-c.act.fra.de.oneandone.net (80.81.193.123)  20.310 ms decix.bb-a.fra3.fra.de.oneandone.net (80.81.192.123)  18.693 ms 
 +10  ae-14.bb-b.fr7.fra.de.oneandone.net (212.227.120.149)  22.222 ms  22.206 ms  22.257 ms 
 +11  port-channel-3.gw-ngcs-1.dc1.con.glo.gb.oneandone.net (88.208.255.131)  39.660 ms  39.679 ms ae-19.bb-b.thn.lon.gb.oneandone.net (212.227.120.33)  33.973 ms 
 +12  109.228.63.209 (109.228.63.209)  37.363 ms port-channel-3.gw-ngcs-1.dc1.con.glo.gb.oneandone.net (88.208.255.131)  39.534 ms 109.228.63.209 (109.228.63.209)  37.901 ms 
 +13  * 109.228.63.209 (109.228.63.209)  38.014 ms  37.991 ms 
 +14  * * * 
 +15  * * * 
 +16  * * * 
 +17  * * * 
 +18  * * * 
 +19  * * * 
 +20  * * * 
 +21  * * * 
 +22  * * * 
 +23  * * * 
 +24  * * * 
 +25  * * * 
 +26  * * * 
 +27  * * * 
 +28  * * * 
 +29  * * *^C 
 +</code
 + 
 +===Options de la commande traceroute=== 
 + 
 +Les options de cette commande sont :
  
 <code> <code>
-*** End of the configuration+[root@centos8 ~]# traceroute --help 
-*** Execute 'make' to start the build or try 'make help'.+Usage: 
 +  traceroute [ -46dFITnreAUDV ] [ -f first_ttl ] [ -g gate,... ] [ -i device ] [ -m max_ttl ] [ -N squeries ] [ -p port ] [ -t tos ] [ -l flow_label ] [ -w MAX,HERE,NEAR ] [ -q nqueries ] [ -s src_addr ] [ -z sendwait ] [ --fwmark=num ] host [ packetlen ] 
 +Options: 
 +  -4                          Use IPv4 
 +  -6                          Use IPv6 
 +  -d  --debug                 Enable socket level debugging 
 +  -F  --dont-fragment         Do not fragment packets 
 +  -f first_ttl  --first=first_ttl 
 +                              Start from the first_ttl hop (instead from 1) 
 +  -g gate,...  --gateway=gate,... 
 +                              Route packets through the specified gateway 
 +                              (maximum 8 for IPv4 and 127 for IPv6) 
 +  -I  --icmp                  Use ICMP ECHO for tracerouting 
 +  -T  --tcp                   Use TCP SYN for tracerouting (default port is 80) 
 +  -i device  --interface=device 
 +                              Specify a network interface to operate with 
 +  -m max_ttl  --max-hops=max_ttl 
 +                              Set the max number of hops (max TTL to be 
 +                              reached). Default is 30 
 +  -N squeries  --sim-queries=squeries 
 +                              Set the number of probes to be tried 
 +                              simultaneously (default is 16) 
 +  -n                          Do not resolve IP addresses to their domain names 
 +  -p port  --port=port        Set the destination port to useIt is either 
 +                              initial udp port value for "default" method 
 +                              (incremented by each probe, default is 33434), or 
 +                              initial seq for "icmp" (incremented as well, 
 +                              default from 1), or some constant destination 
 +                              port for other methods (with default of 80 for 
 +                              "tcp", 53 for "udp", etc.) 
 +  -t tos  --tos=tos           Set the TOS (IPv4 type of service) or TC (IPv6 
 +                              traffic class) value for outgoing packets 
 +  -l flow_label  --flowlabel=flow_label 
 +                              Use specified flow_label for IPv6 packets 
 +  -w MAX,HERE,NEAR  --wait=MAX,HERE,NEAR 
 +                              Wait for a probe no more than HERE (default 3) 
 +                              times longer than a response from the same hop, 
 +                              or no more than NEAR (default 10) times than some 
 +                              next hop, or MAX (default 5.0) seconds (float 
 +                              point values allowed too) 
 +  -q nqueries  --queries=nqueries 
 +                              Set the number of probes per each hop. Default is 
 +                              3 
 +  -r                          Bypass the normal routing and send directly to 
 +                              host on an attached network 
 +  -s src_addr  --source=src_addr 
 +                              Use source src_addr for outgoing packets 
 +  -z sendwait  --sendwait=sendwait 
 +                              Minimal time interval between probes (default 0). 
 +                              If the value is more than 10, then it specifies a 
 +                              number in milliseconds, else it is a number of 
 +                              seconds (float point values allowed too) 
 +  -e  --extensions            Show ICMP extensions (if present), including MPLS 
 +  -A  --as-path-lookups       Perform AS path lookups in routing registries and 
 +                              print results directly after the corresponding 
 +                              addresses 
 +  -M name  --module=name      Use specified module (either builtin or external) 
 +                              for traceroute operations. Most methods have 
 +                              their shortcuts (`-Imeans `-M icmp' etc.) 
 +  -O OPTS,...  --options=OPTS,... 
 +                              Use module-specific option OPTS for the 
 +                              traceroute module. Several OPTS allowed, 
 +                              separated by comma. If OPTS is "help", print info 
 +                              about available options 
 +  --sport=num                 Use source port num for outgoing packets. Implies 
 +                              `-N 1' 
 +  --fwmark=num                Set firewall mark for outgoing packets 
 +  -U  --udp                   Use UDP to particular port for tracerouting 
 +                              (instead of increasing the port per each probe), 
 +                              default port is 53 
 +  -UL                         Use UDPLITE for tracerouting (default dest port 
 +                              is 53) 
 +  -D  --dccp                  Use DCCP Request for tracerouting (default port 
 +                              is 33434) 
 +  -P prot  --protocol=prot    Use raw packet of protocol prot for tracerouting 
 +  --mtu                       Discover MTU along the path being tracedImplies 
 +                              `-F -N 1' 
 +  --back                      Guess the number of hops in the backward path and 
 +                              print if it differs 
 +  -V  --version               Print version info and exit 
 +  --help                      Read this help and exit 
 + 
 +Arguments: 
 ++     host          The host to traceroute to 
 +      packetlen     The full packet length (default is the length of an IP 
 +                    header plus 40). Can be ignored or increased to a minimal 
 +                    allowed value
 </code> </code>
  
-Vérifiez que le fichier **.config** a été" créé par l'exécution de makeconfig :+=====LAB #3 - Connexions à Distance===== 
 + 
 +==== 3.1 - Telnet ==== 
 + 
 +WRAP center round important> 
 +**Important** - Si la commande **telnet** n'est pas installée sous CentOS 8, installez-le à l'aide de la commande **dnf install telnet** en tant que root. 
 +</WRAP> 
 + 
 +La commande **telnet** est utilisée pour établir une connexion à distance avec un serveur telnet : 
 + 
 +<file> 
 +  # telnet numero_ip 
 +</file> 
 + 
 +<WRAP center round important 60%> 
 +**Important** - Le service telnet revient à une redirection des canaux standards d'entrée et de sortie. Notez que la connexion n'est **pas** sécurisée. Pour fermer la connexion, il faut saisir la commande **exit**. La commande telnet n'offre pas de services de transfert de fichiers. Pour cela, il convient d'utiliser la command **ftp**. 
 +</WRAP> 
 + 
 +===Options de la commande telnet=== 
 + 
 +Les options de cette commande sont :
  
 <code> <code>
-[trainee@centos8 linux-4.18.0-305.7.1.el8.x86_64]$ ls -a +[[root@centos8 ~]# telnet --help 
-.      certs          configs         Documentation  .get_maintainer.conf    .gitlab-ci.yml  Kbuild   LICENSES     Makefile.rhelver  README       security  virt +telnet: invalid option -- '-' 
-..     .clang-format  COPYING-4.18.0  drivers        .get_maintainer.ignore  include         Kconfig  .mailmap     .mismatches       samples      sound +Usage: telnet [-4] [-6[-8] [-E] [-L] [-S tos] [-a] [-c] [-d] [-e char] [-l user] 
-arch   .cocciconfig   CREDITS         firmware       .gitattributes          init            kernel   MAINTAINERS  mm                .scmversion  tools +        [-n tracefile] [-b hostalias ] [-r]  
-block  .config        crypto          fs             .gitlab-ci-private.yml  ipc             lib      Makefile     net               scripts      usr+ [host-name [port]]
 </code> </code>
  
-Consultez ce fichier :+==== 3.2 - wget ==== 
 + 
 +La commande **wget** est utilisée pour récupérer un fichier via http, https ou ftp 
  
 <code> <code>
-[trainee@centos8 linux-4.18.0-305.7.1.el8.x86_64]$ more .config +[root@centos8 ~]# wget https://www.dropbox.com/s/lqtl47jpj2qu5od/wget_file.txt 
-# +--2021-08-29 06:22:26--  https://www.dropbox.com/s/lqtl47jpj2qu5od/wget_file.txt 
-# Automatically generated file; DO NOT EDIT+Resolving www.dropbox.com (www.dropbox.com)... 162.125.67.18, 2620:100:6023:18::a27d:4312 
-Linux/x86 4.18.0 Kernel Configuration +Connecting to www.dropbox.com (www.dropbox.com)|162.125.67.18|:443... connected. 
-#+HTTP request sent, awaiting response... 301 Moved Permanently 
 +Location: /s/raw/lqtl47jpj2qu5od/wget_file.txt [following] 
 +--2021-08-29 06:22:27--  https://www.dropbox.com/s/raw/lqtl47jpj2qu5od/wget_file.txt 
 +Reusing existing connection to www.dropbox.com:443. 
 +HTTP request sent, awaiting response... 302 Found 
 +Location: https://uc8a5f475f4a5f849fd1055f560f.dl.dropboxusercontent.com/cd/0/inline/BVLLQHvou_Z6M6ahJQIL0h_F294OM7CU4q_am-_dpLy8Ifk66MQQSSe66akMc1yzJ_gMMBw0rHAsccFgTriPPpRvY9gMEBBB9FP3gyf2eT1b7SeonjZZshyppFw9-KxrWTJN_3bRB4Rx_t6DXaozZVnV/file[following] 
 +--2021-08-29 06:22:27--  https://uc8a5f475f4a5f849fd1055f560f.dl.dropboxusercontent.com/cd/0/inline/BVLLQHvou_Z6M6ahJQIL0h_F294OM7CU4q_am-_dpLy8Ifk66MQQSSe66akMc1yzJ_gMMBw0rHAsccFgTriPPpRvY9gMEBBB9FP3gyf2eT1b7SeonjZZshyppFw9-KxrWTJN_3bRB4Rx_t6DXaozZVnV/file 
 +Resolving uc8a5f475f4a5f849fd1055f560f.dl.dropboxusercontent.com (uc8a5f475f4a5f849fd1055f560f.dl.dropboxusercontent.com)... 162.125.67.15, 2620:100:6023:15::a27d:430f 
 +Connecting to uc8a5f475f4a5f849fd1055f560f.dl.dropboxusercontent.com (uc8a5f475f4a5f849fd1055f560f.dl.dropboxusercontent.com)|162.125.67.15|:443... connected. 
 +HTTP request sent, awaiting response... 200 OK 
 +Length: 46 [text/plain] 
 +Saving to: ‘wget_file.txt’
  
-+wget_file.txt       100%[===================>]      46  --.-KB/s    in 0s      
-# Compiler: gcc (GCC) 8.4.1 20200928 (Red Hat 8.4.1-1) +
-+
-CONFIG_64BIT=+
-CONFIG_X86_64=+
-CONFIG_X86=+
-CONFIG_INSTRUCTION_DECODER=+
-CONFIG_OUTPUT_FORMAT="elf64-x86-64" +
-CONFIG_ARCH_DEFCONFIG="arch/x86/configs/x86_64_defconfig" +
-CONFIG_LOCKDEP_SUPPORT=+
-CONFIG_STACKTRACE_SUPPORT=+
-CONFIG_MMU=+
-CONFIG_ARCH_MMAP_RND_BITS_MIN=28 +
-CONFIG_ARCH_MMAP_RND_BITS_MAX=32 +
-CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MIN=+
-CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MAX=16 +
-CONFIG_GENERIC_ISA_DMA=+
-CONFIG_GENERIC_BUG=+
-CONFIG_GENERIC_BUG_RELATIVE_POINTERS=+
-CONFIG_GENERIC_HWEIGHT=+
-CONFIG_ARCH_MAY_HAVE_PC_FDC=+
-CONFIG_GENERIC_CALIBRATE_DELAY=+
-CONFIG_ARCH_HAS_CPU_RELAX=y +
-CONFIG_ARCH_HAS_CACHE_LINE_SIZE=y +
-CONFIG_ARCH_HAS_FILTER_PGPROT=y +
-CONFIG_HAVE_SETUP_PER_CPU_AREA=y +
-CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK=y +
-CONFIG_NEED_PER_CPU_PAGE_FIRST_CHUNK=y +
-CONFIG_ARCH_HIBERNATION_POSSIBLE=y +
-CONFIG_ARCH_SUSPEND_POSSIBLE=y +
-CONFIG_ARCH_WANT_HUGE_PMD_SHARE=y +
-CONFIG_ARCH_WANT_GENERAL_HUGETLB=y +
-CONFIG_ZONE_DMA32=y +
-CONFIG_AUDIT_ARCH=y +
-CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING=y +
-CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y +
-CONFIG_HAVE_INTEL_TXT=y +
-CONFIG_X86_64_SMP=y +
---More--(0%) +
-</code>+
  
-===Le Fichier Makefile===+2021-08-29 06:22:27 (26.9 MB/s) - ‘wget_file.txt’ saved [46/46]
  
-Le fichier **Makefile** contient le nom du noyau et spécifie les informations suivantes :+[root@centos8 ~]# cat wget_file.txt  
 +This is a file retrieved by the wget command. 
 +</code>
  
-  * VERSION, +===Options de la commande wget===
-  * PATCHLEVEL, +
-  * SUBLEVEL, +
-  * EXTRAVERSION.+
  
-Les trois premières informations sont gérées par **kernel.org** et Linus Torvalds en personne tandis que l'EXTRAVERSION est gérée par Red Hat :+Les options de cette commande sont :
  
 <code> <code>
-[trainee@centos8 linux-4.18.0-305.7.1.el8.x86_64]$ more Makefile +[root@centos8 ~]# wget --help 
-# SPDX-License-Identifier: GPL-2.+GNU Wget 1.19.5, a non-interactive network retriever. 
-VERSION = 4 +Usage: wget [OPTION]... [URL]...
-PATCHLEVEL = 18 +
-SUBLEVEL = 0 +
-EXTRAVERSION = +
-NAME = Merciless Moray+
  
-+Mandatory arguments to long options are mandatory for short options too.
-# DRM backport version +
-+
-RHEL_DRM_VERSION = 5 +
-RHEL_DRM_PATCHLEVEL = 9 +
-RHEL_DRM_SUBLEVEL = 14+
  
-# *DOCUMENTATION* +Startup: 
-# To see a list of typical targets execute "make help" +  -V,  --version                   display the version of Wget and exit 
-# More info can be located in ./README +  -h --help                      print this help 
-# Comments in this file are targeted only to the developerdo not +  -b,  --background                go to background after startup 
-# expect to learn how to build the kernel reading this file.+  -e,  --execute=COMMAND           execute a `.wgetrc'-style command
  
-# That's our default target when none is given on the command line +Logging and input file: 
-PHONY :_all +  -o,  --output-file=FILE          log messages to FILE 
-_all:+  -a,  --append-output=FILE        append messages to FILE 
 +  -d,  --debug                     print lots of debugging information 
 +  -q,  --quiet                     quiet (no output) 
 +  -v,  --verbose                   be verbose (this is the default) 
 +  -nv, --no-verbose                turn off verboseness, without being quiet 
 +       --report-speed=TYPE         output bandwidth as TYPE.  TYPE can be bits 
 +  -i,  --input-file=FILE           download URLs found in local or external FILE 
 +       --input-metalink=FILE       download files covered in local Metalink FILE 
 +  -F,  --force-html                treat input file as HTML 
 +  -B,  --base=URL                  resolves HTML input-file links (-i -F) 
 +                                     relative to URL 
 +       --config=FILE               specify config file to use 
 +       --no-config                 do not read any config file 
 +       --rejected-log=FILE         log reasons for URL rejection to FILE
  
-# o Do not use make'built-in rules and variables +Download: 
-#   (this increases performance and avoids hard-to-debug behaviour); +  -t,  --tries=NUMBER              set number of retries to NUMBER (0 unlimits) 
-# o Look for make include files relative to root of kernel src +       --retry-connrefused         retry even if connection is refused 
-MAKEFLAGS += -rR --include-dir=$(CURDIR)+       --retry-on-http-error=ERRORS    comma-separated list of HTTP errors to retry 
 +  -O,  --output-document=FILE      write documents to FILE 
 +  -nc, --no-clobber                skip downloads that would download to 
 +                                     existing files (overwriting them) 
 +       --no-netrc                  don't try to obtain credentials from .netrc 
 +  -c,  --continue                  resume getting a partially-downloaded file 
 +       --start-pos=OFFSET          start downloading from zero-based position OFFSET 
 +       --progress=TYPE             select progress gauge type 
 +       --show-progress             display the progress bar in any verbosity mode 
 +  -N,  --timestamping              don't re-retrieve files unless newer than 
 +                                     local 
 +       --no-if-modified-since      don'use conditional if-modified-since get 
 +                                     requests in timestamping mode 
 +       --no-use-server-timestamps  don't set the local file'timestamp by 
 +                                     the one on the server 
 +  -S,  --server-response           print server response 
 +       --spider                    don't download anything 
 +  -T,  --timeout=SECONDS           set all timeout values to SECONDS 
 +       --dns-timeout=SECS          set the DNS lookup timeout to SECS 
 +       --connect-timeout=SECS      set the connect timeout to SECS 
 +       --read-timeout=SECS         set the read timeout to SECS 
 +  -w,  --wait=SECONDS              wait SECONDS between retrievals 
 +       --waitretry=SECONDS         wait 1..SECONDS between retries of a retrieval 
 +       --random-wait               wait from 0.5*WAIT...1.5*WAIT secs between retrievals 
 +       --no-proxy                  explicitly turn off proxy 
 +  -Q,  --quota=NUMBER              set retrieval quota to NUMBER 
 +       --bind-address=ADDRESS      bind to ADDRESS (hostname or IPon local host 
 +       --limit-rate=RATE           limit download rate to RATE 
 +       --no-dns-cache              disable caching DNS lookups 
 +       --restrict-file-names=OS    restrict chars in file names to ones OS allows 
 +       --ignore-case               ignore case when matching files/directories 
 +  -4,  --inet4-only                connect only to IPv4 addresses 
 +  -6,  --inet6-only                connect only to IPv6 addresses 
 +       --prefer-family=FAMILY      connect first to addresses of specified family, 
 +                                     one of IPv6, IPv4, or none 
 +       --user=USER                 set both ftp and http user to USER 
 +       --password=PASS             set both ftp and http password to PASS 
 +       --ask-password              prompt for passwords 
 +       --use-askpass=COMMAND       specify credential handler for requesting  
 +                                     username and password.  If no COMMAND is  
 +                                     specified the WGET_ASKPASS or the SSH_ASKPASS  
 +                                     environment variable is used. 
 +       --no-iri                    turn off IRI support 
 +       --local-encoding=ENC        use ENC as the local encoding for IRIs 
 +       --remote-encoding=ENC       use ENC as the default remote encoding 
 +       --unlink                    remove file before clobber 
 +       --keep-badhash              keep files with checksum mismatch (append .badhash) 
 +       --metalink-index=NUMBER     Metalink application/metalink4+xml metaurl ordinal NUMBER 
 +       --metalink-over-http        use Metalink metadata from HTTP response headers 
 +       --preferred-location        preferred location for Metalink resources 
 +       --xattr                     turn on storage of metadata in extended file attributes
  
-# Avoid funny character set dependencies +Directories: 
-unexport LC_ALL +  -nd, --no-directories            don't create directories 
-LC_COLLATE=C +  -x,  --force-directories         force creation of directories 
-LC_NUMERIC=C +  -nH, --no-host-directories       don't create host directories 
-export LC_COLLATE LC_NUMERIC+       --protocol-directories      use protocol name in directories 
 +  -P,  --directory-prefix=PREFIX   save files to PREFIX/.. 
 +       --cut-dirs=NUMBER           ignore NUMBER remote directory components
  
-# Avoid interference with shell env settings +HTTP options: 
-unexport GREP_OPTIONS+       --http-user=USER            set http user to USER 
 +       --http-password=PASS        set http password to PASS 
 +       --no-cache                  disallow server-cached data 
 +       --default-page=NAME         change the default page name (normally 
 +                                     this is 'index.html'.) 
 +  -E,  --adjust-extension          save HTML/CSS documents with proper extensions 
 +       --ignore-length             ignore 'Content-Length' header field 
 +       --header=STRING             insert STRING among the headers 
 +       --compression=TYPE          choose compression, one of auto, gzip and none. (default: none) 
 +       --max-redirect              maximum redirections allowed per page 
 +       --proxy-user=USER           set USER as proxy username 
 +       --proxy-password=PASS       set PASS as proxy password 
 +       --referer=URL               include 'Referer: URL' header in HTTP request 
 +       --save-headers              save the HTTP headers to file 
 +  -U,  --user-agent=AGENT          identify as AGENT instead of Wget/VERSION 
 +       --no-http-keep-alive        disable HTTP keep-alive (persistent connections) 
 +       --no-cookies                don't use cookies 
 +       --load-cookies=FILE         load cookies from FILE before session 
 +       --save-cookies=FILE         save cookies to FILE after session 
 +       --keep-session-cookies      load and save session (non-permanent) cookies 
 +       --post-data=STRING          use the POST method; send STRING as the data 
 +       --post-file=FILE            use the POST method; send contents of FILE 
 +       --method=HTTPMethod         use method "HTTPMethod" in the request 
 +       --body-data=STRING          send STRING as data. --method MUST be set 
 +       --body-file=FILE            send contents of FILE. --method MUST be set 
 +       --content-disposition       honor the Content-Disposition header when 
 +                                     choosing local file names (EXPERIMENTAL) 
 +       --content-on-error          output the received content on server errors 
 +       --auth-no-challenge         send Basic HTTP authentication information 
 +                                     without first waiting for the server's 
 +                                     challenge
  
-# Set RHEL variables +HTTPS (SSL/TLS) options: 
-# Use this spot to avoid future merge conflicts +       --secure-protocol=PR        choose secure protocol, one of auto, SSLv2, 
-include Makefile.rhelver+                                     SSLv3, TLSv1, TLSv1_1, TLSv1_2 and PFS 
 +       --https-only                only follow secure HTTPS links 
 +       --no-check-certificate      don't validate the server's certificate 
 +       --certificate=FILE          client certificate file 
 +       --certificate-type=TYPE     client certificate type, PEM or DER 
 +       --private-key=FILE          private key file 
 +       --private-key-type=TYPE     private key type, PEM or DER 
 +       --ca-certificate=FILE       file with the bundle of CAs 
 +       --ca-directory=DIR          directory where hash list of CAs is stored 
 +       --crl-file=FILE             file with bundle of CRLs 
 +       --pinnedpubkey=FILE/HASHES  Public key (PEM/DER) file, or any number 
 +                                   of base64 encoded sha256 hashes preceded by 
 +                                   'sha256//' and separated by ';', to verify 
 +                                   peer against
  
-# We are using a recursive buildso we need to do a little thinking +       --ciphers=STR           Set the priority string (GnuTLS) or cipher list string (OpenSSL) directly. 
---Plus--(2%)+                                   Use with care. This option overrides --secure-protocol. 
 +                                   The format and syntax of this string depend on the specific SSL/TLS engine. 
 +HSTS options: 
 +       --no-hsts                   disable HSTS 
 +       --hsts-file                 path of HSTS database (will override default) 
 + 
 +FTP options: 
 +       --ftp-user=USER             set ftp user to USER 
 +       --ftp-password=PASS         set ftp password to PASS 
 +       --no-remove-listing         don't remove '.listing' files 
 +       --no-glob                   turn off FTP file name globbing 
 +       --no-passive-ftp            disable the "passive" transfer mode 
 +       --preserve-permissions      preserve remote file permissions 
 +       --retr-symlinks             when recursingget linked-to files (not dir) 
 + 
 +FTPS options: 
 +       --ftps-implicit                 use implicit FTPS (default port is 990) 
 +       --ftps-resume-ssl               resume the SSL/TLS session started in the control connection when 
 +                                         opening a data connection 
 +       --ftps-clear-data-connection    cipher the control channel only; all the data will be in plaintext 
 +       --ftps-fallback-to-ftp          fall back to FTP if FTPS is not supported in the target server 
 +WARC options: 
 +       --warc-file=FILENAME        save request/response data to a .warc.gz file 
 +       --warc-header=STRING        insert STRING into the warcinfo record 
 +       --warc-max-size=NUMBER      set maximum size of WARC files to NUMBER 
 +       --warc-cdx                  write CDX index files 
 +       --warc-dedup=FILENAME       do not store records listed in this CDX file 
 +       --no-warc-compression       do not compress WARC files with GZIP 
 +       --no-warc-digests           do not calculate SHA1 digests 
 +       --no-warc-keep-log          do not store the log file in WARC record 
 +       --warc-tempdir=DIRECTORY    location for temporary files created by the 
 +                                     WARC writer 
 + 
 +Recursive download: 
 +  -r,  --recursive                 specify recursive download 
 +  -l,  --level=NUMBER              maximum recursion depth (inf or 0 for infinite) 
 +       --delete-after              delete files locally after downloading them 
 +  -k,  --convert-links             make links in downloaded HTML or CSS point to 
 +                                     local files 
 +       --convert-file-only         convert the file part of the URLs only (usually known as the basename) 
 +       --backups=N                 before writing file X, rotate up to N backup files 
 +  -K,  --backup-converted          before converting file X, back up as X.orig 
 +  -m,  --mirror                    shortcut for -N -r -l inf --no-remove-listing 
 +  -p,  --page-requisites           get all images, etc. needed to display HTML page 
 +       --strict-comments           turn on strict (SGML) handling of HTML comments 
 + 
 +Recursive accept/reject: 
 +  -A,  --accept=LIST               comma-separated list of accepted extensions 
 +  -R,  --reject=LIST               comma-separated list of rejected extensions 
 +       --accept-regex=REGEX        regex matching accepted URLs 
 +       --reject-regex=REGEX        regex matching rejected URLs 
 +       --regex-type=TYPE           regex type (posix) 
 +  -D,  --domains=LIST              comma-separated list of accepted domains 
 +       --exclude-domains=LIST      comma-separated list of rejected domains 
 +       --follow-ftp                follow FTP links from HTML documents 
 +       --follow-tags=LIST          comma-separated list of followed HTML tags 
 +       --ignore-tags=LIST          comma-separated list of ignored HTML tags 
 +  -H,  --span-hosts                go to foreign hosts when recursive 
 +  -L,  --relative                  follow relative links only 
 +  -I,  --include-directories=LIST  list of allowed directories 
 +       --trust-server-names        use the name specified by the redirection 
 +                                     URL's last component 
 +  -X,  --exclude-directories=LIST  list of excluded directories 
 +  -np, --no-parent                 don't ascend to the parent directory 
 + 
 +Email bug reports, questions, discussions to <bug-wget@gnu.org> 
 +and/or open issues at https://savannah.gnu.org/bugs/?func=additem&group=wget.
 </code> </code>
  
-<WRAP center round important> +==== 3.3 - ftp ====
-**Important** - La version 2.6 du noyau a vu le jour en **2003**. Les **SUBLEVEL** se suivaient régulièrement. Avec la version 2.6 du noyau, la valeur paire du **PATCHLEVEL** indiquait que le noyau était stable. Quand vous recompilez le noyau à partir des sources, vous devez modifier la valeur de l'EXTRAVERSION.  Le passage à la version 3.0 fut décidé par Linus Torvalds à l'occasion des 20 ans du noyau Linux. Depuis l'arrivée de la version du noyau, la signification de la valeur de PATCHLEVEL paire et impaire a été abondonnée. +
-</WRAP>+
  
-====2.4 Paramétrage du noyau====+<WRAP center round important 60%> 
 +**Important** Si la commande **ftp** n'est pas installée sous CentOS 8, installez-le à l'aide de la commande **dnf install ftp** en tant que root. 
 +</WRAP>
  
-Insérez la sortie de la commande **uname -i** sur la première ligne du fichier .config :+La commande **ftp** est utilisée pour le transfert de fichiers. Une fois connecté, il convient d'utiliser la commande **help** pour afficher la liste des commandes disponibles :
  
 <code> <code>
-[trainee@centos8 linux-4.18.0-305.7.1.el8.x86_64]$ uname -i +ftp> help 
-x86_64 +Commands may be abbreviated Commands are:
-[trainee@centos8 linux-4.18.0-305.7.1.el8.x86_64]$ vi .config +
-[trainee@centos8 linux-4.18.0-305.7.1.el8.x86_64]$ head .config +
-# x86_64 +
-+
-# Automatically generated file; DO NOT EDIT. +
-# Linux/x86 4.18.0 Kernel Configuration +
-#+
  
-# +! debug mdir sendport site 
-# Compiler: gcc (GCC) 8.4.1 20200928 (Red Hat 8.4.1-1) +$ dir mget put size 
-# +account disconnect mkdir pwd status 
-CONFIG_64BIT=y+append exit mls quit struct 
 +ascii form mode quote system 
 +bell get modtime recv sunique 
 +binary glob mput reget tenex 
 +bye hash newer rstatus tick 
 +case help nmap rhelp trace 
 +cd idle nlist rename type 
 +cdup image ntrans reset user 
 +chmod lcd open restart umask 
 +close ls prompt rmdir verbose 
 +cr macdef passive runique ? 
 +delete mdelete proxy send 
 +ftp> 
 </code> </code>
  
-Renommez le fichier .config en le plaçant dans le répertoire **~/rpmbuild/SOURCES/** :+Le caractère **!** permet d'exécuter une commande sur la machine cliente
  
 <code> <code>
-[trainee@centos8 linux-4.18.0-305.7.1.el8.x86_64]$ cp .config ~/rpmbuild/SOURCES/config-`uname -m`-generic +ftp> !pwd 
-[trainee@centos8 linux-4.18.0-305.7.1.el8.x86_64]$ ls ~/rpmbuild/SOURCES +/root
-centos-ca-secureboot.der  cpupower.config            filter-x86_64.sh                           kernel-s390x.config                mod-extra.list           Module.kabi_s390x +
-centos-dup.x509           cpupower.service           generate_all_configs.sh                    kernel-s390x-debug.config          mod-internal.list        Module.kabi_x86_64 +
-centos-kpatch.x509        debrand-rh-i686-cpu.patch  generate_bls_conf.sh                       kernel-s390x-zfcpdump.config       mod-sign.sh              parallel_xz.sh +
-centos.pem                debrand-rh_taint.patch     kernel-aarch64.config                      kernel-x86_64.config               Module.kabi_aarch64      process_configs.sh +
-centossecureboot001.der   debrand-single-cpu.patch   kernel-aarch64-debug.config                kernel-x86_64-debug.config         Module.kabi_dup_aarch64  x509.genkey +
-centossecureboot201.der   filter-aarch64.sh          kernel-abi-stablelists-4.18.0-305.tar.bz2  kvm_stat.logrotate                 Module.kabi_dup_ppc64le +
-centossecurebootca2.der   filter-modules.sh          kernel-kabi-dw-4.18.0-305.tar.bz2          linux-4.18.0-305.7.1.el8_4.tar.xz  Module.kabi_dup_s390x +
-check-kabi                filter-ppc64le.sh          kernel-ppc64le.config                      linux-kernel-test.patch            Module.kabi_dup_x86_64 +
-config-x86_64-generic     filter-s390x.sh            kernel-ppc64le-debug.config                mod-blacklist.sh                   Module.kabi_ppc64le+
 </code> </code>
  
-Copiez le contenu du répertoire **configs** vers le répertoire **~/rpmbuild/SOURCES/** :+Pour transférer un fichier vers le serveur, il convient d'utiliser la commande **put** : 
 + 
 +<file> 
 +ftp> put nom_fichier_local nom_fichier_distant 
 +</file> 
 + 
 +Vous pouvez également transférer plusieurs fichiers à la fois grâce à la commande **mput**. Dans ce cas précis, il convient de saisir la commande suivante: 
 + 
 +<file> 
 +ftp> mput nom*.* 
 +</file> 
 + 
 +Pour transférer un fichier du serveur, il convient d'utiliser la commande **get** 
 + 
 +<file> 
 +ftp> get nom_fichier 
 +</file> 
 + 
 +Vous pouvez également transférer plusieurs fichiers à la fois grâce à la commande **mget** ( voir la commande **mput** ci-dessus ). 
 + 
 +Pour supprimer un fichier sur le serveur, il convient d'utiliser la commande **del** : 
 + 
 +<file> 
 +ftp> del nom_fichier 
 +</file> 
 + 
 +Pour fermer la session, il convient d'utiliser la commande **quit** :
  
 <code> <code>
-[trainee@centos8 linux-4.18.0-305.7.1.el8.x86_64]$ cp configs/~/rpmbuild/SOURCES/+ftp> quit 
 +[root@centos7 ~]# 
 </code> </code>
  
-Editez la directive **buildid** dans le fichier **~/rpmbuild/SPECS/kernel.spec** :+====3.4 - SSH====
  
-<code> +===Présentation===
-[trainee@centos8 linux-4.18.0-305.7.1.el8.x86_64]$ cd ~/rpmbuild/SPECS+
  
-[trainee@centos8 SPECS]$ vi kernel.spec+La commande **[[wpfr>Ssh|ssh]]** est le successeur et la remplaçante de la commande **[[wpfr>Rlogin|rlogin]]**. Il permet d'établir des connexions sécurisées avec une machine distanteSSH comporte cinq acteurs :
  
-[trainee@centos8 SPECS]$ head -n 50 kernel.spec +  * Le **serveur SSH** 
-# We have to override the new %%install behavior becausewell... the kernel is special. +    * le démon sshdqui s'occupe des authentifications et autorisations des clients,  
-%global __spec_install_pre %{___build_pre}+  * Le **client SSH** 
 +    * ssh ou scp, qui assure la connexion et le dialogue avec le serveur, 
 +  * La **session** qui représente la connexion courante et qui commence juste après l'authentification réussie, 
 +  * Les **clefs** 
 +    * **Couple de clef utilisateur asymétriques** et persistantes qui assurent l'identité d'un utilisateur et qui sont stockés sur disque dur, 
 +    * **Clef hôte asymétrique et persistante** garantissant l'identité du serveur er qui est conservé sur disque dur 
 +    * **Clef serveur asymétrique et temporaire** utilisée par le protocole SSH1 qui sert au chiffrement de la clé de session, 
 +    * **Clef de session symétrique qui est générée aléatoirement** et qui permet le chiiffrement de la communication entre le client et le serveurElle est détruite en fin de sessionSSH-1 utilise une seule clef tandis que SSH-2 utilise une clef par direction de la communication, 
 +  * La **base de données des hôtes connus** qui stocke les clés des connexions précédentes.
  
-# At the time of this writing (2019-03), RHEL8 packages use w2.xzdio +SSH fonctionne de la manière suivante pour la la mise en place d'un canal sécurisé:
-# compression for rpms (xz, level 2). +
-# Kernel has several large (hundreds of mbytes) rpms, they take ~5 mins +
-# to compress by single-threaded xz. Switch to threaded compression, +
-# and from level 2 to 3 to keep compressed sizes close to "w2" results. +
-+
-# NBif default compression in /usr/lib/rpm/redhat/macros ever changes, +
-# this one might need tweaking (e.g. if default changes to w3.xzdio, +
-# change below to w4T.xzdio): +
-%define _binary_payload w3T.xzdio+
  
-# For a kernel released for public testingreleased_kernel should be 1+  * Le client contacte le serveur sur son port 22, 
-# For internal testing builds during developmentit should be 0+  * Les client et le serveur échangent leur version de SSHEn cas de non-compatibilité de versions, l'un des deux met fin au processus, 
-%global released_kernel 1+  * Le serveur SSH s'identifie auprès du client en lui fournissant : 
 +    * Sa clé hôte, 
 +    * Sa clé serveur, 
 +    * Une séquence aléatoire de huit octets à inclure dans les futures réponses du client, 
 +    * Une liste de méthodes de chiffrage, compression et authentification, 
 +  * Le client et le serveur produisent un identifiant identique, un haché MD5 long de 128 bits contenant la clé hôte, la clé serveur et la séquence aléatoire, 
 +  * Le client génère sa clé de session symétrique et la chiffre deux fois de suite, une fois avec la clé hôte du serveur et la deuxième fois avec la clé serveurLe client envoie cette clé au serveur accompagnée de la séquence aléatoire et un choix d'algorithmes supportés, 
 +  * Le serveur déchiffre la clé de session, 
 +  * Le client et le serveur mettent en place le canal sécurisé.
  
-%global distro_build 305+==SSH-1==
  
-# Sign the x86_64 kernel for secure boot authentication +SSH-utilise une paire de clefs de type RSA1. Il assure l'intégrité des données par une **[[wpfr>Contrôle_de_redondance_cyclique|Contrôle de Redondance Cyclique]]** (CRC) et est un bloc dit **monolithique**.
-%ifarch x86_64 aarch64 +
-%global signkernel 1 +
-%else +
-%global signkernel 0 +
-%endif+
  
-# Sign modules on all arches +Afin de s'identifier, le client essaie chacune des six méthodes suivantes :
-%global signmodules 1+
  
-# Compress modules only for architectures that build modules +  * **Kerberos**, 
-%ifarch noarch +  * **Rhosts**, 
-%global zipmodules 0 +  * **%%RhostsRSA%%**, 
-%else +  * Par **clef asymétrique**, 
-%global zipmodules 1 +  * **TIS**, 
-%endif+  * Par **mot de passe**.
  
-%if %{zipmodules} +==SSH-2==
-%global zipsed -e 's/\.ko$/\.ko.xz/' +
-%endif+
  
-%define buildid .i2tch+SSH-2 utilise **DSA** ou **RSA**Il assure l'intégrité des données par l'algorithme **HMAC**. SSH-2 est organisé en trois **couches** :
  
-%define rpmversion 4.18.0 +  * **SSH-TRANS** – Transport Layer Protocol, 
-%define pkgrelease 305.7.1.el8_4+  * **SSH-AUTH** – Authentification Protocol, 
 +  * **SSH-CONN** – Connection Protocol.
  
-# allow pkg_release to have configurable %%{?dist} tag +SSH-2 diffère de SSH-1 essentiellement dans la phase authentification
-%define specrelease 305.7.1%{?dist}+
  
-%define pkg_release %{specrelease}%{?buildid} +Trois méthodes d'authentification :
-</code>+
  
-====2.5 Compiler le Noyau====+  * Par **clef asymétrique**, 
 +    * Identique à SSH-1 sauf avec l'algorithme DSA, 
 +  * **%%RhostsRSA%%**, 
 +  * Par **mot de passe**.
  
-La compilation du noyau peut prendre beaucoup de temps (~5 heures). La commande utilisée est la suivante :+==Options de la commande== 
 + 
 +Les options de cette commande sont :
  
 <code> <code>
-[trainee@centos7 SPECS]$ rpmbuild -bb --target=`uname -m` kernel.spec 2> build-err.log | tee build-out.log &+[root@centos8 ~]# ssh --help 
 +unknown option -- - 
 +usage: ssh [-46AaCfGgKkMNnqsTtVvXxYy] [-B bind_interface] 
 +           [-b bind_address] [-c cipher_spec] [-D [bind_address:]port] 
 +           [-E log_file] [-e escape_char] [-F configfile] [-I pkcs11] 
 +           [-i identity_file] [-J [user@]host[:port]] [-L address] 
 +           [-l login_name] [-m mac_spec] [-O ctl_cmd] [-o option] [-p port] 
 +           [-Q query_option] [-R address] [-S ctl_path] [-W host:port] 
 +           [-w local_tun[:remote_tun]] destination [command]
 </code> </code>
  
-A l'issu du processus, les RPMs se trouvent dans le répertoire **/home/trainee/rpmbuild/RPMS/x86_64/** :+===Authentification par mot de passe===
  
-<code> +L'utilisateur fournit un mot de passe au client sshLe client ssh le transmet de façon sécurisée au serveur ssh puis  le serveur vérifie le mot de passe et l'accepte ou non.
-..+
-Wrote: /home/trainee/rpmbuild/RPMS/x86_64/kernel-4.18.0-305.7.1.el8.i2tch.x86_64.rpm +
-Wrote: /home/trainee/rpmbuild/RPMS/x86_64/kernel-headers-4.18.0-305.7.1.el8.i2tch.x86_64.rpm +
-Wrote: /home/trainee/rpmbuild/RPMS/x86_64/kernel-cross-headers-4.18.0-305.7.1.el8.i2tch.x86_64.rpm +
-Wrote: /home/trainee/rpmbuild/RPMS/x86_64/kernel-debuginfo-common-x86_64-4.18.0-305.7.1.el8.i2tch.x86_64.rpm +
-Wrote: /home/trainee/rpmbuild/RPMS/x86_64/perf-4.18.0-305.7.1.el8.i2tch.x86_64.rpm +
-Wrote: /home/trainee/rpmbuild/RPMS/x86_64/perf-debuginfo-4.18.0-305.7.1.el8.i2tch.x86_64.rpm +
-Wrote: /home/trainee/rpmbuild/RPMS/x86_64/python3-perf-4.18.0-305.7.1.el8.i2tch.x86_64.rpm +
-Wrote: /home/trainee/rpmbuild/RPMS/x86_64/python3-perf-debuginfo-4.18.0-305.7.1.el8.i2tch.x86_64.rpm +
-Wrote: /home/trainee/rpmbuild/RPMS/x86_64/kernel-tools-4.18.0-305.7.1.el8.i2tch.x86_64.rpm +
-Wrote: /home/trainee/rpmbuild/RPMS/x86_64/kernel-tools-libs-4.18.0-305.7.1.el8.i2tch.x86_64.rpm +
-Wrote: /home/trainee/rpmbuild/RPMS/x86_64/kernel-tools-libs-devel-4.18.0-305.7.1.el8.i2tch.x86_64.rpm +
-Wrote: /home/trainee/rpmbuild/RPMS/x86_64/kernel-tools-debuginfo-4.18.0-305.7.1.el8.i2tch.x86_64.rpm +
-Wrote: /home/trainee/rpmbuild/RPMS/x86_64/bpftool-4.18.0-305.7.1.el8.i2tch.x86_64.rpm +
-Wrote: /home/trainee/rpmbuild/RPMS/x86_64/bpftool-debuginfo-4.18.0-305.7.1.el8.i2tch.x86_64.rpm +
-Wrote: /home/trainee/rpmbuild/RPMS/x86_64/kernel-selftests-internal-4.18.0-305.7.1.el8.i2tch.x86_64.rpm +
-Wrote: /home/trainee/rpmbuild/RPMS/x86_64/kernel-debug-core-4.18.0-305.7.1.el8.i2tch.x86_64.rpm +
-Wrote: /home/trainee/rpmbuild/RPMS/x86_64/kernel-debug-4.18.0-305.7.1.el8.i2tch.x86_64.rpm +
-Wrote: /home/trainee/rpmbuild/RPMS/x86_64/kernel-debug-devel-4.18.0-305.7.1.el8.i2tch.x86_64.rpm +
-Wrote: /home/trainee/rpmbuild/RPMS/x86_64/kernel-debug-modules-4.18.0-305.7.1.el8.i2tch.x86_64.rpm +
-Wrote: /home/trainee/rpmbuild/RPMS/x86_64/kernel-debug-modules-extra-4.18.0-305.7.1.el8.i2tch.x86_64.rpm +
-Wrote: /home/trainee/rpmbuild/RPMS/x86_64/kernel-debug-modules-internal-4.18.0-305.7.1.el8.i2tch.x86_64.rpm +
-Wrote: /home/trainee/rpmbuild/RPMS/x86_64/kernel-debug-debuginfo-4.18.0-305.7.1.el8.i2tch.x86_64.rpm +
-Wrote: /home/trainee/rpmbuild/RPMS/x86_64/kernel-core-4.18.0-305.7.1.el8.i2tch.x86_64.rpm +
-Wrote: /home/trainee/rpmbuild/RPMS/x86_64/kernel-devel-4.18.0-305.7.1.el8.i2tch.x86_64.rpm +
-Wrote: /home/trainee/rpmbuild/RPMS/x86_64/kernel-modules-4.18.0-305.7.1.el8.i2tch.x86_64.rpm +
-Wrote: /home/trainee/rpmbuild/RPMS/x86_64/kernel-modules-extra-4.18.0-305.7.1.el8.i2tch.x86_64.rpm +
-Wrote: /home/trainee/rpmbuild/RPMS/x86_64/kernel-modules-internal-4.18.0-305.7.1.el8.i2tch.x86_64.rpm +
-Wrote: /home/trainee/rpmbuild/RPMS/x86_64/kernel-debuginfo-4.18.0-305.7.1.el8.i2tch.x86_64.rpm +
-Wrote: /home/trainee/rpmbuild/RPMS/x86_64/kernel-ipaclones-internal-4.18.0-305.7.1.el8.i2tch.x86_64.rpm +
-Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.rkOgfs+
  
-[1]+  Done                    rpmbuild -bb --target=`uname -m` kernel.spec 2> build-err.log | tee build-out.log +Avantage: 
-</code>+  * Aucune configuration de clef asymétrique n'est nécessaire.
  
-<code> +Inconvénients: 
-[trainee@centos8 SPECS]$ cd ../RPMS +  * L'utilisateur doit fournir à chaque connexion un identifiant et un mot de passe, 
-[trainee@centos8 RPMS]$ ls +  * Moins sécurisé qu'un système par clef asymétrique.
-x86_64 +
-[trainee@centos8 RPMS]$ cd x86_64/ +
-[trainee@centos8 x86_64]$ ls +
-bpftool-4.18.0-305.7.1.el8.i2tch.x86_64.rpm                 kernel-debuginfo-common-x86_64-4.18.0-305.7.1.el8.i2tch.x86_64.rpm  kernel-selftests-internal-4.18.0-305.7.1.el8.i2tch.x86_64.rpm +
-bpftool-debuginfo-4.18.0-305.7.1.el8.i2tch.x86_64.rpm       kernel-debug-modules-4.18.0-305.7.1.el8.i2tch.x86_64.rpm            kernel-tools-4.18.0-305.7.1.el8.i2tch.x86_64.rpm +
-kernel-4.18.0-305.7.1.el8.i2tch.x86_64.rpm                  kernel-debug-modules-extra-4.18.0-305.7.1.el8.i2tch.x86_64.rpm      kernel-tools-debuginfo-4.18.0-305.7.1.el8.i2tch.x86_64.rpm +
-kernel-core-4.18.0-305.7.1.el8.i2tch.x86_64.rpm             kernel-debug-modules-internal-4.18.0-305.7.1.el8.i2tch.x86_64.rpm   kernel-tools-libs-4.18.0-305.7.1.el8.i2tch.x86_64.rpm +
-kernel-cross-headers-4.18.0-305.7.1.el8.i2tch.x86_64.rpm    kernel-devel-4.18.0-305.7.1.el8.i2tch.x86_64.rpm                    kernel-tools-libs-devel-4.18.0-305.7.1.el8.i2tch.x86_64.rpm +
-kernel-debug-4.18.0-305.7.1.el8.i2tch.x86_64.rpm            kernel-headers-4.18.0-305.7.1.el8.i2tch.x86_64.rpm                  perf-4.18.0-305.7.1.el8.i2tch.x86_64.rpm +
-kernel-debug-core-4.18.0-305.7.1.el8.i2tch.x86_64.rpm       kernel-ipaclones-internal-4.18.0-305.7.1.el8.i2tch.x86_64.rpm       perf-debuginfo-4.18.0-305.7.1.el8.i2tch.x86_64.rpm +
-kernel-debug-debuginfo-4.18.0-305.7.1.el8.i2tch.x86_64.rpm  kernel-modules-4.18.0-305.7.1.el8.i2tch.x86_64.rpm                  python3-perf-4.18.0-305.7.1.el8.i2tch.x86_64.rpm +
-kernel-debug-devel-4.18.0-305.7.1.el8.i2tch.x86_64.rpm      kernel-modules-extra-4.18.0-305.7.1.el8.i2tch.x86_64.rpm            python3-perf-debuginfo-4.18.0-305.7.1.el8.i2tch.x86_64.rpm +
-kernel-debuginfo-4.18.0-305.7.1.el8.i2tch.x86_64.rpm        kernel-modules-internal-4.18.0-305.7.1.el8.i2tch.x86_64.rpm +
-</code>+
  
-Notez que la génération du nouveau noyau peut consommer jusqu'à 21 Go d'espace disque :+===Authentification par clef asymétrique===
  
-<code> +  * Le **client** envoie au serveur une requête d'authentification par clé asymétrique qui contient le module de la clé à utiliser, 
-[trainee@centos8 x86_64]$ df -h +  * Le **serveur** recherche une correspondance pour ce module dans le fichier des clés autorisés **~/.ssh/authorized_keys**, 
-Filesystem                   Size  Used Avail Use% Mounted on +    * Dans le cas où une correspondance n'est pas trouvée, le serveur met fin à la communication, 
-devtmpfs                     1.8G      1.8G   0% /dev +    * Dans le cas contraire le serveur génère une chaîne aléatoire de 256 bits appelée un **challenge** et la chiffre avec la **clé publique du client**, 
-tmpfs                        1.9G      1.9G   0% /dev/shm +  * Le **client** reçoit le challenge et le décrypte avec la partie privée de sa cléIl combine le challenge avec l'identifiant de session et chiffre le résultatEnsuite il envoie le résultat chiffré au serveur
-tmpfs                        1.9G  9.4M  1.9G   1% /run +  * Le **serveur** génère le même haché et le compare avec celui reçu du clientSi les deux hachés sont identiques, l'authentification est réussie.
-tmpfs                        1.9G      1.9G   0% /sys/fs/cgroup +
-/dev/mapper/cl_centos8-root   28G  5.5G   23G  20% / +
-/dev/sda1                    976M  289M  620M  32% /boot +
-tmpfs                        374M   24K  374M   1% /run/user/1000 +
-tmpfs                        374M  1.2M  373M   1% /run/user/42 +
-/dev/sdc1                     63G   21G   39G  35% /home +
-</code>+
  
-====2.6 - Installer le Nouveau Noyau====+===Configuration du Serveur===
  
-Installez maintenant les paquets **kernel***. L'installation du noyau peut prendre beaucoup de temps (~2 heures). La commande utilisée est la suivante : :+La configuration du serveur s'effectue dans le fichier **/etc/ssh/sshd_config** :
  
 <code> <code>
-[root@centos8 x86_64]# dnf localinstall kernel-*.rpm +[root@centos8 ~]# cat /etc/ssh/sshd_config 
-Last metadata expiration check2:25:32 ago on Tue 20 Jul 2021 08:37:00 EDT. +#       $OpenBSDsshd_config,1.103 2018/04/09 20:41:22 tj Exp $
-Dependencies resolved. +
-=============================================================================================================================================================================================================== +
- Package                                                       Architecture                          Version                                                 Repository                                   Size +
-=============================================================================================================================================================================================================== +
-Installing: +
- kernel                                                        x86_64                                4.18.0-305.7.1.el8.i2tch                                @commandline                                5.9 M +
- kernel-core                                                   x86_64                                4.18.0-305.7.1.el8.i2tch                                @commandline                                 36 M +
- kernel-cross-headers                                          x86_64                                4.18.0-305.7.1.el8.i2tch                                @commandline                                 11 M +
- kernel-debug                                                  x86_64                                4.18.0-305.7.1.el8.i2tch                                @commandline                                5.9 M +
- kernel-debug-core                                             x86_64                                4.18.0-305.7.1.el8.i2tch                                @commandline                                 63 M +
- kernel-debug-debuginfo                                        x86_64                                4.18.0-305.7.1.el8.i2tch                                @commandline                                683 M +
- kernel-debug-devel                                            x86_64                                4.18.0-305.7.1.el8.i2tch                                @commandline                                 19 M +
- kernel-debug-modules                                          x86_64                                4.18.0-305.7.1.el8.i2tch                                @commandline                                 54 M +
- kernel-debug-modules-extra                                    x86_64                                4.18.0-305.7.1.el8.i2tch                                @commandline                                7.2 M +
- kernel-debug-modules-internal                                 x86_64                                4.18.0-305.7.1.el8.i2tch                                @commandline                                6.3 M +
- kernel-debuginfo                                              x86_64                                4.18.0-305.7.1.el8.i2tch                                @commandline                                570 M +
- kernel-debuginfo-common-x86_64                                x86_64                                4.18.0-305.7.1.el8.i2tch                                @commandline                                 75 M +
- kernel-devel                                                  x86_64                                4.18.0-305.7.1.el8.i2tch                                @commandline                                 18 M +
- kernel-ipaclones-internal                                     x86_64                                4.18.0-305.7.1.el8.i2tch                                @commandline                                 20 +
- kernel-modules                                                x86_64                                4.18.0-305.7.1.el8.i2tch                                @commandline                                 28 M +
- kernel-modules-extra                                          x86_64                                4.18.0-305.7.1.el8.i2tch                                @commandline                                6.5 M +
- kernel-modules-internal                                       x86_64                                4.18.0-305.7.1.el8.i2tch                                @commandline                                6.1 M +
- kernel-selftests-internal                                     x86_64                                4.18.0-305.7.1.el8.i2tch                                @commandline                                 19 M +
- kernel-tools-debuginfo                                        x86_64                                4.18.0-305.7.1.el8.i2tch                                @commandline                                6.2 M +
- kernel-tools-libs-devel                                       x86_64                                4.18.0-305.7.1.el8.i2tch                                @commandline                                5.9 M +
-Downgrading: +
- kernel-headers                                                x86_64                                4.18.0-305.7.1.el8.i2tch                                @commandline                                7.1 M +
- kernel-tools                                                  x86_64                                4.18.0-305.7.1.el8.i2tch                                @commandline                                6.1 M +
- kernel-tools-libs                                             x86_64                                4.18.0-305.7.1.el8.i2tch                                @commandline                                5.9 M+
  
-Transaction Summary +# This is the sshd server system-wide configuration file.  See 
-=============================================================================================================================================================================================================== +# sshd_config(5) for more information.
-Install    20 Packages +
-Downgrade   3 Packages+
  
-Total size1.6 G +# This sshd was compiled with PATH=/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin
-Is this ok [y/N]+
-</code>+
  
-A l'issu de l'installationre-démarrez la VM :+# The strategy used for options in the default sshd_config shipped with 
 +# OpenSSH is to specify options with their default value where 
 +# possiblebut leave them commented.  Uncommented options override the 
 +# default value.
  
-<code> +# If you want to change the port on a SELinux system, you have to tell 
-[root@centos7 ~]reboot +SELinux about this change. 
-</code>+# semanage port -a -t ssh_port_t -p tcp #PORTNUMBER 
 +
 +#Port 22 
 +#AddressFamily any 
 +#ListenAddress 0.0.0.0 
 +#ListenAddress ::
  
-Connectez-vous en tant que trainee et devenez root. Listez ensuite les noyaux installés :+HostKey /etc/ssh/ssh_host_rsa_key 
 +HostKey /etc/ssh/ssh_host_ecdsa_key 
 +HostKey /etc/ssh/ssh_host_ed25519_key
  
-<code> +# Ciphers and keying 
-[root@centos8 ~]rpm -qa | grep kernel +#RekeyLimit default none
-kernel-modules-4.18.0-305.3.1.el8.x86_64 +
-kernel-tools-4.18.0-305.7.1.el8.i2tch.x86_64 +
-kernel-headers-4.18.0-305.7.1.el8.i2tch.x86_64 +
-kernel-debuginfo-4.18.0-305.7.1.el8.i2tch.x86_64 +
-kernel-debug-core-4.18.0-305.7.1.el8.i2tch.x86_64 +
-kernel-modules-internal-4.18.0-305.7.1.el8.i2tch.x86_64 +
-kernel-modules-4.18.0-305.7.1.el8_4.x86_64 +
-kernel-debug-modules-4.18.0-305.7.1.el8.i2tch.x86_64 +
-kernel-devel-4.18.0-305.7.1.el8.i2tch.x86_64 +
-kernel-tools-debuginfo-4.18.0-305.7.1.el8.i2tch.x86_64 +
-kernel-tools-libs-4.18.0-305.7.1.el8.i2tch.x86_64 +
-kernel-debug-modules-internal-4.18.0-305.7.1.el8.i2tch.x86_64 +
-kernel-cross-headers-4.18.0-305.7.1.el8.i2tch.x86_64 +
-kernel-core-4.18.0-305.7.1.el8_4.x86_64 +
-kernel-devel-4.18.0-305.7.1.el8_4.x86_64 +
-kernel-debuginfo-common-x86_64-4.18.0-305.7.1.el8.i2tch.x86_64 +
-kernel-debug-modules-extra-4.18.0-305.7.1.el8.i2tch.x86_64 +
-kernel-debug-devel-4.18.0-305.7.1.el8.i2tch.x86_64 +
-kernel-tools-libs-devel-4.18.0-305.7.1.el8.i2tch.x86_64 +
-kernel-modules-extra-4.18.0-305.7.1.el8.i2tch.x86_64 +
-kernel-4.18.0-305.7.1.el8_4.x86_64 +
-kernel-4.18.0-305.7.1.el8.i2tch.x86_64 +
-kernel-core-4.18.0-305.7.1.el8.i2tch.x86_64 +
-kernel-selftests-internal-4.18.0-305.7.1.el8.i2tch.x86_64 +
-kernel-debug-debuginfo-4.18.0-305.7.1.el8.i2tch.x86_64 +
-kernel-debug-4.18.0-305.7.1.el8.i2tch.x86_64 +
-kernel-4.18.0-305.3.1.el8.x86_64 +
-kernel-core-4.18.0-305.3.1.el8.x86_64 +
-kernel-modules-4.18.0-305.7.1.el8.i2tch.x86_64 +
-kernel-ipaclones-internal-4.18.0-305.7.1.el8.i2tch.x86_64 +
-</code>+
  
-Constatez l'entrée **saved-entry** du fichier **/boot/grub2/grubenv** :+# This system is following system-wide crypto policy. The changes to 
 +# crypto properties (Ciphers, MACs, ...) will not have any effect here. 
 +# They will be overridden by command-line options passed to the server 
 +# on command line. 
 +# Please, check manual pages for update-crypto-policies(8) and sshd_config(5).
  
-<code> +# Logging 
-[root@centos8 ~]grep i2tch /boot/grub2/grubenv  +#SyslogFacility AUTH 
-saved_entry=95bd69e34a7444a7b58cb74fbfb86df2-4.18.0-305.7.1.el8.i2tch.x86_64 +SyslogFacility AUTHPRIV 
-</code>+#LogLevel INFO
  
-Dernièrement, vérifiez l'utilisation du nouveau noyau :+# Authentication:
  
-<code> +#LoginGraceTime 2m 
-[root@centos8 ~]uname -r +PermitRootLogin yes 
-4.18.0-305.7.1.el8.i2tch.x86_64 +#StrictModes yes 
-</code>+#MaxAuthTries 6 
 +#MaxSessions 10
  
-=====LAB #3 - Gestion des Quotas=====+#PubkeyAuthentication yes
  
-Sous Linux il est possible de mettre en place des quotas par utilisateur et par groupeCeci étant, Linux ne sait  pas gérer des quotas par répertoire, uniquement des  +# The default is to check both .ssh/authorized_keys and .ssh/authorized_keys2 
-quotas par partitionL'administrateur met souvent des quotas en place sur l'arborescence de /home pour limiter l'espace de stockage occupé par les utilisateurs.+# but this is overridden so installations will only check .ssh/authorized_keys 
 +AuthorizedKeysFile      .ssh/authorized_keys
  
-Déconnectez-vous et reconnectez-vous **directement** en tant que root :+#AuthorizedPrincipalsFile none
  
-<code> +#AuthorizedKeysCommand none 
-root@computeXX:~ssh -l root 10.0.2.45 +#AuthorizedKeysCommandUser nobody
-root@10.0.2.45's password: fenestros +
-Activate the web console with: systemctl enable --now cockpit.socket+
  
-Last login: Wed Jul 21 11:14:31 2021 +# For this to work you will also need host keys in /etc/ssh/ssh_known_hosts 
-[root@centos8 ~]#  +#HostbasedAuthentication no 
-</code>+# Change to yes if you don't trust ~/.ssh/known_hosts for 
 +HostbasedAuthentication 
 +#IgnoreUserKnownHosts no 
 +# Don't read the user's ~/.rhosts and ~/.shosts files 
 +#IgnoreRhosts yes
  
-Avant de mettre en place des quotasconfigurer SELINUX en mode **permissive** afin de ne pas avoir d'erreurs de ce dernier :+# To disable tunneled clear text passwordschange to no here! 
 +#PasswordAuthentication yes 
 +#PermitEmptyPasswords no 
 +PasswordAuthentication yes
  
-<code> +Change to no to disable s/key passwords 
-[root@centos8 ~]getenforce +#ChallengeResponseAuthentication yes 
-Enforcing +ChallengeResponseAuthentication no
-[root@centos8 ~]setenforce permissive +
-[root@centos8 ~]# getenforce +
-Permissive +
-[root@centos8 ~]#  +
-</code>+
  
-Editez ensuite le fichier /etc/sysconfig/selinux ainsi :+# Kerberos options 
 +#KerberosAuthentication no 
 +#KerberosOrLocalPasswd yes 
 +#KerberosTicketCleanup yes 
 +#KerberosGetAFSToken no 
 +#KerberosUseKuserok yes
  
-<code> +# GSSAPI options 
-[root@centos8 ~]vi /etc/sysconfig/selinux +GSSAPIAuthentication yes 
-[root@centos8 ~]cat /etc/sysconfig/selinux+GSSAPICleanupCredentials no 
 +#GSSAPIStrictAcceptorCheck yes 
 +#GSSAPIKeyExchange no 
 +#GSSAPIEnablek5users no
  
-This file controls the state of SELinux on the system+Set this to 'yes' to enable PAM authentication, account processing, 
-SELINUX= can take one of these three values: +# and session processingIf this is enabled, PAM authentication will 
-    enforcing - SELinux security policy is enforced+be allowed through the ChallengeResponseAuthentication and 
-    permissive - SELinux prints warnings instead of enforcing. +PasswordAuthentication Depending on your PAM configuration, 
-    disabled No SELinux policy is loaded. +PAM authentication via ChallengeResponseAuthentication may bypass 
-SELINUX=permissive +the setting of "PermitRootLogin without-password"
-SELINUXTYPE= can take one of these three values: +If you just want the PAM account and session checks to run without 
-    targeted - Targeted processes are protected+PAM authenticationthen enable this but set PasswordAuthentication 
-    minimum - Modification of targeted policy. Only selected processes are protected.  +and ChallengeResponseAuthentication to 'no'
-    mls - Multi Level Security protection+WARNING: 'UsePAM no' is not supported in Fedora and may cause several 
-SELINUXTYPE=targeted+# problems
 +UsePAM yes
  
-</code>+#AllowAgentForwarding yes 
 +#AllowTcpForwarding yes 
 +#GatewayPorts no 
 +X11Forwarding yes 
 +#X11DisplayOffset 10 
 +#X11UseLocalhost yes 
 +#PermitTTY yes
  
-Commencez par vérifiez que le paquet **quota** est bien installé :+# It is recommended to use pam_motd in /etc/pam.d/sshd instead of PrintMotd, 
 +# as it is more configurable and versatile than the built-in version. 
 +PrintMotd no
  
-<code> +#PrintLastLog yes 
-[root@centos8 ~]rpm -qa | grep quota +#TCPKeepAlive yes 
-quota-4.04-12.el8.x86_64 +#PermitUserEnvironment no 
-quota-nls-4.04-12.el8.noarch +#Compression delayed 
-</code>+#ClientAliveInterval 0 
 +#ClientAliveCountMax 3 
 +#UseDNS no 
 +#PidFile /var/run/sshd.pid 
 +#MaxStartups 10:30:100 
 +#PermitTunnel no 
 +#ChrootDirectory none 
 +#VersionAddendum none
  
-Editez le fichier **/etc/fstab** en ajoutant les options **usrquota** et **grpquota** à la ligne **/home** :+# no default banner path 
 +#Banner none
  
-<code> +Accept locale-related environment variables 
-[root@centos8 ~]vi /etc/fstab +AcceptEnv LANG LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES 
-[root@centos8 ~]# cat /etc/fstab+AcceptEnv LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT 
 +AcceptEnv LC_IDENTIFICATION LC_ALL LANGUAGE 
 +AcceptEnv XMODIFIERS
  
-+override default of no subsystems 
-/etc/fstab +Subsystem       sftp    /usr/libexec/openssh/sftp-server 
-Created by anaconda on Wed Jun 16 06:21:32 2021 + 
-+Example of overriding settings on a per-user basis 
-Accessible filesystems, by reference, are maintained under '/dev/disk/'. +#Match User anoncvs 
-See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info. +      X11Forwarding no 
-+      AllowTcpForwarding no 
-After editing this file, run 'systemctl daemon-reload' to update systemd +      PermitTTY no 
-# units generated from this file. +      ForceCommand cvs server
-+
-/dev/mapper/cl_centos8-root /                       xfs     defaults        0 0 +
-UUID=1c04981e-5317-4b73-9695-3ce25246835d /boot                   ext4    defaults        1 2 +
-/dev/mapper/cl_centos8-swap swap                    swap    defaults        0 0 +
-UUID=f76d6b66-985b-4a91-af9c-4987e8c1443c /home     ext4          defaults,usrquota,grpquota            1 2+
 </code> </code>
  
-Redémarrez la VM :+Pour ôter les lignes de commentaires dans ce fichier, utilisez la commande suivante :
  
 <code> <code>
-[root@centos8 ~]# reboot+[root@centos8 ~]# cd /tmp ; grep -E -v '^(#|$)'  /etc/ssh/sshd_config > sshd_config 
 +[root@centos8 tmp]# cat sshd_config  
 +HostKey /etc/ssh/ssh_host_rsa_key 
 +HostKey /etc/ssh/ssh_host_ecdsa_key 
 +HostKey /etc/ssh/ssh_host_ed25519_key 
 +SyslogFacility AUTHPRIV 
 +PermitRootLogin yes 
 +AuthorizedKeysFile      .ssh/authorized_keys 
 +PasswordAuthentication yes 
 +ChallengeResponseAuthentication no 
 +GSSAPIAuthentication yes 
 +GSSAPICleanupCredentials no 
 +UsePAM yes 
 +X11Forwarding yes 
 +PrintMotd no 
 +AcceptEnv LANG LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES 
 +AcceptEnv LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT 
 +AcceptEnv LC_IDENTIFICATION LC_ALL LANGUAGE 
 +AcceptEnv XMODIFIERS 
 +Subsystem       sftp    /usr/libexec/openssh/sftp-server
 </code> </code>
  
-Reconnectez-vous **directement** en tant que root :+Pour sécuriser le serveur ssh, ajoutez ou modifiez les directives suivantes :
  
-<code+<file
-root@computeXX:~# ssh -l root 10.0.2.45 +AllowGroups adm 
-root@10.0.2.45's password: fenestros +Banner /etc/issue.net 
-Activate the web console with: systemctl enable --now cockpit.socket+HostbasedAuthentication no 
 +IgnoreRhosts yes 
 +LoginGraceTime 60 
 +LogLevel INFO 
 +PermitEmptyPasswords no 
 +PermitRootLogin no 
 +PrintLastLog yes 
 +Protocol 
 +StrictModes yes 
 +X11Forwarding no 
 +</file>
  
-Last loginWed Jul 21 11:19:46 2021 +Votre fichier ressemblera à celui-ci : 
-[root@centos8 ~]# + 
 +<code> 
 +[root@centos8 tmp]# vi sshd_config  
 +[root@centos8 tmp]# cat sshd_config  
 +AllowGroups adm 
 +Banner /etc/issue.net 
 +HostbasedAuthentication no 
 +IgnoreRhosts yes 
 +LoginGraceTime 60 
 +LogLevel INFO 
 +PermitEmptyPasswords no 
 +PermitRootLogin no 
 +PrintLastLog yes 
 +Protocol 2 
 +StrictModes yes 
 +X11Forwarding no 
 +HostKey /etc/ssh/ssh_host_rsa_key 
 +HostKey /etc/ssh/ssh_host_ecdsa_key 
 +HostKey /etc/ssh/ssh_host_ed25519_key 
 +SyslogFacility AUTHPRIV 
 +PermitRootLogin yes 
 +AuthorizedKeysFile      .ssh/authorized_keys 
 +PasswordAuthentication yes 
 +ChallengeResponseAuthentication no 
 +GSSAPIAuthentication yes 
 +GSSAPICleanupCredentials no 
 +UsePAM yes 
 +PrintMotd no 
 +AcceptEnv LANG LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES 
 +AcceptEnv LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT 
 +AcceptEnv LC_IDENTIFICATION LC_ALL LANGUAGE 
 +AcceptEnv XMODIFIERS 
 +Subsystem       sftp    /usr/libexec/openssh/sftp-server
 </code> </code>
  
-Vérifiez ensuite que les options **usrquota** et **grpquota** soient prises en compte :+Renommez le fichier **/etc/ssh/sshd_config** en **/etc/ssh/sshd_config.old** :
  
 <code> <code>
-[root@centos8 ~]# cat /etc/mtab | grep /home +[root@centos8 tmp]# cp /etc/ssh/sshd_config /etc/ssh/sshd_config.old
-/dev/sdc1 /home ext4 rw,seclabel,relatime,quota,usrquota,grpquota 0 0+
 </code> </code>
  
-====3.1 - La Commande quotacheck==== +Copiez le fichier **/tmp/sshd_config** vers **/etc/ssh/** :
- +
-Pour activer les quotas sur /home, il convient d'utiliser la commande **quotacheck** :+
  
 <code> <code>
-[root@centos8 ~]# quotacheck -cugvm -f /dev/sdc1 +[root@centos8 tmp]# cp /tmp/sshd_config /etc/ssh 
-quotacheck: Your kernel probably supports journaled quota but you are not using it. Consider switching to journaled quota to avoid running quotacheck after an unclean shutdown. +cpoverwrite '/etc/ssh/sshd_config'? y
-quotacheck: Scanning /dev/sdc1 [/home] done +
-quotacheckCannot stat old user quota file /home/aquota.user: No such file or directory. Usage will not be subtracted. +
-quotacheck: Cannot stat old group quota file /home/aquota.group: No such file or directory. Usage will not be subtracted. +
-quotacheck: Cannot stat old user quota file /home/aquota.user: No such file or directory. Usage will not be subtracted. +
-quotacheck: Cannot stat old group quota file /home/aquota.group: No such file or directory. Usage will not be subtracted. +
-quotacheck: Checked 6763 directories and 129772 files +
-quotacheck: Old file not found. +
-quotacheck: Old file not found.+
 </code> </code>
  
-Les options de la commande quotacheck sont :+Redémarrez le service sshd :
  
 <code> <code>
-[root@centos8 ~]# quotacheck --help +[root@centos8 tmp]# systemctl restart sshd 
-Utility for checking and repairing quota files+[root@centos8 tmp]# systemctl status sshd 
-quotacheck [-gucbfinvdmMR] [-F <quota-format>] filesystem|-a+● sshd.service OpenSSH server daemon 
 +   Loaded: loaded (/usr/lib/systemd/system/sshd.service; enabled; vendor preset: enabled) 
 +   Active: active (running) since Mon 2021-08-30 02:17:00 EDT; 11s ago 
 +     Docs: man:sshd(8) 
 +           man:sshd_config(5) 
 + Main PID: 1042039 (sshd) 
 +    Tasks: 1 (limit: 23535) 
 +   Memory: 1.1M 
 +   CGroup: /system.slice/sshd.service 
 +           └─1042039 /usr/sbin/sshd --oCiphers=aes256-gcm@openssh.com,chacha20-poly1305@openssh.com,aes256-ctr,aes256-cbc,aes128-gcm@openssh.com,a>
  
--u, --user                check user files +Aug 30 02:17:00 centos8.ittraining.loc systemd[1]: Starting OpenSSH server daemon... 
--g, --group               check group files +Aug 30 02:17:00 centos8.ittraining.loc sshd[1042039]: Server listening on 0.0.0.0 port 22. 
--c, --create-files        create new quota files +Aug 30 02:17:00 centos8.ittraining.loc sshd[1042039]: Server listening on :: port 22. 
--b, --backup              create backups of old quota files +Aug 30 02:17:00 centos8.ittraining.loc systemd[1]: Started OpenSSH server daemon. 
--f, --force               force check even if quotas are enabled +[q]
--i, --interactive         interactive mode +
--n, --use-first-dquot     use the first copy of duplicated structure +
--v, --verbose             print more information +
--d, --debug               print even more messages +
--m, --no-remount          do not remount filesystem read-only +
--M, --try-remount         try remounting filesystem read-only, +
-                          continue even if it fails +
--R, --exclude-root        exclude root when checking all filesystems +
--F, --format=formatname   check quota files of specific format +
--a, --all                 check all filesystems +
--h, --help                display this message and exit +
--V, --version             display version information and exit +
- +
-Bugs to jack@suse.cz+
 </code> </code>
  
-Les quotas ont été activés et les fichier **aquota.user** et **aquota.group** ont été créés dans le répertoire /home :+Mettez l'utilisateur **trainee** dans le groupe **adm** :
  
 <code> <code>
-[root@centos8 ~]# ls -la /home +[root@centos8 tmp]# groups trainee 
-total 40 +trainee trainee 
-drwxr-xr-x.  4 root    root     4096 Jul 21 11:27 . +[root@centos8 tmp]# usermod -aG adm trainee 
-dr-xr-xr-x. 17 root    root      224 Jul 19 12:05 .. +[root@centos8 tmp]# groups trainee 
--rw-------.  1 root    root     7168 Jul 21 11:27 aquota.group +trainee : trainee adm
--rw-------. root    root     7168 Jul 21 11:27 aquota.user +
-drwx------.  2 root    root    16384 Jul 19 12:02 lost+found +
-drwxr-xr-x. 17 trainee trainee  4096 Jul 21 11:22 trainee +
 </code> </code>
  
-Créez maintenant un utilisateur **fenestros** avec le mot de passe **fenestros** :+Pour générer les clefs du serveur, saisissez la commande suivante en tant que **root**. Notez que la passphrase doit être **vide**.
  
 <code> <code>
-[root@centos8 ~]# groupadd fenestros && useradd fenestros -c FenestrOs -/home/fenestros -g fenestros -s /bin/bash +[root@centos8 tmp]# ssh-keygen -t dsa 
-[root@centos8 ~]# passwd fenestros +Generating public/private dsa key pair. 
-Changing password for user fenestros+Enter file in which to save the key (/root/.ssh/id_dsa): /etc/ssh/ssh_host_dsa_key 
-New password:  +Enter passphrase (empty for no passphrase):  
-BAD PASSWORD: The password contains the user name in some form +Enter same passphrase again:  
-Retype new password:  +Your identification has been saved in /etc/ssh/ssh_host_dsa_key. 
-passwd: all authentication tokens updated successfully+Your public key has been saved in /etc/ssh/ssh_host_dsa_key.pub. 
-</code>+The key fingerprint is: 
 +SHA256:dywC6jKyIMaTxsaEamz1kmthEmuG18HxmS22qRICOYk root@centos8.ittraining.loc 
 +The key's randomart image is: 
 ++---[DSA 1024]----+ 
 +|                 | 
 +|               | 
 +|.o . o.+         | 
 +|E.  o.*..  .     | 
 +|+ooo.o +S o o    | 
 +|X==++ o  o o     | 
 +|B/=+oo           | 
 +|Ooo++            | 
 +|.o             | 
 ++----[SHA256]-----+ 
 +</code> 
  
-====3.La Commande edquota====+De la même façon, il est possible de générer les clefs au format **[[https://fr.wikipedia.org/wiki/Chiffrement_RSA|RSA]]**, **[[https://fr.wikipedia.org/wiki/Elliptic_curve_digital_signature_algorithm|ECDSA]]** et **[[https://fr.wikipedia.org/wiki/EdDSA|ED25519]]** : 
 + 
 +<code> 
 +[root@centos8 tmp]# ssh-keygen -t rsa 
 +Generating public/private rsa key pair. 
 +Enter file in which to save the key (/root/.ssh/id_rsa): /etc/ssh/ssh_host_rsa_key 
 +Enter passphrase (empty for no passphrase):  
 +Enter same passphrase again:  
 +Your identification has been saved in /etc/ssh/ssh_host_rsa_key. 
 +Your public key has been saved in /etc/ssh/ssh_host_rsa_key.pub. 
 +The key fingerprint is: 
 +SHA256:8jXFK50NnoJCz9E7aPKpFYSYCstCPfRsdmlLBTNUnKg root@centos8.ittraining.loc 
 +The key's randomart image is: 
 ++---[RSA 3072]----+ 
 +|    .==o.      | 
 +|  o oo o=+ .     | 
 +|.. oo=+=o +    | 
 +|oo .+E++.+ = *   | 
 +|o..   +.S B * .  | 
 +|.      B + =     | 
 +|        =        | 
 +|               | 
 +|      .          | 
 ++----[SHA256]-----+ 
 +[root@centos8 tmp]# ssh-keygen -t ecdsa 
 +Generating public/private ecdsa key pair. 
 +Enter file in which to save the key (/root/.ssh/id_ecdsa): /etc/ssh/ssh_host_ecdsa_key 
 +Enter passphrase (empty for no passphrase):  
 +Enter same passphrase again:  
 +Your identification has been saved in /etc/ssh/ssh_host_ecdsa_key. 
 +Your public key has been saved in /etc/ssh/ssh_host_ecdsa_key.pub. 
 +The key fingerprint is: 
 +SHA256:AMqFUJKGqnUEPh/IYda0wnbW1kXK+lnprpHsOo4UMbI root@centos8.ittraining.loc 
 +The key's randomart image is: 
 ++---[ECDSA 256]---
 +|++*=+    .o      | 
 +|oX.=o+ o o       | 
 +|o %.B + +        | 
 +|...O.o       | 
 +|..E.o . S o      | 
 +|.    . o       | 
 +|    .   * .      | 
 +|   . ... o       | 
 +|    ..ooo..      | 
 ++----[SHA256]-----+ 
 +[root@centos8 tmp]# ssh-keygen -t ed25519 
 +Generating public/private ed25519 key pair. 
 +Enter file in which to save the key (/root/.ssh/id_ed25519): /etc/ssh/ssh_host_ed25519_key 
 +Enter passphrase (empty for no passphrase):  
 +Enter same passphrase again:  
 +Your identification has been saved in /etc/ssh/ssh_host_ed25519_key. 
 +Your public key has been saved in /etc/ssh/ssh_host_ed25519_key.pub. 
 +The key fingerprint is: 
 +SHA256:CtbcN9iXv00PfbHFGf2bEW7iRibOFwRctyqM5hmlhwE root@centos8.ittraining.loc 
 +The key's randomart image is: 
 ++--[ED25519 256]--+ 
 +|        .... . | 
 +|        .  .. . o| 
 +|         . . . +.| 
 +|     o . oB ..o.=| 
 +|    o o S*+=o* *+| 
 +|   . . .o.*o*.+.B| 
 +|      .  o o +o++| 
 +|            o  =o| 
 +|              . o| 
 ++----[SHA256]-----+ 
 +</code>
  
-Mettez en place maintenant un quota de 10Mo pour l'utilisateur **fenestros** :+Les clefs publiques générées possèdent l'extension **.pub**. Les clefs privées n'ont pas d'extension :
  
 <code> <code>
-[root@centos8 ~]# edquota -u fenestros -f /home+[root@centos8 tmp]# ls /etc/ssh 
 +moduli      ssh_config.d  sshd_config.old     ssh_host_ecdsa_key.pub  ssh_host_ed25519_key.pub  ssh_host_rsa_key.pub 
 +ssh_config  sshd_config   ssh_host_ecdsa_key  ssh_host_ed25519_key    ssh_host_rsa_key
 </code> </code>
  
-L'éditeur **vi** se lance et vous obtiendrez un résultat similaire à celui-ci :+Re-démarrez ensuite le service sshd :
  
-<file+<code
-Disk quotas for user fenestros (uid 1001): +[root@centos8 tmp]# systemctl restart sshd.service 
-  Filesystem                   blocks       soft       hard     inodes     soft     hard +[root@centos8 tmp]# systemctl status sshd.service 
-  /dev/sdc1                                  0          0          0        0        0 +● sshd.service - OpenSSH server daemon 
-</file>+   Loaded: loaded (/usr/lib/systemd/system/sshd.service; enabled; vendor preset: enabled) 
 +   Activeactive (running) since Mon 2021-08-30 02:24:57 EDT; 9s ago 
 +     Docs: man:sshd(8) 
 +           man:sshd_config(5) 
 + Main PID: 1042204 (sshd) 
 +    Tasks: 1 (limit: 23535) 
 +   Memory: 1.1M 
 +   CGroup: /system.slice/sshd.service 
 +           └─1042204 /usr/sbin/sshd -D -oCiphers=aes256-gcm@openssh.com,chacha20-poly1305@openssh.com,aes256-ctr,aes256-cbc,aes128-gcm@openssh.com,a>
  
-Modifiez ce fichier ainsi :+Aug 30 02:24:57 centos8.ittraining.loc systemd[1]: Starting OpenSSH server daemon... 
 +Aug 30 02:24:57 centos8.ittraining.loc sshd[1042204]: Server listening on 0.0.0.0 port 22. 
 +Aug 30 02:24:57 centos8.ittraining.loc sshd[1042204]: Server listening on :: port 22. 
 +Aug 30 02:24:57 centos8.ittraining.loc systemd[1]: Started OpenSSH server daemon. 
 +[q] 
 +</code>
  
-<file> +===Configuration du Client===
-Disk quotas for user fenestros (uid 1001): +
-  Filesystem                   blocks       soft       hard     inodes     soft     hard +
-  /dev/sdc1                               8000      10000          0        0        0 +
-</file>+
  
-Sauvegardez et quittez le fichier.+Saisissez maintenant les commandes suivantes en tant que **trainee** :
  
-Les options de la commande **edquota** sont :+<WRAP center round important 60%> 
 +**Important** - Lors de la génération des clefs, la passphrase doit être **vide**
 +</WRAP>
  
 <code> <code>
-[root@centos8 ~]# edquota --help +[root@centos8 tmp]# exit 
-edquota: Usage: +logout 
-        edquota [-rm[-u] [-F formatname] [-p username] [-f filesystem] username ... +[trainee@centos8 ~]$ ssh-keygen -t dsa 
-        edquota [-rm] -g [-F formatname] [-p groupname] [-f filesystem] groupname ... +Generating public/private dsa key pair. 
-        edquota [-rm] -P [-F formatname] [-p projectname[-f filesystem] projectname ... +Enter file in which to save the key (/home/trainee/.ssh/id_dsa):  
-        edquota [-u|g|-P] [-F formatname] [-f filesystem] -+Created directory '/home/trainee/.ssh'
-        edquota [-u|g|-P] [-F formatname] [-f filesystem] -T username|groupname|projectname ...+Enter passphrase (empty for no passphrase):  
 +Enter same passphrase again:  
 +Your identification has been saved in /home/trainee/.ssh/id_dsa. 
 +Your public key has been saved in /home/trainee/.ssh/id_dsa.pub
 +The key fingerprint is: 
 +SHA256:Qd17X1iROjk5rLOQBbyVg1hNXkUdTeiFtEpn3rgPKc4 trainee@centos8.ittraining.loc 
 +The key's randomart image is: 
 ++---[DSA 1024]----+ 
 +|        =o+o.o+OB| 
 +|       o +o=o oo=| 
 +|        +.+oB+ | 
 +|         o o.&+o.| 
 +       S o o.*.o| 
 +        o o   o.| 
 +|          . + +  | 
 +|           + . o | 
 +|            E   .| 
 ++----[SHA256]-----+ 
 +[trainee@centos8 ~]$ ssh-keygen -t rsa 
 +Generating public/private rsa key pair.
  
--u, --user                    edit user data +Enter file in which to save the key (/home/trainee/.ssh/id_rsa): Enter passphrase (empty for no passphrase):  
--g, --group                   edit group data +Enter same passphrase again:  
--P, --project                 edit project data +Your identification has been saved in /home/trainee/.ssh/id_rsa. 
--r, --remote                  edit remote quota (via RPC) +Your public key has been saved in /home/trainee/.ssh/id_rsa.pub. 
--m, --no-mixed-pathnames      trim leading slashes from NFSv4 mountpoints +The key fingerprint is: 
--F, --format=formatname       edit quotas of a specific format +SHA256:BgEjoWQrGCzdJfyZczVZYVoafiHsz9GK5PDWuywG/z0 trainee@centos8.ittraining.loc 
--p, --prototype=name          copy data from a prototype user/group +The key's randomart image is: 
-    --always-resolve          always try to resolve name, even if it is ++---[RSA 3072]----+ 
-                              composed only of digits +|o+o++oo  .oo*.   | 
--f, --filesystem=filesystem   edit data only on a specific filesystem +|=+o.oo . .=B .   | 
--t, --edit-period             edit grace period +|=.   ..o o+...   | 
--T, --edit-times              edit grace time of a user/group +|.     =.o o.. .  | 
--h, --help                    display this help text and exit +|       oS= = o   | 
--V, --version                 display version information and exit+|       .. = =    | 
 +|             | 
 +|          +...E  | 
 +|         . o+... | 
 ++----[SHA256]-----
 +[trainee@centos8 ~]$ ssh-keygen -t ecdsa 
 +Generating public/private ecdsa key pair. 
 +Enter file in which to save the key (/home/trainee/.ssh/id_ecdsa):  
 +Enter passphrase (empty for no passphrase):  
 +Enter same passphrase again:  
 +Your identification has been saved in /home/trainee/.ssh/id_ecdsa. 
 +Your public key has been saved in /home/trainee/.ssh/id_ecdsa.pub. 
 +The key fingerprint is: 
 +SHA256:mpBDgsCxP2DqRPkmGvXHpNnvm5B+Cl7MSiiZKfDjWLk trainee@centos8.ittraining.loc 
 +The key's randomart image is: 
 ++---[ECDSA 256]---+ 
 +|o..              | 
 +|.oo              | 
 +|.*o . .          | 
 +|+.++ B           | 
 +|+o =B + S        | 
 +|=*oo.* =         | 
 +|B.* o O .        | 
 +|.= = o..       | 
 +|. E o oo+.       | 
 ++----[SHA256]-----+ 
 +[trainee@centos8 ~]$ ssh-keygen -t ed25519 
 +Generating public/private ed25519 key pair. 
 +Enter file in which to save the key (/home/trainee/.ssh/id_ed25519):  
 +Enter passphrase (empty for no passphrase):  
 +Enter same passphrase again:  
 +Your identification has been saved in /home/trainee/.ssh/id_ed25519. 
 +Your public key has been saved in /home/trainee/.ssh/id_ed25519.pub. 
 +The key fingerprint is: 
 +SHA256:JfFxG2mg9feAvFGxoxZ8uSsON3sXvtYQYYg5iVxzZS4 trainee@centos8.ittraining.loc 
 +The key's randomart image is: 
 ++--[ED25519 256]--+ 
 +|       ..o*=++=. | 
 +|        o==O+Boo | 
 +|        o ooE.O. | 
 +|           O.= | 
 +|        S   + ...| 
 +|            .o | 
 +|          . + o.o| 
 +|           + +.oo| 
 +|            o..o.| 
 ++----[SHA256]-----
 +</code>
  
-Bugs tojack@suse.cz+Les clés générées seront placées dans le répertoire **~/.ssh/** : 
 + 
 +<code> 
 +[trainee@centos8 ~]$ ls .ssh 
 +id_dsa  id_dsa.pub  id_ecdsa  id_ecdsa.pub  id_ed25519  id_ed25519.pub  id_rsa  id_rsa.pub
 </code> </code>
  
-<WRAP center round important> +===Tunnels SSH=== 
-**Important** - Pour mettre en place un quota par groupla procédure est similaireIl suffit d'utiliser l'option -g de la commande edquota+ 
-</WRAP>+Le protocole SSH peut être utilisé pour sécuriser les protocoles tels telnetpop3 etc.. En effet, on peut créer un //tunnel// SSH dans lequel passe les communications du protocole non-sécurisé
 + 
 +La commande pour créer un tunnel ssh prend la forme suivante :
  
-====3.3 La Commande quotaon====+  ssh -N -f compte@hôte -Lport-local:localhost:port_distant
  
-Appliquez maintenant les quotas :+Dans votre cas, vous allez créer un tunnel dans votre propre vm entre le port 15023 et le port 23 :
  
 <code> <code>
-[root@centos8 ~]# quotaon -a+[root@centos8 ~]# ssh -N -f trainee@localhost -L15023:localhost:23 
 +\S 
 +Kernel \r on an \m 
 +trainee@localhost's password: trainee
 </code> </code>
  
-Les options de la commande **quotaon** sont :+Installez maintenant le serveur telnet :
  
 <code> <code>
-[root@centos8 ~]# quotaon --help +[root@centos8 ~]# dnf install telnet-server
-quotaon: Usage: +
-        quotaon [-guPvp] [-F quotaformat] [-x state] -a +
-        quotaon [-guPvp] [-F quotaformat] [-x state] filesys ... +
- +
--a, --all                turn quotas on for all filesystems +
--f, --off                turn quotas off +
--u, --user               operate on user quotas +
--g, --group              operate on group quotas +
--P, --project            operate on project quotas +
--p, --print-state        print whether quotas are on or off +
--x, --xfs-command=cmd    perform XFS quota command +
--F, --format=formatname  operate on specific quota format +
--v, --verbose            print more messages +
--h, --help               display this help text and exit +
--V, --version            display version information and exit+
 </code> </code>
  
-De cette manière vous avez mis en place un quota **souple** pour fenestros de 8 000 Ko et un quota **stricte** de 10 000 Ko. +Telnet n'est ni démarré ni activé. Il convient donc de le démarrer et de l'activer :
  
-Quand l'utilisateur fenestros aura dépassé le quota **souple**, il recevra un message d'avertissementQuand il dépasse le quota **stricte**, il ne pourra plus enregistrer dans /home, sauf dans le cas où il supprime des fichiers pour retomber en dessous de la limite **stricte**.+<code> 
 +[root@centos8 ~]# systemctl status telnet.socket 
 +● telnet.socket - Telnet Server Activation Socket 
 +   Loaded: loaded (/usr/lib/systemd/system/telnet.socket; disabled; vendor preset: disabled) 
 +   Active: inactive (dead) 
 +     Docs: man:telnetd(8) 
 +   Listen: [::]:23 (Stream) 
 + Accepted: 0; Connected: 0; 
 +  
 +[root@centos8 ~]# systemctl start telnet.socket
  
-Il est à noter que vous pouvez soit mettre en place un quota en taille, soit mettre en place un quota basé sur le nombre d'inodes utilisés par l'utilisateur.+[root@centos8 ~]# systemctl status telnet.socket 
 +● telnet.socket - Telnet Server Activation Socket 
 +   Loaded: loaded (/usr/lib/systemd/system/telnet.socket; disabled; vendor preset: disabled) 
 +   Active: active (listening) since Mon 2021-08-30 02:44:01 EDT; 4s ago 
 +     Docs: man:telnetd(8) 
 +   Listen: [::]:23 (Stream) 
 + Accepted: 0; Connected: 0; 
 +   CGroup: /system.slice/telnet.socket
  
-<WRAP center round important> +Aug 30 02:44:01 centos8.ittraining.loc systemd[1]: Listening on Telnet Server Activation Socket.
-**important** - La commande pour désactivez les quotas est **quotaoff** +
-</WRAP>+
  
-====3.4 - La Commande repquota====+[root@centos8 ~]# systemctl enable telnet.socket 
 +Created symlink /etc/systemd/system/sockets.target.wants/telnet.socket → /usr/lib/systemd/system/telnet.socket. 
 +</code>
  
-Pour visualiser les quotas utilisez la commande **repquota** :+Connectez-vous ensuite via telnet sur le port 15023, vous constaterez que votre connexion n'aboutit pas :
  
 <code> <code>
-[root@centos8 ~]# repquota /home +[root@centos8 ~]# telnet localhost 15023 
-*** Report for user quotas on device /dev/sdc1 +Trying ::1... 
-Block grace time7days; Inode grace time7days +Connected to localhost. 
-                        Block limits                File limits +Escape character is '^]'
-User            used    soft    hard  grace    used  soft  hard  grace + 
----------------------------------------------------------------------- +Kernel 4.18.0-305.7.1.el8.i2tch.x86_64 on an x86_64 
-root      --      20                          2                +centos8 logintrainee 
-trainee   -- 21495888                     136532                      +Password:  
-   +Last login: Mon Aug 30 02:37:00 from ::1 
 +[trainee@centos8 ~]$ whoami 
 +trainee 
 +[trainee@centos8 ~]$ pwd 
 +/home/trainee
 </code> </code>
  
-<WRAP center round important> +<WRAP center round important 60%
-**Important** - Notez que l'utilisateur fenestros ne figure pas dans la liste. Sous RHEL / CentOS, le quota n'est pas visible tant que l'utilisateur ne s'est pas connecté pour la première fois+**Important** - Notez bien que votre communication telnet passe par le tunnel SSH.
 </WRAP> </WRAP>
  
-Les options de la commande **repquota** sont :+====3.5 - SCP====
  
-<code> +===Présentation===
-[root@centos8 ~]# repquota --help +
-repquota: Utility for reporting quotas. +
-Usage: +
-repquota [-vugsi] [-c|C] [-t|n] [-F quotaformat] [-O (default | xml | csv)] (-a | mntpoint)+
  
--v, --verbose               display also users/groups without any usage +La commande **scp** est le successeur et la remplaçante de la commande **rcp** de la famille des commandes **remote**Il permet de faire des transferts sécurisés à partir d'une machine distante :
--u, --user                  display information about users +
--g, --group                 display information about groups +
--P, --project               display information about projects +
--s, --human-readable        show numbers in human friendly units (MB, GB, ...) +
--t, --truncate-names        truncate names to 9 characters +
--p, --raw-grace             print grace time in seconds since epoch +
--n, --no-names              do not translate uid/gid to name +
--i, --no-autofs             avoid autofs mountpoints +
--c, --cache                 translate big number of ids at once +
--C, --no-cache              translate ids one by one +
--F, --format=formatname     report information for specific format +
--O, --output=format         format output as xml or csv +
--a, --all                   report information for all mount points with quotas +
--h, --help                  display this help message and exit +
--V, --version               display version information and exit+
  
-Bugs to jack@suse.cz +  $ scp compte@numero_ip(nom_de_machine):/chemin_distant/fichier_distant /chemin_local/fichier_local
-</code>+
  
-====3.5 - La Commande quota====+ou vers une machine distante :
  
-Pour visualiser les quotas d'un utilisateur spécifique, il convient d'utiliser la commande **quota** :+  $ scp /chemin_local/fichier_local compte@numero_ip(nom_de_machine):/chemin_distant/fichier_distant 
 + 
 +===Utilisation=== 
 + 
 +Nous allons maintenant utiliser **scp** pour chercher un fichier sur le <<serveur>>
 + 
 +Créez le fichier **/home/trainee/scp_test** :
  
 <code> <code>
-[root@centos8 ~]# quota fenestros +[trainee@centos8 ~]$ touch scp-test 
-Disk quotas for user fenestros (uid 1001): no limited resources used +[trainee@centos8 ~]$ exit
-[root@centos8 ~]# su - fenestros +
-[fenestros@centos8 ~]$ touch test +
-[fenestros@centos8 ~]$ exit+
 logout logout
-[root@centos8 ~]# quota fenestros +Connection closed by foreign host. 
-Disk quotas for user fenestros (uid 1001):  +[root@centos8 ~]# 
-     Filesystem  blocks   quota   limit   grace   files   quota   limit   grace +
-      /dev/sdc1          8000   10000                                       +
 </code> </code>
  
-Les options de la commande **quota** sont :+Récupérez le fichier **scp_test** en utilisant scp :
  
 <code> <code>
-[root@centos8 ~]# quota --help +[root@centos8 ~]# scp trainee@127.0.0.1:/home/trainee/scp-test . 
-quotaUsage: quota [-guPqvswim] [-l | [-Q | -A]] [-F quotaformat+The authenticity of host '127.0.0.1 (127.0.0.1)' can't be established. 
-        quota [-qvswim] [-l | [-Q | -A]] [-F quotaformat] -u username ... +ECDSA key fingerprint is SHA256:Q7T/CP0SLiMbMAIgVzTuEHegYS/spPE5zzQchCHD5Vw. 
-        quota [-qvswim] [-l | [-Q | -A]] [-F quotaformat] -g groupname ... +Are you sure you want to continue connecting (yes/no/[fingerprint])? yes 
-        quota [-qvswugPQm] [-F quotaformat] -f filesystem ...+Warning: Permanently added '127.0.0.1' (ECDSA) to the list of known hosts. 
 +\S 
 +Kernel \r on an \m 
 +trainee@127.0.0.1's password: trainee 
 +scp-test                                                                                                           100%    0     0.0KB/s   00:00    
  
--u, --user                display quota for user +[root@centos8 ~]# ls -l 
--g, --group               display quota for group +total 32 
--P, --project             display quota for project +-rw-------. 1 root root 1358 Jun 16 06:40 anaconda-ks.cfg 
--q, --quiet               print more terse message +drwxr-xr-x3 root root   21 Jun 16 06:39 home 
--v, --verbose             print more verbose message +-rw-r--r--. 1 root root 1749 Aug 24 11:20 I2TCH.asc 
--s, --human-readable      display numbers in human friendly units (MB, GB...) +-rw-r--r--. 1 root root 1853 Jun 16 06:54 initial-setup-ks.cfg 
-    --always-resolve      always try to translate name to id, even if it is +-rw-r--r--. 1 root root   31 Aug 24 11:22 message.txt 
-                          composed of only digits +-rw-r--r--. 1 root root  561 Aug 24 11:32 message.txt.asc 
--w, --no-wrap             do not wrap long lines +-rw-r--r--. 1 root root  367 Aug 24 11:30 message.txt.gpg 
--p, --raw-grace           print grace time in seconds since epoch +-rw-r--r--. 1 root root  329 Aug 24 11:23 message.txt.sig 
--l, --local-only          do not query NFS filesystems +-rw-r--r--. 1 root root    0 Aug 30 03:55 scp-test 
--Q, --quiet-refuse        do not print error message when NFS server does +-rw-r--r--. 1 root root   46 Aug 29 06:22 wget_file.txt
-                          not respond +
--i, --no-autofs           do not query autofs mountpoints +
--F, --format=formatname   display quota of a specific format +
--f, --filesystem-list     display quota information only for given filesystems +
--A, --all-nfs             display quota for all NFS mountpoints +
--m, --no-mixed-pathnames  trim leading slashes from NFSv4 mountpoints +
-    --show-mntpoint       show mount point of the file system in output +
-    --hide-device         do not show file system device in output +
--h, --help                display this help message and exit +
--V, --version             display version information and exit +
- +
-Bugs tojack@suse.cz+
 </code> </code>
  
-====3.6 - La Commande warnquota====+====3.6 - Mise en Place des Clefs Asymétriques====
  
-La commande **warnquota** vérifie le ou les disques et envoie un message par mail à tout utilisateur qui a dépassé la limite soft. Elle est enrègle générale appelée par un job cron. Cependant elle peut aussi est appelée d'une manière intéractive.+Il convient maintenant de se connecter sur le <<serveur>> en utilisant ssh et vérifiez la présence du répertoire ~/.ssh :
  
-Sous RHEL/CentOS, warnquota n'est pas installé par défaut :+<code> 
 +[root@centos8 ~]# ssh -l trainee 127.0.0.1 
 +\S 
 +Kernel \r on an \m 
 +trainee@127.0.0.1's password: trainee 
 +Activate the web console with: systemctl enable --now cockpit.socket 
 + 
 +[trainee@centos8 ~]$ ls -la | grep .ssh 
 +drwx------.  2 trainee trainee      4096 Aug 30 02:26 .ssh 
 +</code> 
 + 
 +<WRAP center round important 60%> 
 +**Important** - Si le dossier distant .ssh n'existe pas dans le répertoire personnel de l'utilisateur connecté, il faut le créer avec des permissions de 700. Dans votre cas, puisque votre machine joue le rôle de serveur **et** du client, le dossier /home/trainee/.ssh existe **déjà**. 
 +</WRAP> 
 + 
 +Ensuite, il convient de transférer le fichier local **.ssh/id_ecdsa.pub** du <<client>> vers le <<serveur>> en le renommant en **authorized_keys** :
  
 <code> <code>
-[root@centos8 ~]# which warnquota +[trainee@centos8 ~]$ exit 
-/usr/bin/whichno warnquota in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin)+logout 
 +Connection to 127.0.0.1 closed. 
 + 
 +[root@centos8 ~]# exit 
 +logout 
 + 
 +[trainee@centos8 ~]$ scp .ssh/id_ecdsa.pub trainee@127.0.0.1:/home/trainee/.ssh/authorized_keys 
 +The authenticity of host '127.0.0.1 (127.0.0.1)' can't be established. 
 +ECDSA key fingerprint is SHA256:Q7T/CP0SLiMbMAIgVzTuEHegYS/spPE5zzQchCHD5Vw. 
 +Are you sure you want to continue connecting (yes/no/[fingerprint])? yes 
 +WarningPermanently added '127.0.0.1' (ECDSAto the list of known hosts. 
 +\S 
 +Kernel \r on an \m 
 +trainee@127.0.0.1's password: trainee 
 +id_ecdsa.pub                                                                                                       100%  192   497.6KB/  00:00
 </code> </code>
  
-Installez donc le paquet **quota-warnquota** +Connectez-vous via telnet :
  
 <code> <code>
-[root@centos7 ~]# dnf install quota-warnquota +[trainee@centos8 ~]$ ssh -l trainee localhost 
-...+The authenticity of host 'localhost (::1)' can't be established. 
 +ECDSA key fingerprint is SHA256:Q7T/CP0SLiMbMAIgVzTuEHegYS/spPE5zzQchCHD5Vw. 
 +Are you sure you want to continue connecting (yes/no/[fingerprint])? yes 
 +Warning: Permanently added 'localhost' (ECDSA) to the list of known hosts. 
 +\S 
 +Kernel \r on an \m 
 +Activate the web console with: systemctl enable --now cockpit.socket 
 + 
 +Last login: Mon Aug 30 03:57:14 2021 from 127.0.0.1 
 +[trainee@centos8 ~]$
 </code> </code>
  
-Les options de la commande **warnquota** sont :+<WRAP center round important 60%> 
 +**Important** - Lors de la connexion au serveur, l'authentification utilise le couple de clefs asymétrique au format ecdsa et aucun mot de passe n'est requis. 
 +</WRAP> 
 + 
 +Insérez maintenant les clefs publiques restantes dans le fichier .ssh/authorized_keys :
  
 <code> <code>
-[root@centos8 ~]# warnquota --help +[trainee@centos8 ~]$ cd .ssh 
-warnquota: Usage: +[trainee@centos8 .ssh]$ ls 
-  warnquota [-ugsid[-F quotaformat] [-c configfile] [-q quotatabfile] [-a adminsfile] [filesystem...]+authorized_keys  id_dsa  id_dsa.pub  id_ecdsa  id_ecdsa.pub  id_ed25519  id_ed25519.pub  id_rsa  id_rsa.pub  known_hosts 
 +[trainee@centos8 .ssh]$ cat authorized_keys  
 +ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBHDrzSXP+Ecxf/sQ18VwCRNm7rrSrrsaJmuIw/RgTH5puKF5E+Yy15cvAAKBXpJPxUmrOaOyhab84PevV7XSHcI= trainee@centos8.ittraining.loc
  
--u, --user                      warn users +[trainee@centos8 .ssh]$ cat id_rsa.pub >> authorized_keys 
--g, --group                     warn groups +[trainee@centos8 .ssh]$ cat id_dsa.pub >> authorized_keys 
--s, --human-readable            send information in more human friendly units +[trainee@centos8 .ssh]$ cat id_ed25519.pub >> authorized_keys
--i, --no-autofs                 avoid autofs mountpoints +
--d, --no-details                do not send quota information itself +
--F, --format=formatname         use quotafiles of specific format +
--c, --config=config-file        non-default config file +
--q, --quota-tab=quotatab-file   non-default quotatab +
--a, --admins-file=admins-file   non-default admins file +
--h, --help                      display this help message and exit +
--v, --version                   display version information and exit+
  
-warnquota: Bugs to jack@suse.cz+[trainee@centos8 .ssh]$ cat authorized_keys 
 +ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBHDrzSXP+Ecxf/sQ18VwCRNm7rrSrrsaJmuIw/RgTH5puKF5E+Yy15cvAAKBXpJPxUmrOaOyhab84PevV7XSHcI= trainee@centos8.ittraining.loc 
 +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQD3ZSMn/GIAHtaDFc6ZNnKJam9hzq8TxqMN5IopUr8QhwODyPadbB+FgH4r50qTux4ubwr1BlymgIdqRVWy32mE15M8tdtKc3j8DNMpUwPGEh+s/PT7GW+3E3shoyPvpLc1kKaKXKGl/JwfCK/8IYsubk2BmiiJYkzLECotPlaaxm4w1K0AtlnZQuLHt1HK3/rHChxo2o2w1t59/QwNcMLiKve1Z+zQ1POKo8VJ/DDrf90y2QWC28ejUs/ZjP6f6C4bn5Jjol4TbHls3ArMsbU6C1Ev5jqbzZ0kmognQ2CnRjeNM51YdFo6nRsLoPQKpeLRMBpT/87HK1bPUOBVCyhXxSkqkVhMlgg8tgcD/MRlBaUVFoZ1wQ0L26Fe+q7c2Oykj54pdXCAK2ZTpCXGfhd/FxrfqGw7cSeKlGX4QUzHMjMk2oHFC9h30BUk1gGN21KJPTh7/S1OZVrnCc3GUi5fXPvEpral0IU0sws+j03dj0sWm5ICQFKRkmZN11HCyT0= trainee@centos8.ittraining.loc 
 +ssh-dss AAAAB3NzaC1kc3MAAACBALIdwEEqHrMWSUdzARm9ldsZK9ebbtZShtmwgdjphOk77fxymK0y6wV7QEmLL25LOcLb12uZ1F0LtRt/t2oqgrwqk3vUSpCPLr09AXpcD/nxL9kc+rUxHyl6u1mHtyfCVLCPSvavCMR8TaA8egVMk3EwGRfHTiuDOKi7Iwus7gXPAAAAFQDHEQPGVRI7gVYKzCT6nrjDsQQ6jwAAAIEAhhhH7fEjdldASXY0qTWkCvcs3cfK9/Ff315zByn47O02y9Vdo3QG5nOr1Oo8fc2xEkIBNmFr8Rr2g60cpvEev5hy4XZ1ghxnQ53iwKuiS72ZATwhD6bZBrsiH0k1Et25gRcj5KCvDe/jHhbxCxsCuHUH2qvWsQNVwztE7hD0sxkAAACAQ8Dkpy8zXj7jW8o1txxf2W6J4r2+1lPldymA45ywZokN4SCwvXlpPAuyBt0/HiU0R2PI9aqOAMosCLcy9WmnSwLQ2Z7QcD2i3XlAih2+1q9NJP22sPT3jSK9UZcdRjoZ/eNiz84sXZucNape32tFxjvcV4txobH/vD53q8g63fA= trainee@centos8.ittraining.loc 
 +ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOfFQULLU8IZyKiSU63D2Zz6yGLqyHcBHnCRdSR9JSmc trainee@centos8.ittraining.loc
 </code> </code>
  
 ----- -----
-<html> 
-<div align="center"> 
 Copyright © 2021 Hugh Norris. Copyright © 2021 Hugh Norris.
-</html> 
Menu