Différences

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

Lien vers cette vue comparative

Prochaine révision
Révision précédente
elearning:workbooks:centos:6:avance:l104 [2020/02/21 07:11] – créée adminelearning:workbooks:centos:6:avance:l104 [2023/02/15 15:54] (Version actuelle) admin
Ligne 1: Ligne 1:
 ~~PDF:LANDSCAPE~~ ~~PDF:LANDSCAPE~~
 +
 +Version : **2022.01**
  
 Dernière mise-à-jour : ~~LASTMOD~~ Dernière mise-à-jour : ~~LASTMOD~~
  
-======LRF304 - Gestion du Noyau et des Quotas======+======LCF303 - Gestion du Réseau TCPv4======
  
-=====Rôle du noyau=====+=====Contenu du Module=====
  
-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 :+  * **LCF303 - Gestion du Réseau TCPv4** 
 +    * Contenu du Module 
 +    * Configuration du Réseau sous RHEL/CentOS 5 et 6 
 +      * Configuration de TCP/IP 
 +        * DHCP 
 +          * /etc/sysconfig/network 
 +          * /etc/sysconfig/network-scripts/ifcfg-ethX (où X=0,1 ...) 
 +        * IP Fixe 
 +          * /etc/sysconfig/network 
 +          * /etc/sysconfig/network-scripts/ifcfg-ethX (où X=0,1 ...) 
 +        * La Commande hostname 
 +        * La Commande ifconfig 
 +        * Activer/Désactiver une Interface Manuellement 
 +        * /etc/networks 
 +        * Résolution d'adresses IP 
 +          * /etc/resolv.conf 
 +          * /etc/nsswitch.conf 
 +          * /etc/hosts 
 +        * Services réseaux 
 +          * xinetd 
 +          * TCP Wrapper 
 +        * Routage Statique 
 +          * La Commande route 
 +          * Activer/désactiver le routage sur le serveur 
 +      * Configuration du Réseau sous RHEL/CentOS 7 
 +        * La Commande nmcli 
 +        * Connections et Profils 
 +        * Ajouter une Deuxième Adresse IP à un Profil 
 +        * La Commande hostname 
 +        * La Commande ip 
 +        * Activer/Désactiver une Interface Manuellement 
 +        * Routage Statique 
 +          * La commande ip 
 +          * Activer/désactiver le routage sur le serveur 
 +    * Diagnostique du Réseau 
 +      * ping 
 +      * netstat -i 
 +      * traceroute 
 +    * Connexions à Distance 
 +      * Telnet 
 +      * wget 
 +      * ftp 
 +      * SSH 
 +        * Introduction 
 +          * SSH-1 
 +          * SSH-2 
 +        * L'authentification par mot de passe 
 +        * L'authentification par clef asymétrique 
 +          * Installation 
 +          * Configuration 
 +            * Serveur 
 +          * Utilisation 
 +          * Tunnels SSH 
 +      * SCP 
 +        * Introduction 
 +        * Utilisation 
 +        * Mise en place des clefs
  
-  * la diminution de la taille du noyau, +=====Configuration du Réseau sous RHEL/CentOS 5 et 6=====
-  * la prise en charge de nouveau matériel, +
-  * l'ajout de fonctionnalités, +
-  * l'optimisation du code, +
-  * la correction de bogues, +
-  * le besoin d'une fonctionnalité expérimentale.+
  
-Commencez par identifier le noyau utilisé par votre machine :+==== Configuration de TCP/IP ====
  
-<code> +La configuration TCP/IP se trouve dans le répertoire **/etc/sysconfig**. Les fichiers importants sont : 
-[root@centos7 ~]# uname -r + 
-3.10.0-327.13.1.el7.x86_64 +=== DHCP ===
-</code>+
  
-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>** :+== /etc/sysconfig/network ==
  
 <code> <code>
-[root@centos7 ~]# ls /lib/modules/`uname -r`/ +[root@centos6 ~]# cat /etc/sysconfig/network 
-build   modules.alias      modules.builtin      modules.dep.bin  modules.modesetting  modules.softdep      source   weak-updates +NETWORKING=yes 
-extra   modules.alias.bin  modules.builtin.bin  modules.devname  modules.networking   modules.symbols      updates +HOSTNAME=centos6
-kernel  modules.block      modules.dep          modules.drm      modules.order        modules.symbols.bin  vdso+
 </code> </code>
  
-Les commandes pour manipuler les modules sont :+Dans ce fichier vous pouvez constater les directives suivantes :
  
-  * insmod +^ Directive ^ Description ^ 
-  * rmmod +| NETWORKING | Indique que la prise en charge du réseau est activée | 
-  * lsmod +| HOSTNAME | Indique le nom d'hôte de la machine |
-  * modprobe+
  
-Par exemple :+Ce fichier peut également contenir les directives suivantes : 
 + 
 +^ Directive ^ Description ^ 
 +| GATEWAY | Indique l'adresse IPv4 de la passerelle | 
 +| GATEWAYDEV | Indique l'interface réseau utilisée pour accéder à la passerelle | 
 +| NISDOMAIN | Indique le domaine NIS s'il en existe un | 
 +| NETWORKING_IPV6 | Active ou désactive le support IPv6 | 
 + 
 +==/etc/sysconfig/network-scripts/ifcfg-ethX (où X=0,1 ...)== 
 + 
 +**ifcfg-eth0**
  
 <code> <code>
-[root@centos7 ~]# lsmod +[root@centos6 ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0 
-Module                  Size  Used by +DEVICE="eth0" 
-ip6t_rpfilter          12546  1  +NM_CONTROLLED="yes" 
-ip6t_REJECT            12939  2  +ONBOOT=yes 
-ipt_REJECT             12541  +TYPE=Ethernet 
-xt_conntrack           12760  +BOOTPROTO=dhcp 
-ebtable_nat            12807  0  +DEFROUTE=yes 
-ebtable_broute         12731  +IPV4_FAILURE_FATAL=yes 
-bridge                119562  1 ebtable_broute +IPV6INIT=no 
-stp                    12976  1 bridge +NAME="System eth0" 
-llc                    14552  2 stp,bridge +UUID=5fb06bd0-0bb0-7ffb-45f1-d6edd65f3e03 
-ebtable_filter         12827  +HWADDR=08:00:27:48:7D:7F 
-ebtables               30913  3 ebtable_broute,ebtable_nat,ebtable_filter +PEERDNS=yes 
-ip6table_nat           12864  1  +PEERROUTES=yes
-nf_conntrack_ipv6      18738  6  +
-nf_defrag_ipv6         34768  1 nf_conntrack_ipv6 +
-nf_nat_ipv6            14131  1 ip6table_nat +
-ip6table_mangle        12700  1  +
-ip6table_security      12710  1  +
-ip6table_raw           12683  1  +
-ip6table_filter        12815  1  +
-ip6_tables             27025  5 ip6table_filter,ip6table_mangle,ip6table_security,ip6table_nat,ip6table_raw +
-iptable_nat            12875  1  +
-nf_conntrack_ipv4      14862  5  +
-nf_defrag_ipv4         12729  1 nf_conntrack_ipv4 +
-nf_nat_ipv4            14115  1 iptable_nat +
-nf_nat                 26146  2 nf_nat_ipv4,nf_nat_ipv6 +
-nf_conntrack          105745  6 nf_nat,nf_nat_ipv4,nf_nat_ipv6,xt_conntrack,nf_conntrack_ipv4,nf_conntrack_ipv6 +
-iptable_mangle         12695  1  +
-iptable_security       12705  1  +
-iptable_raw            12678  1  +
-iptable_filter         12810  1  +
-dm_mirror              22135  0  +
-dm_region_hash         20862  1 dm_mirror +
-dm_log                 18411  2 dm_region_hash,dm_mirror +
-dm_mod                113292  2 dm_log,dm_mirror +
-crc32_pclmul           13113  0  +
-ghash_clmulni_intel    13259  0  +
-aesni_intel            69884  0  +
-lrw                    13286  1 aesni_intel +
-gf128mul               14951  1 lrw +
-glue_helper            13990  1 aesni_intel +
-snd_intel8x0           38274  1  +
-ablk_helper            13597  1 aesni_intel +
-cryptd                 20359  3 ghash_clmulni_intel,aesni_intel,ablk_helper +
-snd_ac97_codec        130605  1 snd_intel8x0 +
-ac97_bus               12730  1 snd_ac97_codec +
-ppdev                  17671  0  +
-snd_seq                66691  0  +
-snd_seq_device         14356  1 snd_seq +
-snd_pcm               105835  2 snd_ac97_codec,snd_intel8x0 +
-pcspkr                 12718  0  +
-sg                     40721  0  +
-parport_pc             28165  0  +
-parport                42348  2 ppdev,parport_pc +
-snd_timer              29639  2 snd_pcm,snd_seq +
-snd                    83425  8 snd_ac97_codec,snd_intel8x0,snd_timer,snd_pcm,snd_seq,snd_seq_device +
-soundcore              15047  1 snd +
-i2c_piix4              22106  0  +
-video                  24400  0  +
-i2c_core               40582  1 i2c_piix4 +
-nfsd                  302418  1  +
-auth_rpcgss            59343  1 nfsd +
-nfs_acl                12837  1 nfsd +
-lockd                  93600  1 nfsd +
-grace                  13295  2 nfsd,lockd +
-sunrpc                300464  7 nfsd,auth_rpcgss,lockd,nfs_acl +
-ip_tables              27240  5 iptable_security,iptable_filter,iptable_mangle,iptable_nat,iptable_raw +
-xfs                   939662  2  +
-libcrc32c              12644  1 xfs +
-sd_mod                 45497  4  +
-crc_t10dif             12714  1 sd_mod +
-crct10dif_generic      12647  0  +
-sr_mod                 22416  0  +
-cdrom                  42556  1 sr_mod +
-ata_generic            12910  0  +
-pata_acpi              13038  0  +
-ahci                   29907  3  +
-libahci                32031  1 ahci +
-ata_piix               35038  0  +
-crct10dif_pclmul       14289  1  +
-crct10dif_common       12595  3 crct10dif_pclmul,crct10dif_generic,crc_t10dif +
-crc32c_intel           22079  1  +
-serio_raw              13462  0  +
-libata                218730  5 ahci,pata_acpi,libahci,ata_generic,ata_piix +
-e1000                 149323 +
 </code> </code>
  
-Pour ajouter un moduleon peut utiliser la commande **insmod** ou **modprobe**. Cette dernière ajoute non seulement le module passé en argument mais également ses dépendances :+Dans ce fichier vous pouvez constater les directives suivantes : 
 + 
 +^ Directive ^ Description ^ 
 +| DEVICE | Indique le nom de l'interface | 
 +| NM_CONTROLLED | Indique que le service NetworkManager est utilisé pour gérer les interfaces réseau | 
 +| ONBOOT | Indique que l'interface est activée au démarrage de la machine | 
 +| TYPE | Indique que le type de réseau est ethernet.  Les valeurs permises sont ethernet ou wireless | 
 +| BOOTPROTO | Indique comment monter l'interface. Les valeurs permises sont dhcpstatic ou bootp | 
 +| DEFROUTE | Définit l'interface en tant que passerelle par défaut | 
 +| IPV4_FAILURE_FATAL | Stipule que si IPv4 et IPv6 sont activés et la connexion IPv4 est perdue, la connexion IPv6 est considérée d'être perdue | 
 +| IPV6INIT | Indique que le support IPv6 ne sera pas initialisé | 
 +| NAME | Indique un nom descriptif de l'interface | 
 +| UUID | Indique la valeur de l'UUID de l'interface | 
 +| HWADDR | Indique l'adresse MAC de l'interface | 
 +| PEERDNS |Indique que le fichier /etc/resolv.conf doit être modifié automatiquement pour contenir les adresses IP des DNS fournies par le serveur DHCP | 
 + 
 + 
 +<WRAP center round todo> 
 +Recherchez la définition de la directive **PEERROUTES=yes**
 +</WRAP> 
 + 
 +=== IP Fixe === 
 + 
 +== /etc/sysconfig/network == 
 + 
 +<file> 
 +NETWORKING=yes 
 +NETWORKING_IPV6=no 
 +HOSTNAME=centos6.fenestros.loc 
 +</file> 
 + 
 +==/etc/sysconfig/network-scripts/ifcfg-ethX (où X=0,1 ...)== 
 + 
 +**ifcfg-eth0** 
 + 
 +<file> 
 +DEVICE="eth0" 
 +NM_CONTROLLED="no" 
 +ONBOOT=yes 
 +TYPE=Ethernet 
 +BOOTPROTO=static 
 +IPV6INIT=no 
 +HWADDR="08:00:27:9B:55:B1" 
 +NETMASK=255.255.255.0 
 +IPADDR=10.0.2.15 
 +GATEWAY=10.0.2.2 
 +DNS1=8.8.8.8 
 +DNS2=8.8.4.4 
 +DOMAIN=fenestros.loc 
 +USERCTL=yes 
 +</file> 
 + 
 +Dans ce fichier vous pouvez constater les nouvelles directives suivantes : 
 + 
 +^ Directive ^ Description ^ 
 +| NETMASK | Indique le masque de sous-réseau IPv4 associé à l'interface | 
 +| IPADDR | Indique l'adresse IPv4 de l'interface | 
 +| GATEWAY  | Indique l'adresse IPv4 de la passerelle par défaut | 
 +| DNS1 | Indique le DNS primaire | 
 +| DNS2 | Indique le DNS secondaire | 
 +| DOMAIN  | Indique le nom du domaine local | 
 +| USERCTL | Indique que les utilisateurs normaux peuvent activer/désactiver l'interface | 
 + 
 +<WRAP center round important> 
 +Notez que %%VirtualBox%% fournit une passerelle par défaut ( 10.0.2.2 ). 
 +</WRAP> 
 + 
 +Après avoir modifier les deux fichiers **/etc/sysconfig/network** et **/etc/sysconfig/network-scripts/ifcfg-eth0** vous devez désactiver le service **%%NetworkManager%%** utilisé pour la connexion DHCP et activer le service **network** :
  
 <code> <code>
-[root@centos7 ~]# modprobe bonding +[root@centos6 ~]# service NetworkManager stop 
-[root@centos7 ~]# lsmod | more +Arrêt du démon NetworkManager :                            [  OK  ] 
-Module                  Size  Used by +[root@centos6 ~]# chkconfig --del NetworkManager 
-bonding               136705  0  +[root@centos6 ~]# service network start 
-ip6t_rpfilter          12546   +Activation de l'interface loopback :                        OK  ] 
-ip6t_REJECT            12939  2  +Activation de l'interface eth0 :                            OK  ] 
-ipt_REJECT             12541   +[root@centos6 ~]#
-xt_conntrack           12760  9  +
-ebtable_nat            12807  0  +
-ebtable_broute         12731  0  +
-bridge                119562  1 ebtable_broute +
-stp                    12976  1 bridge +
-llc                    14552  2 stp,bridge +
-ebtable_filter         12827  0  +
-ebtables               30913  3 ebtable_broute,ebtable_nat,ebtable_filter +
-ip6table_nat           12864  1  +
-nf_conntrack_ipv6      18738  6  +
-nf_defrag_ipv6         34768  1 nf_conntrack_ipv6 +
-nf_nat_ipv6            14131  1 ip6table_nat +
-ip6table_mangle        12700  1  +
-ip6table_security      12710  1  +
-ip6table_raw           12683  1  +
-ip6table_filter        12815  1  +
-ip6_tables             27025  5 ip6table_filter,ip6table_mangle,ip6table_securit +
-y,ip6table_nat,ip6table_raw +
---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 :+ 
 +====La Commande hostname==== 
 + 
 +Lors du passage à une configuration en IPv4 fixe vous avez modifié la directive **HOSTNAME** du fichier **/etc/sysconfig/network** de **centos** à **centos.fenestros.loc**. Afin d'informer le système immédiatement de la modification du FQDN (//Fully Qualified Domain Name//), utilisez la commande **hostname** 
  
 <code> <code>
-[root@centos7 ~]# modprobe -r bonding +[root@centos6 ~]# hostname 
-[root@centos7 ~]# lsmod | more +centos6 
-Module                  Size  Used by +[root@centos6 ~]# hostname centos6.fenestros.loc 
-ip6t_rpfilter          12546  1  +[root@centos6 ~]# hostname 
-ip6t_REJECT            12939  2  +centos6.fenestros.loc
-ipt_REJECT             12541  2  +
-xt_conntrack           12760  9  +
-ebtable_nat            12807  0  +
-ebtable_broute         12731  0  +
-bridge                119562  1 ebtable_broute +
-stp                    12976  1 bridge +
-llc                    14552  2 stp,bridge +
-ebtable_filter         12827  0  +
-ebtables               30913  3 ebtable_broute,ebtable_nat,ebtable_filter +
-ip6table_nat           12864  1  +
-nf_conntrack_ipv6      18738  6  +
-nf_defrag_ipv6         34768  1 nf_conntrack_ipv6 +
-nf_nat_ipv6            14131  1 ip6table_nat +
-ip6table_mangle        12700  1  +
-ip6table_security      12710  1  +
-ip6table_raw           12683  1  +
-ip6table_filter        12815  1  +
-ip6_tables             27025  5 ip6table_filter,ip6table_mangle,ip6table_securit +
-y,ip6table_nat,ip6table_raw +
-iptable_nat            12875  1  +
---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** :+Pour afficher le FQDN du système vous pouvez également utiliser la commande suivante :
  
 <code> <code>
-[root@centos7 ~]# more /lib/modules/`uname -r`/modules.dep +[root@centos6 ~]# uname -n 
-kernel/arch/x86/kernel/cpu/mcheck/mce-inject.ko: +centos6.fenestros.loc
-kernel/arch/x86/kernel/test_nx.ko: +
-kernel/arch/x86/crypto/ablk_helper.ko: kernel/crypto/cryptd.ko +
-kernel/arch/x86/crypto/glue_helper.ko: +
-kernel/arch/x86/crypto/camellia-x86_64.ko: kernel/crypto/xts.ko kernel/crypto/lrw.ko kernel/crypto/gf128mul.ko kernel/arch/x86/crypto/glue_helper.ko +
-kernel/arch/x86/crypto/blowfish-x86_64.ko: kernel/crypto/blowfish_common.ko +
-kernel/arch/x86/crypto/twofish-x86_64.ko: kernel/crypto/twofish_common.ko +
-kernel/arch/x86/crypto/twofish-x86_64-3way.ko: kernel/arch/x86/crypto/twofish-x86_64.ko kernel/crypto/twofish_common.ko kernel/crypto/xts.ko kernel/cryp +
-to/lrw.ko kernel/crypto/gf128mul.ko kernel/arch/x86/crypto/glue_helper.ko +
-kernel/arch/x86/crypto/salsa20-x86_64.ko: +
-kernel/arch/x86/crypto/serpent-sse2-x86_64.ko: kernel/crypto/xts.ko kernel/crypto/serpent_generic.ko kernel/crypto/lrw.ko kernel/crypto/gf128mul.ko kern +
-el/arch/x86/crypto/glue_helper.ko kernel/arch/x86/crypto/ablk_helper.ko kernel/crypto/cryptd.ko +
-kernel/arch/x86/crypto/aesni-intel.ko: kernel/crypto/lrw.ko kernel/crypto/gf128mul.ko kernel/arch/x86/crypto/glue_helper.ko kernel/arch/x86/crypto/ablk_ +
-helper.ko kernel/crypto/cryptd.ko +
-kernel/arch/x86/crypto/ghash-clmulni-intel.ko: kernel/crypto/cryptd.ko +
-kernel/arch/x86/crypto/crc32c-intel.ko: +
-kernel/arch/x86/crypto/sha-mb/sha1-mb.ko: kernel/crypto/mcryptd.ko +
-kernel/arch/x86/crypto/crc32-pclmul.ko: +
-kernel/arch/x86/crypto/sha512-ssse3.ko: kernel/crypto/sha512_generic.ko +
-kernel/arch/x86/crypto/crct10dif-pclmul.ko: kernel/crypto/crct10dif_common.ko +
-kernel/arch/x86/crypto/camellia-aesni-avx-x86_64.ko: kernel/arch/x86/crypto/camellia-x86_64.ko kernel/crypto/xts.ko kernel/crypto/lrw.ko kernel/crypto/+
-f128mul.ko kernel/arch/x86/crypto/glue_helper.ko kernel/arch/x86/crypto/ablk_helper.ko kernel/crypto/cryptd.ko +
-kernel/arch/x86/crypto/cast5-avx-x86_64.ko: kernel/crypto/cast5_generic.ko kernel/crypto/cast_common.ko kernel/arch/x86/crypto/ablk_helper.ko kernel/cry +
---More--(0%)+
 </code> </code>
  
-Il est possible d'obtenir des informations sur un module grâce à la commande **modinfo** :+===Options de la commande hostname=== 
 + 
 +Les options de cette commande sont :
  
 <code> <code>
-[root@centos7 ~]# modinfo bonding +[root@centos6 ~]# hostname --help 
-filename:       /lib/modules/3.10.0-327.13.1.el7.x86_64/kernel/drivers/net/bonding/bonding.ko +Syntaxe hostname [-v] {hôte|-F fichier}      définit le nom d'hôte (depuis le fichier) 
-author        Thomas Davis, tadavis@lbl.gov and many others +       domainname [-v] {domaine_nis|-F fichier}   définit le domaine NIS (depuis le fichier
-description:    Ethernet Channel Bonding Driver, v3.7.1 +       hostname [-v] [-d|-f|-s|-a|-i|-y]  display formatted name 
-version:        3.7.1 +       hostname [-v]                         affiche le nom d'hôte 
-license:        GPL + 
-alias:          rtnl-link-bond +       hostname -V|--version|-h|--help       affiche des infos et termine 
-rhelversion:    7.2 + 
-srcversion:     49765A3F5CDFF2C3DCFD8E6 +    dnsdomainname=hostname -d{yp,nis,}domainname=hostname -y 
-depends:         + 
-intree:         Y +    -s, --short           nom d'hôte court 
-vermagic:       3.10.0-327.13.1.el7.x86_64 SMP mod_unload modversions  +    -a, --alias           noms d'alias 
-signer:         CentOS Linux kernel signing key +    -i--ip-address      adresses de l'hôte 
-sig_key:        6F:33:78:18:7D:83:CD:18:A4:3B:2E:0A:C4:9A:ED:8A:EF:FC:3A:C7 +    -f--fqdn--long    nom d'hôte long (FQDN
-sig_hashalgo:   sha256 +    -d--domain          nom de domaine DNS 
-parm:           max_bonds:Max number of bonded devices (int+    -y--yp--nis       nom de domaine NIS/YP 
-parm:           tx_queues:Max number of transmit queues (default = 16) (int) +    -F--file            read hostname or NIS domainname from given file 
-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) +   This command can read or set the hostname or the NIS domainname. You can 
-parm:           miimon:Link check interval in milliseconds (int) +   also read the DNS domain or the FQDN (fully qualified domain name). 
-parm:           updelay:Delay before considering link up, in milliseconds (int) +   Unless you are using bind or NIS for host lookups you can change the 
-parm:           downdelay:Delay before considering link downin milliseconds (int) +   FQDN (Fully Qualified Domain Nameand the DNS domain name (which is 
-parm:           use_carrier:Use netif_carrier_ok (vs MII ioctls) in miimon; 0 for off1 for on (default) (int) +   part of the FQDN) in the /etc/hosts file.
-parm:           mode:Mode of operation; 0 for balance-rr1 for active-backup, 2 for balance-xor, 3 for broadcast, 4 for 802.3ad, 5 for balance-tlb6 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)1 for only if speed of primary is better, 2 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:803.ad 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-xor and 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 (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 active2 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-backupdo 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 switchThe 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 :+====La Commande ifconfig==== 
 + 
 +Pour afficher la configuration IP de la machine il faut saisir la commande suivante :
  
 <code> <code>
-[root@centos7 ~]# ls /etc/modprobe.d +[root@centos6 ~]# ifconfig 
-mlx4.conf+eth0      Link encap:Ethernet  HWaddr 08:00:27:48:7D:7F   
 +          inet adr:10.0.2.15  Bcast:10.0.2.255  Masque:255.255.255.0 
 +          adr inet6: fe80::a00:27ff:fe48:7d7f/64 Scope:Lien 
 +          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1 
 +          RX packets:16765 errors:0 dropped:0 overruns:0 frame:0 
 +          TX packets:15256 errors:0 dropped:0 overruns:0 carrier:0 
 +          collisions:0 lg file transmission:1000  
 +          RX bytes:12435171 (11.8 MiB)  TX bytes:4767389 (4.5 MiB)
  
-[root@centos7 ~]# cat /etc/modprobe.d/mlx4.conf +lo        Link encap:Boucle locale   
-# This file is intended for users to select the various module options +          inet adr:127.0.0. Masque:255.0.0.0 
-# they need for the mlx4 driver.  On upgrade of the rdma package, +          adr inet6: ::1/128 Scope:Hôte 
-# any user made changes to this file are preserved Any changes made +          UP LOOPBACK RUNNING  MTU:16436  Metric:1 
-# to the libmlx4.conf file in this directory are overwritten on +          RX packets:8 errors:0 dropped:0 overruns:0 frame:0 
-# pacakge upgrade+          TX packets:8 errors:0 dropped:0 overruns:carrier:
-# +          collisions:0 lg file transmission: 
-# Some sample options and what they would do +          RX bytes:480 (480.b)  TX bytes:480 (480.0 b)
-# Enable debugging output, device managed flow control, and disable SRIOV +
-#options mlx4_core debug_level=1 log_num_mgm_entry_size=-1 probe_vf=num_vfs=+
-# +
-# Enable debugging output and create SRIOV devices, but don't attach any of +
-# the child devices to the host, only the parent device +
-#options mlx4_core debug_level=1 probe_vf=num_vfs=7 +
-+
-# Enable debugging output, SRIOV, and attach one of the SRIOV child devices +
-# in addition to the parent device to the host +
-#options mlx4_core debug_level=1 probe_vf=1 num_vfs=7 +
-+
-# Enable per priority flow control for send and receive, setting both priority +
-# 1 and 2 as no drop priorities +
-#options mlx4_en pfctx=3 pfcrx=3+
 </code> </code>
  
-=====Compilation et installation du noyau et des modules=====+La commande ifconfig est également utilisée pour configurer une interface. 
  
-Commencez par installer les paquets necessaires :+Créez maintenant une interface fictive ainsi :
  
 <code> <code>
-[root@centos7 ~]# yum install qt3-devel libXi-devel gcc-c++ rpmdevtools ncurses-devel +[root@centos6 ~]# ifconfig eth0:1 192.168.1.2 netmask 255.255.255.0 broadcast 192.168.1.255 
-Loaded plugins: fastestmirror, langpacks +</code>
-Loading mirror speeds from cached hostfile +
- * base: centos.mirrors.ovh.net +
- * extras: centos.mirror.fr.planethoster.net +
- * updates: mirror1.evolution-host.com +
-Resolving Dependencies +
---> Running transaction check +
----> Package gcc-c++.x86_64 0:4.8.5-4.el7 will be installed +
---> Processing Dependency: libstdc++-devel = 4.8.5-4.el7 for package: gcc-c++-4.8.5-4.el7.x86_64 +
----> Package libXi-devel.x86_64 0:1.7.4-2.el7 will be installed +
---> Processing Dependency: xorg-x11-proto-devel for package: libXi-devel-1.7.4-2.el7.x86_64 +
---> Processing Dependency: pkgconfig(xfixes) for package: libXi-devel-1.7.4-2.el7.x86_64 +
---> Processing Dependency: pkgconfig(xext) for package: libXi-devel-1.7.4-2.el7.x86_64 +
---> Processing Dependency: pkgconfig(x11) for package: libXi-devel-1.7.4-2.el7.x86_64 +
---> Processing Dependency: pkgconfig(inputproto) for package: libXi-devel-1.7.4-2.el7.x86_64 +
----> Package ncurses-devel.x86_64 0:5.9-13.20130511.el7 will be installed +
----> Package qt3-devel.x86_64 0:3.3.8b-51.el7 will be installed +
---> Processing Dependency: qt3 = 3.3.8b-51.el7 for package: qt3-devel-3.3.8b-51.el7.x86_64 +
---> Processing Dependency: mesa-libGLU-devel for package: qt3-devel-3.3.8b-51.el7.x86_64 +
---> Processing Dependency: mesa-libGL-devel for package: qt3-devel-3.3.8b-51.el7.x86_64 +
---> Processing Dependency: libpng-devel for package: qt3-devel-3.3.8b-51.el7.x86_64 +
---> Processing Dependency: libmng-devel for package: qt3-devel-3.3.8b-51.el7.x86_64 +
---> Processing Dependency: libjpeg-devel for package: qt3-devel-3.3.8b-51.el7.x86_64 +
---> Processing Dependency: libXt-devel for package: qt3-devel-3.3.8b-51.el7.x86_64 +
---> Processing Dependency: libXrender-devel for package: qt3-devel-3.3.8b-51.el7.x86_64 +
---> Processing Dependency: libXrandr-devel for package: qt3-devel-3.3.8b-51.el7.x86_64 +
---> Processing Dependency: libXinerama-devel for package: qt3-devel-3.3.8b-51.el7.x86_64 +
---> Processing Dependency: libXft-devel for package: qt3-devel-3.3.8b-51.el7.x86_64 +
---> Processing Dependency: libXcursor-devel for package: qt3-devel-3.3.8b-51.el7.x86_64 +
---> Processing Dependency: libSM-devel for package: qt3-devel-3.3.8b-51.el7.x86_64 +
---> Processing Dependency: libICE-devel for package: qt3-devel-3.3.8b-51.el7.x86_64 +
---> Processing Dependency: freetype-devel for package: qt3-devel-3.3.8b-51.el7.x86_64 +
---> Processing Dependency: fontconfig-devel for package: qt3-devel-3.3.8b-51.el7.x86_64 +
---> Processing Dependency: libqui.so.1()(64bit) for package: qt3-devel-3.3.8b-51.el7.x86_64 +
---> Processing Dependency: libqt-mt.so.3()(64bit) for package: qt3-devel-3.3.8b-51.el7.x86_64 +
---> Processing Dependency: libmng.so.1()(64bit) for package: qt3-devel-3.3.8b-51.el7.x86_64 +
----> Package rpmdevtools.noarch 0:8.3-5.el7 will be installed +
---> Processing Dependency: rpm-build >= 4.4.2.3 for package: rpmdevtools-8.3-5.el7.noarch +
---> Running transaction check +
----> Package fontconfig-devel.x86_64 0:2.10.95-7.el7 will be installed +
---> Processing Dependency: pkgconfig(expat) for package: fontconfig-devel-2.10.95-7.el7.x86_64 +
----> Package freetype-devel.x86_64 0:2.4.11-11.el7 will be installed +
---> Processing Dependency: zlib-devel for package: freetype-devel-2.4.11-11.el7.x86_64 +
----> Package libICE-devel.x86_64 0:1.0.9-2.el7 will be installed +
----> Package libSM-devel.x86_64 0:1.2.2-2.el7 will be installed +
----> Package libX11-devel.x86_64 0:1.6.3-2.el7 will be installed +
---> Processing Dependency: pkgconfig(xcb) >= 1.1.92 for package: libX11-devel-1.6.3-2.el7.x86_64 +
---> Processing Dependency: pkgconfig(xcb) for package: libX11-devel-1.6.3-2.el7.x86_64 +
----> Package libXcursor-devel.x86_64 0:1.1.14-2.1.el7 will be installed +
----> Package libXext-devel.x86_64 0:1.3.3-3.el7 will be installed +
----> Package libXfixes-devel.x86_64 0:5.0.1-2.1.el7 will be installed +
----> Package libXft-devel.x86_64 0:2.3.2-2.el7 will be installed +
----> Package libXinerama-devel.x86_64 0:1.1.3-2.1.el7 will be installed +
----> Package libXrandr-devel.x86_64 0:1.4.2-2.el7 will be installed +
----> Package libXrender-devel.x86_64 0:0.9.8-2.1.el7 will be installed +
----> Package libXt-devel.x86_64 0:1.1.4-6.1.el7 will be installed +
----> Package libjpeg-turbo-devel.x86_64 0:1.2.90-5.el7 will be installed +
----> Package libmng.x86_64 0:1.0.10-14.el7 will be installed +
----> Package libmng-devel.x86_64 0:1.0.10-14.el7 will be installed +
----> Package libpng-devel.x86_64 2:1.5.13-7.el7_2 will be installed +
----> Package libstdc++-devel.x86_64 0:4.8.5-4.el7 will be installed +
----> Package mesa-libGL-devel.x86_64 0:10.6.5-3.20150824.el7 will be installed +
---> Processing Dependency: pkgconfig(xshmfence) >= 1.1 for package: mesa-libGL-devel-10.6.5-3.20150824.el7.x86_64 +
---> Processing Dependency: pkgconfig(libdrm) >= 2.4.38 for package: mesa-libGL-devel-10.6.5-3.20150824.el7.x86_64 +
---> Processing Dependency: pkgconfig(xxf86vm) for package: mesa-libGL-devel-10.6.5-3.20150824.el7.x86_64 +
---> Processing Dependency: pkgconfig(xdamage) for package: mesa-libGL-devel-10.6.5-3.20150824.el7.x86_64 +
---> Processing Dependency: gl-manpages for package: mesa-libGL-devel-10.6.5-3.20150824.el7.x86_64 +
----> Package mesa-libGLU-devel.x86_64 0:9.0.0-4.el7 will be installed +
----> Package qt3.x86_64 0:3.3.8b-51.el7 will be installed +
----> Package rpm-build.x86_64 0:4.11.3-17.el7 will be installed +
---> Processing Dependency: system-rpm-config for package: rpm-build-4.11.3-17.el7.x86_64 +
---> Processing Dependency: perl(Thread::Queue) for package: rpm-build-4.11.3-17.el7.x86_64 +
----> Package xorg-x11-proto-devel.noarch 0:7.7-12.el7 will be installed +
---> Running transaction check +
----> Package expat-devel.x86_64 0:2.1.0-8.el7 will be installed +
----> Package gl-manpages.noarch 0:1.1-7.20130122.el7 will be installed +
----> Package libXdamage-devel.x86_64 0:1.1.4-4.1.el7 will be installed +
----> Package libXxf86vm-devel.x86_64 0:1.1.3-2.1.el7 will be installed +
----> Package libdrm-devel.x86_64 0:2.4.60-3.el7 will be installed +
----> Package libxcb-devel.x86_64 0:1.11-4.el7 will be installed +
---> Processing Dependency: pkgconfig(xau) >= 0.99.2 for package: libxcb-devel-1.11-4.el7.x86_64 +
----> Package libxshmfence-devel.x86_64 0:1.2-1.el7 will be installed +
----> Package perl-Thread-Queue.noarch 0:3.02-2.el7 will be installed +
----> Package redhat-rpm-config.noarch 0:9.1.0-68.el7.centos will be installed +
---> Processing Dependency: dwz >= 0.4 for package: redhat-rpm-config-9.1.0-68.el7.centos.noarch +
---> Processing Dependency: perl-srpm-macros for package: redhat-rpm-config-9.1.0-68.el7.centos.noarch +
----> Package zlib-devel.x86_64 0:1.2.7-15.el7 will be installed +
---> Running transaction check +
----> Package dwz.x86_64 0:0.11-3.el7 will be installed +
----> Package libXau-devel.x86_64 0:1.0.8-2.1.el7 will be installed +
----> Package perl-srpm-macros.noarch 0:1-8.el7 will be installed +
---Finished Dependency Resolution+
  
-Dependencies Resolved+Constatez maintenant le résultat :
  
-======================================================================================================================================================================== +<code> 
- Package                                       Arch                            Version                                           Repository                        Size +[root@centos6 ~]# ifconfig 
-======================================================================================================================================================================== +eth0      Link encap:Ethernet  HWaddr 08:00:27:48:7D:7F   
-Installing+          inet adr:10.0.2.15  Bcast:10.0.2.255  Masque:255.255.255.0 
- gcc-c++                                       x86_64                          4.8.5-4.el7                                       base                             7.2 M +          adr inet6: fe80::a00:27ff:fe48:7d7f/64 Scope:Lien 
- libXi-devel                                   x86_64                          1.7.4-2.el7                                       base                             105 k +          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:
- ncurses-devel                                 x86_64                          5.9-13.20130511.el7                               base                             713 k +          RX packets:16904 errors:dropped:overruns:frame:
- qt3-devel                                     x86_64                          3.3.8b-51.el7                                     base                             8.8 M +          TX packets:15337 errors:0 dropped:overruns:0 carrier:
- rpmdevtools                                   noarch                          8.3-5.el7                                         base                              97 k +          collisions:0 lg file transmission:1000  
-Installing for dependencies: +          RX bytes:12445250 (11.8 MiB)  TX bytes:4816855 (4.5 MiB)
- dwz                                           x86_64                          0.11-3.el7                                        base                              99 k +
- expat-devel                                   x86_64                          2.1.0-8.el7                                       base                              56 k +
- fontconfig-devel                              x86_64                          2.10.95-7.el7                                     base                             128 k +
- freetype-devel                                x86_64                          2.4.11-11.el7                                     base                             356 k +
- gl-manpages                                   noarch                          1.1-7.20130122.el7                                base                             994 k +
- libICE-devel                                  x86_64                          1.0.9-2.el7                                       base                              49 k +
- libSM-devel                                   x86_64                          1.2.2-2.el7                                       base                              13 k +
- libX11-devel                                  x86_64                          1.6.3-2.el7                                       base                             980 k +
- libXau-devel                                  x86_64                          1.0.8-2.1.el7                                     base                              14 k +
- libXcursor-devel                              x86_64                          1.1.14-2.1.el7                                    base                              23 k +
- libXdamage-devel                              x86_64                          1.1.4-4.1.el7                                     base                             9.7 k +
- libXext-devel                                 x86_64                          1.3.3-3.el7                                       base                              75 k +
- libXfixes-devel                               x86_64                          5.0.1-2.1.el7                                     base                              13 k +
- libXft-devel                                  x86_64                          2.3.2-2.el7                                       base                              19 k +
- libXinerama-devel                             x86_64                          1.1.3-2.1.el7                                     base                              13 k +
- libXrandr-devel                               x86_64                          1.4.2-2.el7                                       base                              21 k +
- libXrender-devel                              x86_64                          0.9.8-2.1.el7                                     base                              16 k +
- libXt-devel                                   x86_64                          1.1.4-6.1.el7                                     base                             445 k +
- libXxf86vm-devel                              x86_64                          1.1.3-2.1.el7                                     base                              18 k +
- libdrm-devel                                  x86_64                          2.4.60-3.el7                                      base                              92 k +
- libjpeg-turbo-devel                           x86_64                          1.2.90-5.el7                                      base                              98 k +
- libmng                                        x86_64                          1.0.10-14.el7                                     base                             171 k +
- libmng-devel                                  x86_64                          1.0.10-14.el7                                     base                              85 k +
- libpng-devel                                  x86_64                          2:1.5.13-7.el7_2                                  updates                          122 k +
- libstdc++-devel                               x86_64                          4.8.5-4.el7                                       base                             1.5 M +
- libxcb-devel                                  x86_64                          1.11-4.el7                                        base                             1.1 M +
- libxshmfence-devel                            x86_64                          1.2-1.el7                                         base                             5.4 k +
- mesa-libGL-devel                              x86_64                          10.6.5-3.20150824.el7                             base                             147 k +
- mesa-libGLU-devel                             x86_64                          9.0.0-4.el7                                       base                             9.k +
- perl-Thread-Queue                             noarch                          3.02-2.el7                                        base                              17 k +
- perl-srpm-macros                              noarch                          1-8.el7                                           base                             4.6 k +
- qt3                                           x86_64                          3.3.8b-51.el7                                     base                             3.5 +
- redhat-rpm-config                             noarch                          9.1.0-68.el7.centos                               base                              77 k +
- rpm-build                                     x86_64                          4.11.3-17.el7                                     base                             143 k +
- xorg-x11-proto-devel                          noarch                          7.7-12.el7                                        base                             281 k +
- zlib-devel                                    x86_64                          1.2.7-15.el7                                      base                              50 k+
  
-Transaction Summary +eth0:   Link encap:Ethernet  HWaddr 08:00:27:48:7D:7F   
-======================================================================================================================================================================== +          inet adr:192.168.1.2  Bcast:192.168.1.255  Masque:255.255.255.0 
-Install  5 Packages (+36 Dependent packages)+          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
  
-Total download size27 M +lo        Link encap:Boucle locale   
-Installed size90 M +          inet adr:127.0.0.1  Masque:255.0.0.0 
-Is this ok [y/d/N]y+          adr inet6: ::1/128 Scope:Hôte 
 +          UP LOOPBACK RUNNING  MTU:16436  Metric:1 
 +          RX packets:8 errors:0 dropped:0 overruns:0 frame:0 
 +          TX packets:8 errors:0 dropped:0 overruns:0 carrier:0 
 +          collisions:0 lg file transmission:0  
 +          RX bytes:480 (480.0 b)  TX bytes:480 (480.0 b)
 </code> </code>
  
-<WRAP center round alert> +===Options de la commande ifconfig===
-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 plusieurs Go d'espace libre. +
-</WRAP>+
  
-====Déplacer /home====+Les options de cette commande sont :
  
-<WRAP center round todo+<code
-Arrêtez votre machine virtuelle. Ajoutez un deuxième disque de 20 Go au contrôleur SATA en utilisant la section **Stockage** des paramètres de la machine virtuelle. Le format du disque doit être **vmdk**. Nommez ce disque **RedHatHome** et re-démarrez la machine virtuelle en vous connectant directement en tant que **root**. +[root@centos6 ~]# ifconfig --help 
-</WRAP>+Usage: 
 +  ifconfig [-a] [-v] [-s] <interface> [[<AF>] <address>
 +  [add <adresse>[/<lg_prefixe>]] 
 +  [del <adresse>[/<lg_prefixe>]] 
 +  [[-]broadcast [<adresse>]]  [[-]pointopoint [<adresse>]] 
 +  [netmask <address> [dstaddr <address> [tunnel <address>
 +  [outfill <NN>] [keepalive <NN>
 +  [hw <HW> <adresse> [metric <NN> [mtu <NN>
 +  [[-]trailers]  [[-]arp]  [[-]allmulti] 
 +  [multicast]  [[-]promisc] 
 +  [mem_start <NN> [io_addr <NN> [irq <NN> [media <type>
 +  [txqueuelen <NN>
 +  [[-]dynamic] 
 +  [up|down] ...
  
-Créez une seule partition sur **/dev/sdb** :+  <HW>=Type de matériel. 
 +  Liste des types de matériels possibles: 
 +    loop (Boucle locale) slip (IP ligne série) cslip (IP ligne série - VJ )  
 +    slip6 (IP ligne série - 6 bits) cslip6 (IP ligne série - 6 bits VJ) adaptive (IP ligne série adaptative)  
 +    strip (Metricom Starmode IP) ash (Ash) ether (Ethernet)  
 +    tr (16/4 Mbps Token Ring) tr (16/4 Mbps Token Ring (New)) ax25 (AMPR AX.25)  
 +    netrom (AMPR NET/ROM) rose (AMPR ROSE) tunnel (IPIP Tunnel)  
 +    ppp (Protocole Point-à-Point) hdlc ((Cisco)-HDLC) lapb (LAPB)  
 +    arcnet (ARCnet) dlci (Frame Relay DLCI) frad (Périphériue d'accès Frame Relay)  
 +    sit (IPv6-dans-IPv4) fddi (Fiber Distributed Data Interface) hippi (HIPPI)  
 +    irda (IrLAP) ec (Econet) x25 (generic X.25)  
 +    infiniband (InfiniBand)  
 +  <AF>=famille d'Adresses. Défaut: inet 
 +  Liste des familles d'adresses possibles: 
 +    unix (Domaine UNIX) inet (DARPA Internet) inet6 (IPv6)  
 +    ax25 (AMPR AX.25) netrom (AMPR NET/ROM) rose (AMPR ROSE)  
 +    ipx (Novell IPX) ddp (Appletalk DDP) ec (Econet)  
 +    ash (Ash) x25 (CCITT X.25)  
 +</code> 
 + 
 +====Activer/Désactiver une Interface Manuellement==== 
 + 
 +Deux commandes existent pour activer et désactiver manuellement une interface réseau :
  
 <code> <code>
-[root@centos7 ~]# fdisk /dev/sdb +[root@centos6 ~]# ifdown eth0 
-Welcome to fdisk (util-linux 2.23.2).+[root@centos6 ~]# ifconfig 
 +lo        Link encap:Boucle locale   
 +          inet adr:127.0.0.1  Masque:255.0.0.0 
 +          adr inet6: ::1/128 Scope:Hôte 
 +          UP LOOPBACK RUNNING  MTU:65536  Metric:1 
 +          RX packets:384 errors:0 dropped:0 overruns:0 frame:0 
 +          TX packets:384 errors:0 dropped:0 overruns:0 carrier:0 
 +          collisions:0 lg file transmission:0  
 +          RX bytes:32496 (31.7 KiB TX bytes:32496 (31.7 KiB)
  
-Changes will remain in memory only, until you decide to write them+[root@centos6 ~]# ifup eth0 
-Be careful before using the write command.+État de connexion active&nbsp;: activation 
 +État de chemin actif&nbsp;: /org/freedesktop/NetworkManager/ActiveConnection/
 +état&nbsp;: activé 
 +Connexion activée 
 +[root@centos6 ~]# ifconfig 
 +eth0      Link encap:Ethernet  HWaddr 08:00:27:9B:55:B1   
 +          inet adr:10.0.2.15  Bcast:10.0.2.255  Masque:255.255.255.0 
 +          adr inet6: fe80::a00:27ff:fe9b:55b1/64 Scope:Lien 
 +          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1 
 +          RX packets:27 errors:0 dropped:0 overruns:0 frame:0 
 +          TX packets:42 errors:0 dropped:0 overruns:0 carrier:0 
 +          collisions:0 lg file transmission:1000  
 +          RX bytes:4271 (4.1 KiB)  TX bytes:6145 (6.0 KiB)
  
-Device does not contain a recognized partition table +lo        Link encap:Boucle locale   
-Building a new DOS disklabel with disk identifier 0x88708329.+          inet adr:127.0.0.1  Masque:255.0.0.0 
 +          adr inet6: ::1/128 Scope:Hôte 
 +          UP LOOPBACK RUNNING  MTU:65536  Metric:1 
 +          RX packets:392 errors:0 dropped:0 overruns:0 frame:0 
 +          TX packets:392 errors:0 dropped:0 overruns:0 carrier:0 
 +          collisions:0 lg file transmission:0  
 +          RX bytes:33600 (32.8 KiB)  TX bytes:33600 (32.8 KiB) 
 +</code>
  
-Command (m for help): n +===/etc/networks===
-Partition type: +
-     primary (0 primary, 0 extended, 4 free) +
-     extended +
-Select (default p): p +
-Partition number (1-4, default 1):  +
-First sector (2048-41943039, default 2048):  +
-Using default value 2048 +
-Last sector, +sectors or +size{K,M,G} (2048-41943039, default 41943039):  +
-Using default value 41943039 +
-Partition 1 of type Linux and of size 20 GiB is set+
  
-Command (m for help)+Ce fichier contient la correspondance entre des noms de réseaux et l'adresse IP du réseau :
-The partition table has been altered!+
  
-Calling ioctl() to re-read partition table+<code> 
-Syncing disks.+[root@centos6 ~]# cat /etc/networks  
 +default 0.0.0.0 
 +loopback 127.0.0.0 
 +link-local 169.254.0.0
 </code> </code>
  
-Créez maintenant un système de fichiers ext4 sur **/dev/sdb1** :+=== Résolution d'adresses IP === 
 + 
 +La configuration DNS est stockée dans le fichier **/etc/resolv.conf**
 + 
 + 
 +== /etc/resolv.conf == 
 + 
 +La configuration DNS est stockée dans le fichier /etc/resolv.conf :
  
 <code> <code>
-[root@centos7 ~]# mkfs.ext4 /dev/sdb1 +[root@centos6 ~]# cat /etc/resolv.conf 
-mke2fs 1.42.9 (28-Dec-2013) +# Generated by NetworkManager
-Filesystem label= +
-OS type: Linux +
-Block size=4096 (log=2) +
-Fragment size=4096 (log=2) +
-Stride=0 blocks, Stripe width=0 blocks +
-1310720 inodes, 5242624 blocks +
-262131 blocks (5.00%) reserved for the super user +
-First data block=0 +
-Maximum filesystem blocks=2153775104 +
-160 block groups +
-32768 blocks per group, 32768 fragments per group +
-8192 inodes per group +
-Superblock backups stored on blocks:  +
- 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,  +
- 4096000+
  
-Allocating group tables: done                             + 
-Writing inode tables: done                             +# No nameservers found; try putting DNS servers into your 
-Creating journal (32768 blocks)done +# ifcfg files in /etc/sysconfig/network-scripts like so
-Writing superblocks and filesystem accounting information: done +
 +# DNS1=xxx.xxx.xxx.xxx 
 +# DNS2=xxx.xxx.xxx.xxx 
 +# DOMAIN=lab.foo.com bar.foo.com 
 +nameserver 8.8.8.8 
 +nameserver 8.8.4.4 
 +search fenestros.loc 
 </code> </code>
  
-Montez **/dev/sdb1** sur /mnt :+<WRAP center round important> 
 +Notez que les DNS utilisés sont les serveurs DNS publics de Google. 
 +</WRAP> 
 + 
 + 
 +==/etc/nsswitch.conf== 
 + 
 +L'ordre de recherche des services de noms est stocké dans le fichier **/etc/nsswitch.conf**. Pour connaître l'ordre, saisissez la commande suivante :
  
 <code> <code>
-[root@centos7 ~]# mount /dev/sdb1 /mnt+[root@centos6 ~]# grep '^hosts:' /etc/nsswitch.conf 
 +hosts:      files dns
 </code> </code>
  
-Copiez le contenu de /home vers /mnt :+== /etc/hosts == 
 + 
 +Le mot **files** dans la sortie de la commande précédente fait référence au fichier **/etc/hosts** :
  
 <code> <code>
-[root@centos7 ~]# cp -a /home/* /mnt+[root@centos6 ~]# cat /etc/hosts 
 +10.0.2.15 centos6 # Added by NetworkManager 
 +127.0.0.1 localhost.localdomain localhost 
 +::1 centos6 localhost6.localdomain6 localhost6
 </code> </code>
  
-Démontez /dev/sdb1 et déplacez /home vers /root :+Pour tester le serveur DNS, deux commandes sont possibles :
  
 <code> <code>
-[root@centos7 ~]# umount /mnt +[root@centos6 ~]# nslookup www.i2tch.com 
-[root@centos7 ~]# mv /home /root+Server: 8.8.8.8 
 +Address: 8.8.8.8#53 
 + 
 +Non-authoritative answer: 
 +www.i2tch.com canonical name = i2tch.com. 
 +Name: i2tch.com 
 +Address: 90.119.37.144 
 + 
 +[root@centos6 ~]# dig www.i2tch.com 
 + 
 +; <<>> DiG 9.10.3-P4-Ubuntu <<>> www.i2tch.com 
 +;; global options: +cmd 
 +;; Got answer: 
 +;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 25061 
 +;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 1 
 + 
 +;; OPT PSEUDOSECTION: 
 +; EDNS: version: 0, flags:; udp: 65494 
 +;; QUESTION SECTION: 
 +;www.i2tch.com. IN A 
 + 
 +;; ANSWER SECTION: 
 +www.i2tch.com. 6563 IN CNAME i2tch.com. 
 +i2tch.com. 50 IN A 90.119.37.144 
 + 
 +;; Query time: 1 msec 
 +;; SERVER: 8.8.8.8#53(8.8.8.8) 
 +;; WHEN: Mon Jan 22 18:00:27 CET 2018 
 +;; MSG SIZE  rcvd: 72
 </code> </code>
  
-Identifiez l'UUID de /dev/sdb1 :+==== Services réseaux ==== 
 + 
 +Quand un client émet une demande de connexion vers une application réseau sur un serveur, il utilise un socket attaché à un port local **supérieur à 1023**, alloué d'une manière dynamique. La requête contient le port de destination sur le serveur. Certaines applications serveurs se gèrent toutes seules, ce qui est la cas par exemple d'**httpd**. Par contre d'autres sont gérées par le service **xinetd**.  
 + 
 +=== xinetd === 
 + 
 +Sous RHEL/CentOS 6 xinetd n'est pas installé par défaut. Installez-le grâce à yum :
  
 <code> <code>
-[root@centos7 ~]# ls -l /dev/disk/by-uuid/ | grep sdb1 +[root@centos6 ~]# yum install xinetd 
-lrwxrwxrwx1 root root 10  9 août  06:47 a5e2457f-7337-41f4-b958-e403eb419f94 -> ../../sdb1+Loaded plugins: fastestmirror, refresh-packagekit 
 +Loading mirror speeds from cached hostfile 
 + * base: fr2.rpmfind.net 
 + * extrasfr2.rpmfind.net 
 + * updates: fr2.rpmfind.net 
 +Setting up Install Process 
 +Resolving Dependencies 
 +--> Running transaction check 
 +---> Package xinetd.i686 2:2.3.14-33.el6 set to be updated 
 +--> Finished Dependency Resolution 
 + 
 +Dependencies Resolved 
 + 
 +================================================================================ 
 + Package          Arch           Version                   Repository      Size 
 +================================================================================ 
 +Installing: 
 + xinetd           i686           2:2.3.14-33.el6           base           121 k 
 + 
 +Transaction Summary 
 +================================================================================ 
 +Install       1 Package(s) 
 +Upgrade       0 Package(s) 
 + 
 +Total download size: 121 k 
 +Installed size: 258 k 
 +Is this ok [y/N]: y 
 +Downloading Packages: 
 +xinetd-2.3.14-33.el6.i686.rpm                            | 121 kB     00:00      
 +Running rpm_check_debug 
 +Running Transaction Test 
 +Transaction Test Succeeded 
 +Running Transaction 
 +  Installing     : 2:xinetd-2.3.14-33.el6.i686                              1/1  
 + 
 +Installed: 
 +  xinetd.i686 2:2.3.14-33.el6                                                    
 + 
 +Complete!
 </code> </code>
  
-Editez le fichier **/etc/fstab** :+Le programme xinetd est configuré via le fichier **/etc/xinetd.conf** :
  
-<file txt /etc/fstab>+<code> 
 +[root@centos6 ~]# cat /etc/xinetd.conf
 # #
-/etc/fstab +This is the master xinetd configuration file. Settings in the 
-Created by anaconda on Sat Apr 30 11:27:02 2016+default section will be inherited by all service configurations 
 +# unless explicitly overridden in the service configuration. See 
 +# xinetd.conf in the man pages for a more detailed explanation of 
 +# these attributes. 
 + 
 +defaults 
 +
 +# The next two items are intended to be a quick access place to 
 +# temporarily enable or disable services.
 # #
-Accessible filesystems, by reference, are maintained under '/dev/disk' +# enabled = 
-See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info+# disabled = 
 + 
 +# Define general logging characteristics. 
 + log_type = SYSLOG daemon info  
 + log_on_failure = HOST 
 + log_on_success = PID HOST DURATION EXIT 
 + 
 +# Define access restriction defaults
 # #
-UUID=e65fe7da-cda8-4f5a-a827-1b5cabe94bed /                       xfs     defaults        0 0 +# no_access
-UUID=2d947276-66e8-41f4-8475-b64b67d7a249 /boot                   xfs     defaults        0 +# only_from = 
-UUID=3181601a-7295-4ef0-a92c-f21f76b18e64 swap                    swap    defaults        0 0 +# max_load = 0 
-UUID=a5e2457f-7337-41f4-b958-e403eb419f94 /home           ext4   defaults       1 2+ cps 50 10 
 + instances = 50 
 + per_source 10
  
 +# Address and networking defaults
 +#
 +# bind =
 +# mdns = yes
 + v6only = no
 +
 +# setup environmental attributes
 +#
 +# passenv =
 + groups = yes
 + umask = 002
 +
 +# Generally, banners are not used. This sets up their global defaults
 +#
 +# banner =
 +# banner_fail =
 +# banner_success =
 +}
 +
 +includedir /etc/xinetd.d
 +</code>
 +
 +Les valeurs des directives dans le fichier **/etc/xinetd.conf** sont héritées par toutes les configurations des services sauf dans le cas où une variable est explicitement fixée dans un des fichiers de définitions des services se trouvant dans **/etc/xinetd.d**.
 +
 +Les variables les plus importantes dans **/etc/xinetd.conf** :
 +
 +^  Directive  ^  Déscription  ^
 +|  instances  | Le nombre de demandes d'accès simultanés |
 +|  log_type  | Indique à xinetd d'adresser les traces à SYSLOG avec l'étiquette de sous-système applicatif **daemon** et la priorité de **info** |
 +|  log_on_succes  | Indique que SYSLOG doit journaliser le PID, HOST, DURATION et EXIT en cas de succès |
 +|  log_on_failure  | Indique que SYSLOG doit journaliser le HOST en cas d'échec |
 +|  cps  | Indique 50 connexions par seconde avec un temps d'indisponibilité de 10 secondes si le seuil est atteint | 
 +
 +Les options concernant les journaux sont :
 +
 +|  HOST  | Journalisation de l'adresse IP de l'hôte distant |
 +|  PID  | Journalisation du PID du processus qui reçoit la demande d'accès |
 +|  DURATION  | Journalisation des durées d'utilisation |
 +|  EXIT  | Journalisation de l'état ou di signal de fin de service |
 +
 +Il est aussi possible de trouver les options suivantes pour les journaux :
 +
 +|  ATTEMPT  | Journalisation des connexions en échec |
 +|  USERID  | Journalisation des données concernant l'utilisateur selon la RFC 1413 |
 +
 +Examinons maintenant le répertoire **/etc/xinetd.d** : 
 +
 +<code>
 +[root@centos6 ~]# ls -l /etc/xinetd.d
 +total 52
 +-rw-------. 1 root root 1157  7 déc.  22:07 chargen-dgram
 +-rw-------. 1 root root 1159  7 déc.  22:07 chargen-stream
 +-rw-r--r--. 1 root root  523 25 juin   2011 cvs
 +-rw-------. 1 root root 1157  7 déc.  22:07 daytime-dgram
 +-rw-------. 1 root root 1159  7 déc.  22:07 daytime-stream
 +-rw-------. 1 root root 1157  7 déc.  22:07 discard-dgram
 +-rw-------. 1 root root 1159  7 déc.  22:07 discard-stream
 +-rw-------. 1 root root 1148  7 déc.  22:07 echo-dgram
 +-rw-------. 1 root root 1150  7 déc.  22:07 echo-stream
 +-rw-r--r--. 1 root root  332 20 mai    2009 rsync
 +-rw-------. 1 root root 1212  7 déc.  22:07 tcpmux-server
 +-rw-------. 1 root root 1149  7 déc.  22:07 time-dgram
 +-rw-------. 1 root root 1150  7 déc.  22:07 time-stream
 +</code>
 +
 +A l'examen de ce répertoire vous noterez que celui-ci contient des fichiers nominatifs par application-serveur, par exemple pour le serveur cvs :
 +
 +<code>
 +[root@centos6 ~]# cat /etc/xinetd.d/cvs
 +# default: off
 +# description: The CVS service can record the history of your source \
 +#              files. CVS stores all the versions of a file in a single \
 +#              file in a clever way that only stores the differences \
 +#              between versions.
 +service cvspserver
 +{
 + disable = yes
 + port = 2401
 + socket_type = stream
 + protocol = tcp
 + wait = no
 + user = root
 + passenv = PATH
 + server = /usr/bin/cvs
 + env = HOME=/var/cvs
 + server_args = -f --allow-root=/var/cvs pserver
 +# bind = 127.0.0.1
 +}
 +</code>
 +
 +Les directives principales de ce fichier sont :
 +
 +^  Paramètre  ^  Déscription  ^
 +|  disable  | **no** : Le service est actif. **yes** : Le service est désactivé |
 +|  port  | Le numéro de port ou, à défaut, le numéro indiqué pour le service dans le fichier /etc/services |
 +|  socket_type  | Nature du socket, soit **stream** pour TCP soit **dgram** pour UDP |
 +|  protocol  | Protocole utilisé soit **TCP** soit **UDP** |
 +|  wait  | **no** : indique si xinetd active un serveur par client. **yes** : indique que xinetd active un seul serveur pour tous les client | 
 +|  user  | Indique le compte sous lequel le serveur est exécuté |
 +|  server  | Indique le chemin d'accès de l'application serveur |
 +|  env  | Définit un environnement système |
 +|  server_args  | Donne les arguments transmis à l'application serveur |
 +
 +Cependant il est aussi possible d'utiliser les directives suivantes :
 +
 +^  Paramètre  ^  Déscription  ^  Exemple  ^
 +|  nice  | Fixe le niveau de nice entre -19 et +20 |  10  |
 +|  max_load  | Fixe la charge CPU maximum admise. Au delà aucune connexion supplémenatire en sera acceptée |  2.5  |
 +|  bind  | Limite le service à l'interface dont l'adresse IP est indiquée |  192.168.1.1  |
 +|  only_from  | Limite le service aux seuls clients indiqués par la plage donnée |  192.168.1.0/24 fenestros.loc  |
 +|  no_access  | Interdit le service aux clients indiqués par la plage donnée |  192.168.2.0/24, i2tch.loc 
 +|  access_time  | Limite l'accès au service à une plage horaire |  09:00-19:00  |
 +|  redirect  | Redirige les requêtes sur un port donné à une autre adresse IP |  192.168.1.10 23  |
 +
 +Afin d'activer une application serveur, il suffit de modifier le paramètre **disable** dans le fichier concerné et de relancer le service xinetd.
 +
 +=== TCP Wrapper ===
 +
 +**TCP Wrapper** contrôle l'accès à des services réseaux grâce à des **ACL**. 
 +
 +Quand une requête arrive pour un serveur, xinetd active le wrapper **tcpd** au lieu d'activer le serveur directement.
 +
 +**tcpd** met à jour un journal et vérifie si le client a le droit d'utiliser le service concerné. Les ACL se trouvent dans deux fichiers:
 +
 +  * **/etc/hosts.allow**
 +  * **/etc/hosts.deny**
 +
 +Il faut noter que si ces fichiers n'existent pas ou sont vides, il n'y a pas de contrôle d'accès.
 +
 +Le format d'une ligne dans un de ces deux fichiers est:
 +
 +<file>
 +démon : liste_de_clients
 </file> </file>
  
-Créez le point de montage /home :+Par exemple dans le cas d'un serveur **démon**, on verrait une ligne dans le fichier **/etc/hosts.allow** similaire à: 
 + 
 +<file> 
 +démon : LOCAL, .fenestros.loc 
 +</file> 
 + 
 +ce qui implique que les machines dont le nom ne comporte pas de point ainsi que les machines du domaine **fenestros.loc** sont autorisées à utiliser le service. 
 + 
 +Le mot clef **ALL** peut être utilisé pour indiquer tout. Par exemple, **ALL:ALL** dans le fichier **/etc/host.deny** bloque effectivement toute tentative de connexion à un service xinetd sauf pour les ACL inclus dans le fichier /etc/host.allow. 
 + 
 +====Routage Statique==== 
 + 
 +===La Commande route=== 
 + 
 +Pour afficher la table de routage de la machine vous pouvez utiliser la commande **route** :
  
 <code> <code>
-[root@centos7 ~]# mkdir /home+[root@centos6 ~]# route 
 +Table de routage IP du noyau 
 +Destination     Passerelle      Genmask         Indic Metric Ref    Use Iface 
 +192.168.1.0                   255.255.255.0            0        0 eth0 
 +10.0.2.0        *               255.255.255.0            0        0 eth0 
 +link-local      *               255.255.0.0         1002          0 eth0 
 +default         10.0.2.2        0.0.0.0         UG    0      0        0 eth0
 </code> </code>
  
-Montez /dev/sdb1 :+La table issue de la commande **route** indique les informations suivantes: 
 + 
 +  * La destination qui peut être un hôte ou un réseau et est identifiée par les champs **Destination** et **Genmask** 
 +  * La route à prendre identifiée par les champs **Gateway** et **Iface**. Dans le cas d'une valeur de 0.0.0.0 ceci spécifie une route directe. La valeur d'Iface spécifie la carte à utiliser, 
 +  * Le champ **Indic** qui peux prendre un ou plusieurs de svaleurs suivantes: 
 +    * U - **Up** - la route est active 
 +    * H - **Host** - la route conduit à un hôte 
 +    * G - **Gateways** - la route passe par une passerelle 
 +  * Le champ **Metric** indique le nombre de sauts (passerelles) pour atteindre la destination, 
 +  * Le champ **Ref** indique le nombre de références à cette route. Ce champs est usilisé par le Noyau de Linux, 
 +  * Le champ **Use** indique le nombre de recherches associés à cette route. 
 + 
 +La commande **route** permet aussi de paramétrer le routage indirect. Par exemple pour supprimer la route vers le réseau 192.168.1.0 :
  
 <code> <code>
-[root@centos7 ~]# mount -a +[root@centos6 ~]# route del -net 192.168.1.0 netmask 255.255.255.0 
-[root@centos7 ~]# mount +[root@centos6 ~]# route 
-sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime,seclabel) +Table de routage IP du noyau 
-proc on /proc type proc (rw,nosuid,nodev,noexec,relatime) +Destination     Passerelle      Genmask         Indic Metric Ref    Use Iface 
-devtmpfs on /dev type devtmpfs (rw,nosuid,seclabel,size=236036k,nr_inodes=59009,mode=755) +10.0.2.0        *               255.255.255.0            0        0 eth0 
-securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime) +link-local      *               255.255.0.0         1002          0 eth0 
-tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev,seclabel) +default         10.0.2.2        0.0.0.0         UG    0      0        0 eth0
-devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,seclabel,gid=5,mode=620,ptmxmode=000) +
-tmpfs on /run type tmpfs (rw,nosuid,nodev,seclabel,mode=755) +
-tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,seclabel,mode=755) +
-cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,xattr,release_agent=/usr/lib/systemd/systemd-cgroups-agent,name=systemd) +
-pstore on /sys/fs/pstore type pstore (rw,nosuid,nodev,noexec,relatime) +
-cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpuacct,cpu) +
-cgroup on /sys/fs/cgroup/hugetlb type cgroup (rw,nosuid,nodev,noexec,relatime,hugetlb) +
-cgroup on /sys/fs/cgroup/net_cls type cgroup (rw,nosuid,nodev,noexec,relatime,net_cls) +
-cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset) +
-cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer) +
-cgroup on /sys/fs/cgroup/memory type cgroup (rw,nosuid,nodev,noexec,relatime,memory) +
-cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio) +
-cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices) +
-cgroup on /sys/fs/cgroup/perf_event type cgroup (rw,nosuid,nodev,noexec,relatime,perf_event) +
-configfs on /sys/kernel/config type configfs (rw,relatime) +
-/dev/sda2 on / type xfs (rw,relatime,seclabel,attr2,inode64,noquota) +
-selinuxfs on /sys/fs/selinux type selinuxfs (rw,relatime) +
-systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=30,pgrp=1,timeout=300,minproto=5,maxproto=5,direct) +
-debugfs on /sys/kernel/debug type debugfs (rw,relatime) +
-hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime,seclabel) +
-mqueue on /dev/mqueue type mqueue (rw,relatime,seclabel) +
-tmpfs on /tmp type tmpfs (rw,seclabel) +
-sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw,relatime) +
-nfsd on /proc/fs/nfsd type nfsd (rw,relatime) +
-/dev/sda1 on /boot type xfs (rw,relatime,seclabel,attr2,inode64,noquota) +
-/dev/sdb1 on /home type ext4 (rw,relatime,seclabel,data=ordered) +
-tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,seclabel,size=50080k,mode=700,uid=1000,gid=1000)+
 </code> </code>
  
-Notez la taille de /home :+Pour ajouter la route vers le réseau 192.168.1.0 :
  
 <code> <code>
-[trainee@centos7 ~]$ df -+[root@centos6 ~]# route add -net 192.168.1.0 netmask 255.255.255.0 gw 192.168.1.2 
-Sys. de fichiers Taille Utilisé Dispo Uti% Monté sur +[root@centos6 ~]# route 
-/dev/sda2          9,8G    4,4G  5,5G  45% / +Table de routage IP du noyau 
-devtmpfs           231M        231M   0% /dev +Destination     Passerelle      Genmask         Indic Metric Ref    Use Iface 
-tmpfs              245M        245M   0% /dev/shm +192.168.1.0     192.168.1.2     255.255.255.0   UG                eth0 
-tmpfs              245M    4,7M  240M   2% /run +10.0.2.0        *               255.255.255.0   U                 0 eth0 
-tmpfs              245M        245M   0% /sys/fs/cgroup +link-local      *               255.255.0.0         1002   0        0 eth0 
-tmpfs              245M     72K  245M   1% /tmp +default         10.0.2.2        0.0.0.0         UG    0      0        eth0
-/dev/sda1          197M    197M   20K 100% /boot +
-/dev/sdb1           20G     65M   19G   1% /home +
-tmpfs               49M         49M   0% /run/user/1000+
 </code> </code>
  
-<WRAP center round todo+<WRAP center round important
-Fermez la session de root et connectez-vous en tant que trainee.+La commande utilisée pour ajouter une passerelle par défaut prend la forme suivante **route add default gw //numéro_ip// //interface//**.
 </WRAP> </WRAP>
  
-====Créer un Nouveau Noyau====+Les options cette commande sont :
  
-Pour créer l'arborescence de l'environnement de création de paquets dans /home/trainee, utilisez la commande **rpmdev-setuptree** :+<code> 
 +[root@centos6 ~]# route --help 
 +Syntaxe: route [-nNvee] [-FC] [<AF>          Liste les tables de routage noyau 
 +       route [-v] [-FC] {add|del|flush} ...  Modifie la table de routage pour AF. 
 + 
 +       route {-h|--help} [<AF>             Utilisation détaillée pour l'AF spécifié. 
 +       route {-V|--version}                  Affiche la version/auteur et termine. 
 + 
 +        -v, --verbose            mode verbeux 
 +        -n, --numeric            don't resolve names 
 +        -e, --extend             display other/more information 
 +        -F, --fib                display Forwarding Information Base (default) 
 +        -C, --cache              affiche le cache de routage au lieu de FIB 
 + 
 +  <AF>=Use '-A <af>' or '--<af>'; default: inet 
 +  Liste les familles d'adresses possibles (supportant le routage): 
 +    inet (DARPA Internet) inet6 (IPv6) ax25 (AMPR AX.25)  
 +    netrom (AMPR NET/ROM) ipx (Novell IPX) ddp (Appletalk DDP)  
 +    x25 (CCITT X.25)  
 +</code> 
 + 
 +Vous pouvez aussi utiliser la commande **netstat** pour afficher la table de routage de la machine :
  
 <code> <code>
-[trainee@centos7 ~]$ rpmdev-setuptree +[root@centos6 ~]# netstat -nr 
-[trainee@centos7 ~]$ ls -laR rpmbuild/ +Table de routage IP du noyau 
-rpmbuild/: +Destination     Passerelle      Genmask         Indic   MSS Fenêtre irtt Iface 
-total 28 +192.168.1.0     192.168.1.2     255.255.255.0   UG        0 0          0 eth0 
-drwxrwxr-x 7 trainee trainee 4096  9 août  06:56 . +192.168.1.0     0.0.0.0         255.255.255.0           0 0          0 eth0 
-drwx------15 trainee trainee 4096  9 août  06:56 .. +10.0.2.0        0.0.0.0         255.255.255.0           0 0          0 eth0 
-drwxrwxr-x trainee trainee 4096  9 août  06:56 BUILD +0.0.0.0         10.0.2.2        0.0.0.0         UG        0 0          0 eth0 
-drwxrwxr-x 2 trainee trainee 4096  9 août  06:56 RPMS +</code>
-drwxrwxr-x trainee trainee 4096  9 août  06:56 SOURCES +
-drwxrwxr-x trainee trainee 4096  9 août  06:56 SPECS +
-drwxrwxr-x trainee trainee 4096  9 août  06:56 SRPMS+
  
-rpmbuild/BUILD: +La table issue de la commande **netstat -nr** indique les informations suivantes:
-total 8 +
-drwxrwxr-x. 2 trainee trainee 4096  9 août  06:56 . +
-drwxrwxr-x. 7 trainee trainee 4096  9 août  06:56 ..+
  
-rpmbuild/RPMS: +  * La champ **MSS** indique la taille maximale des segments TCP sur la route, 
-total 8 +  * Le champ **Window** indique la taille de la fenêtre sur cette route, 
-drwxrwxr-x. 2 trainee trainee 4096  9 août  06:56 . +  * Le champ **irrt** indique le paramètre IRRT pour la route.
-drwxrwxr-x. 7 trainee trainee 4096  9 août  06:56 ..+
  
-rpmbuild/SOURCES: +===Activer/désactiver le routage sur le serveur===
-total 8 +
-drwxrwxr-x. 2 trainee trainee 4096  9 août  06:56 . +
-drwxrwxr-x. 7 trainee trainee 4096  9 août  06:56 ..+
  
-rpmbuild/SPECS: +Pour activer le routage sur le serveur, il convient d'activer la retransmission des paquets:
-total 8 +
-drwxrwxr-x. 2 trainee trainee 4096  9 août  06:56 . +
-drwxrwxr-x. 7 trainee trainee 4096  9 août  06:56 ..+
  
-rpmbuild/SRPMS: +<code> 
-total 8 +[root@centos6 ~]# echo 1 > /proc/sys/net/ipv4/ip_forward 
-drwxrwxr-x. 2 trainee trainee 4096  9 août  06:56 . +[root@centos6 ~]# cat /proc/sys/net/ipv4/ip_forward 
-drwxrwxr-x. 7 trainee trainee 4096  9 août  06:56 ..+1
 </code> </code>
  
-Téléchargez le rpm source du noyau :+Pour désactiver le routage sur le serveur, il convient de désactiver la retransmission des paquets:
  
 <code> <code>
-[trainee@centos7 ~]$ uname -a +[root@centos6 ~]# echo > /proc/sys/net/ipv4/ip_forward 
-Linux centos7.fenestros.loc 3.10.0-327.13.1.el7.x86_64 #1 SMP Thu Mar 31 16:04:38 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux+[root@centos6 ~]cat /proc/sys/net/ipv4/ip_forward 
 +
 +</code>
  
-[trainee@centos7 ~]$ wget http://vault.centos.org/7.2.1511/updates/Source/SPackages/kernel-3.10.0-327.13.1.el7.src.rpm +=====Configuration du Réseau sous RHEL/CentOS 7=====
---2016-08-09 06:57:08--  http://vault.centos.org/7.2.1511/updates/Source/SPackages/kernel-3.10.0-327.13.1.el7.src.rpm +
-Résolution de vault.centos.org (vault.centos.org)... 88.208.217.170, 2a00:f10:10b:13::10 +
-Connexion vers vault.centos.org (vault.centos.org)|88.208.217.170|:80...connecté. +
-requête HTTP transmise, en attente de la réponse...200 OK +
-Longueur: 83047820 (79M) [application/x-rpm] +
-Sauvegarde en : «kernel-3.10.0-327.13.1.el7.src.rpm»+
  
-100%[==============================================================================================================================>] 83 047 820   496KB/s   ds 2m 52s +RHEL/CentOS 7 utilise exclusivement **Network Manager** pour gérer le réseau. Network Manager est composé de deux éléments :
  
-2016-08-09 07:00:00 (471 KB/s) - «kernel-3.10.0-327.13.1.el7.src.rpm» sauvegardé [83047820/83047820]+  * un service qui gère les connexions réseaux et rapporte leurs états, 
 +  * des front-ends qui passent par un API de configuration du service. 
 + 
 +<WRAP center round important> 
 +**Important** : Notez qu'avec cette version de NetworkManager, IPv6 est activée par défaut. 
 +</WRAP> 
 + 
 +Le service NetworkManager doit toujours être lancé : 
 + 
 +<code> 
 +[root@centos7 ~]# 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 2016-08-07 09:18:20 CEST; 1 day 1h ago 
 + Main PID: 673 (NetworkManager) 
 +   CGroup: /system.slice/NetworkManager.service 
 +           ├─ 673 /usr/sbin/NetworkManager --no-daemon 
 +           └─2673 /sbin/dhclient -d -q -sf /usr/libexec/nm-dhcp-helper -pf /var/run/dhclient-enp0s3.pid -lf /var/lib/NetworkManager/dhclient-45b701c1-0a21-4d76-a795-...
  
 +Aug 08 11:03:55 centos7.fenestros.loc NetworkManager[673]: <info>    nameserver '8.8.8.8'
 +Aug 08 11:03:55 centos7.fenestros.loc NetworkManager[673]: <info>  (enp0s3): DHCPv4 state changed unknown -> bound
 +Aug 08 11:03:55 centos7.fenestros.loc NetworkManager[673]: <info>  (enp0s3): device state change: ip-config -> ip-check (reason 'none') [70 80 0]
 +Aug 08 11:03:55 centos7.fenestros.loc NetworkManager[673]: <info>  (enp0s3): device state change: ip-check -> secondaries (reason 'none') [80 90 0]
 +Aug 08 11:03:55 centos7.fenestros.loc NetworkManager[673]: <info>  (enp0s3): device state change: secondaries -> activated (reason 'none') [90 100 0]
 +Aug 08 11:03:55 centos7.fenestros.loc NetworkManager[673]: <info>  NetworkManager state is now CONNECTED_LOCAL
 +Aug 08 11:03:55 centos7.fenestros.loc NetworkManager[673]: <info>  NetworkManager state is now CONNECTED_GLOBAL
 +Aug 08 11:03:55 centos7.fenestros.loc NetworkManager[673]: <info>  Policy set 'Wired connection 1' (enp0s3) as default for IPv4 routing and DNS.
 +Aug 08 11:03:55 centos7.fenestros.loc NetworkManager[673]: <info>  (enp0s3): Activation: successful, device activated.
 +Aug 08 11:03:55 centos7.fenestros.loc dhclient[2673]: bound to 10.0.2.15 -- renewal in 39589 seconds.
 </code> </code>
  
-Installez maintenant les dépendances pour le rpm source en tant que root :+====La Commande nmcli==== 
 + 
 +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>
-[trainee@centos7 ~]$ su - +[root@centos7 ~]# nmcli help 
-Mot de passe fenestros +Usagenmcli [OPTIONSOBJECT { COMMAND help }
-[root@centos7 ~]# yum-builddep /home/trainee/kernel-3.10.0-327.13.1.el7.src.rpm  +
-Loaded plugins: fastestmirror, langpacks +
-Enabling base-source repository +
-Enabling extras-source repository +
-Enabling updates-source repository +
-base-source                                                                                                                                      2.9 kB  00:00:00      +
-extras-source                                                                                                                                    | 2.9 kB  00:00:00      +
-updates-source                                                                                                                                   | 2.9 kB  00:00:00      +
-(1/3): extras-source/7/primary_db                                                                                                                |  43 kB  00:00:00      +
-(2/3): base-source/7/primary_db                                                                                                                  | 949 kB  00:00:00      +
-(3/3): updates-source/7/primary_db                                                                                                               | 140 kB  00:00:00      +
-Loading mirror speeds from cached hostfile +
- * base: centos.mirrors.ovh.net +
- * extras: centos.mirror.fr.planethoster.net +
- * updates: mirror1.evolution-host.com +
-Checking for new repos for mirrors +
-Getting requirements for kernel-3.10.0-327.13.1.el7.src +
- --> Already installed : kmod-20-5.el7.x86_64 +
- --> Already installed : patch-2.7.1-8.el7.x86_64 +
- --> Already installed : bash-4.2.46-19.el7.x86_64 +
- --> Already installed : coreutils-8.22-15.el7_2.1.x86_64 +
- --> Already installed : 2:tar-1.26-29.el7.x86_64 +
- --> Already installed : xz-5.1.2-12alpha.el7.x86_64 +
- --> Already installed : 1:findutils-4.5.11-5.el7.x86_64 +
- --> Already installed : gzip-1.5-8.el7.x86_64 +
- --> m4-1.4.16-10.el7.x86_64 +
- --> Already installed : 4:perl-5.16.3-286.el7.x86_64 +
- --> Already installed : 1:make-3.82-21.el7.x86_64 +
- --> Already installed : diffutils-3.3-4.el7.x86_64 +
- --> Already installed : gawk-4.0.2-4.el7.x86_64 +
- --> Already installed : gcc-4.8.5-4.el7.x86_64 +
- --> Already installed : binutils-2.23.52.0.1-55.el7.x86_64 +
- --> Already installed : redhat-rpm-config-9.1.0-68.el7.centos.noarch +
- --> Already installed : hostname-3.13-3.el7.x86_64 +
- --> Already installed : net-tools-2.0-0.17.20131004git.el7.x86_64 +
- --> Already installed : bc-1.06.95-13.el7.x86_64 +
- --> xmlto-0.0.25-7.el7.x86_64 +
- --> asciidoc-8.6.8-5.el7.noarch +
- --> Already installed : 1:openssl-1.0.1e-51.el7_2.4.x86_64 +
- --> hmaccalc-0.9.13-4.el7.x86_64 +
- --> python-devel-2.7.5-34.el7.x86_64 +
- --> newt-devel-0.52.15-4.el7.x86_64 +
- --> perl-ExtUtils-Embed-1.30-286.el7.noarch +
- --> Already installed : rpm-build-4.11.3-17.el7.x86_64 +
- --> Already installed : elfutils-0.163-3.el7.x86_64 +
---> Running transaction check +
----> Package asciidoc.noarch 0:8.6.8-5.el7 will be installed +
---> Processing Dependency: source-highlight for package: asciidoc-8.6.8-5.el7.noarch +
---> Processing Dependency: graphviz for package: asciidoc-8.6.8-5.el7.noarch +
---> Processing Dependency: docbook-style-xsl for package: asciidoc-8.6.8-5.el7.noarch +
----> Package hmaccalc.x86_64 0:0.9.13-4.el7 will be installed +
----> Package m4.x86_64 0:1.4.16-10.el7 will be installed +
----> Package newt-devel.x86_64 0:0.52.15-4.el7 will be installed +
---> Processing Dependency: slang-devel for package: newt-devel-0.52.15-4.el7.x86_64 +
----> Package perl-ExtUtils-Embed.noarch 0:1.30-286.el7 will be installed +
---> Processing Dependency: perl-devel for package: perl-ExtUtils-Embed-1.30-286.el7.noarch +
----> Package python-devel.x86_64 0:2.7.5-34.el7 will be installed +
----> Package xmlto.x86_64 0:0.0.25-7.el7 will be installed +
---> Processing Dependency: text-www-browser for package: xmlto-0.0.25-7.el7.x86_64 +
---> Processing Dependency: flex for package: xmlto-0.0.25-7.el7.x86_64 +
---> Processing Dependency: docbook-dtds for package: xmlto-0.0.25-7.el7.x86_64 +
---> Running transaction check +
----> Package docbook-dtds.noarch 0:1.0-60.el7 will be installed +
---> Processing Dependency: sgml-common for package: docbook-dtds-1.0-60.el7.noarch +
----> Package docbook-style-xsl.noarch 0:1.78.1-3.el7 will be installed +
----> Package flex.x86_64 0:2.5.37-3.el7 will be installed +
----> Package graphviz.x86_64 0:2.30.1-19.el7 will be installed +
---> Processing Dependency: libXaw.so.7()(64bit) for package: graphviz-2.30.1-19.el7.x86_64 +
----> Package lynx.x86_64 0:2.8.8-0.3.dev15.el7 will be installed +
----> Package perl-devel.x86_64 4:5.16.3-286.el7 will be installed +
---> Processing Dependency: systemtap-sdt-devel for package: 4:perl-devel-5.16.3-286.el7.x86_64 +
---> Processing Dependency: perl(ExtUtils::ParseXS) for package: 4:perl-devel-5.16.3-286.el7.x86_64 +
---> Processing Dependency: perl(ExtUtils::MakeMaker) for package: 4:perl-devel-5.16.3-286.el7.x86_64 +
---> Processing Dependency: perl(ExtUtils::Installed) for package: 4:perl-devel-5.16.3-286.el7.x86_64 +
---> Processing Dependency: libdb-devel for package: 4:perl-devel-5.16.3-286.el7.x86_64 +
---> Processing Dependency: gdbm-devel for package: 4:perl-devel-5.16.3-286.el7.x86_64 +
----> Package slang-devel.x86_64 0:2.2.4-11.el7 will be installed +
----> Package source-highlight.x86_64 0:3.1.6-6.el7 will be installed +
---> Processing Dependency: ctags for package: source-highlight-3.1.6-6.el7.x86_64 +
---> Processing Dependency: libboost_regex.so.1.53.0()(64bit) for package: source-highlight-3.1.6-6.el7.x86_64 +
---> Running transaction check +
----> Package boost-regex.x86_64 0:1.53.0-25.el7 will be installed +
----> Package ctags.x86_64 0:5.8-13.el7 will be installed +
----> Package gdbm-devel.x86_64 0:1.10-8.el7 will be installed +
----> Package libXaw.x86_64 0:1.0.12-5.el7 will be installed +
----> Package libdb-devel.x86_64 0:5.3.21-19.el7 will be installed +
----> Package perl-ExtUtils-Install.noarch 0:1.58-286.el7 will be installed +
----> Package perl-ExtUtils-MakeMaker.noarch 0:6.68-3.el7 will be installed +
---> Processing Dependency: perl(Test::Harness) for package: perl-ExtUtils-MakeMaker-6.68-3.el7.noarch +
---> Processing Dependency: perl(ExtUtils::Manifest) for package: perl-ExtUtils-MakeMaker-6.68-3.el7.noarch +
----> Package perl-ExtUtils-ParseXS.noarch 1:3.18-2.el7 will be installed +
----> Package sgml-common.noarch 0:0.6.3-39.el7 will be installed +
----> Package systemtap-sdt-devel.x86_64 0:2.8-10.el7 will be installed +
---> Running transaction check +
----> Package perl-ExtUtils-Manifest.noarch 0:1.61-244.el7 will be installed +
----> Package perl-Test-Harness.noarch 0:3.28-3.el7 will be installed +
---> Finished Dependency Resolution+
  
-Dependencies Resolved+OPTIONS 
 +  -t[erse]                                   terse output 
 +  -p[retty]                                  pretty output 
 +  -m[ode] tabular|multiline                  output mode 
 +  -f[ields] <field1,field2,...>|all|common   specify fields to output 
 +  -e[scape] yes|no                           escape columns separators in values 
 +  -n[ocheck]                                 don't check nmcli and NetworkManager versions 
 +  -a[sk]                                     ask for missing parameters 
 +  -w[ait] <seconds>                          set timeout waiting for finishing operations 
 +  -v[ersion]                                 show program version 
 +  -h[elp]                                    print this help
  
-======================================================================================================================================================================== +OBJECT 
- Package                                           Arch                             Version                                        Repository                      Size +  g[eneral]       NetworkManager's general status and operations 
-======================================================================================================================================================================== +  n[etworking]    overall networking control 
-Installing: +  r[adio]         NetworkManager radio switches 
- asciidoc                                          noarch                           8.6.8-5.el7                                    base                           251 k +  c[onnection]    NetworkManager's connections 
- hmaccalc                                          x86_64                           0.9.13-4.el7                                   base                            26 k +  d[evice]        devices managed by NetworkManager 
- m4                                                x86_64                           1.4.16-10.el7                                  base                           256 k +  a[gent]         NetworkManager secret agent or polkit agent
- newt-devel                                        x86_64                           0.52.15-4.el7                                  base                            51 k +
- perl-ExtUtils-Embed                               noarch                           1.30-286.el7                                   base                            49 k +
- python-devel                                      x86_64                           2.7.5-34.el7                                   base                           391 k +
- xmlto                                             x86_64                           0.0.25-7.el7                                   base                            50 k +
-Installing for dependencies: +
- boost-regex                                       x86_64                           1.53.0-25.el7                                  base                           294 k +
- ctags                                             x86_64                           5.8-13.el7                                     base                           155 k +
- docbook-dtds                                      noarch                           1.0-60.el7                                     base                           226 k +
- docbook-style-xsl                                 noarch                           1.78.1-3.el7                                   base                           2.0 M +
- flex                                              x86_64                           2.5.37-3.el7                                   base                           292 k +
- gdbm-devel                                        x86_64                           1.10-8.el7                                     base                            47 k +
- graphviz                                          x86_64                           2.30.1-19.el7                                  base                           1.3 M +
- libXaw                                            x86_64                           1.0.12-5.el7                                   base                           190 k +
- libdb-devel                                       x86_64                           5.3.21-19.el7                                  base                            38 k +
- lynx                                              x86_64                           2.8.8-0.3.dev15.el7                            base                           1.4 M +
- perl-ExtUtils-Install                             noarch                           1.58-286.el7                                   base                            73 k +
- perl-ExtUtils-MakeMaker                           noarch                           6.68-3.el7                                     base                           275 k +
- perl-ExtUtils-Manifest                            noarch                           1.61-244.el7                                   base                            31 k +
- perl-ExtUtils-ParseXS                             noarch                           1:3.18-2.el7                                   base                            77 k +
- perl-Test-Harness                                 noarch                           3.28-3.el7                                     base                           302 k +
- perl-devel                                        x86_64                           4:5.16.3-286.el7                               base                           452 k +
- sgml-common                                       noarch                           0.6.3-39.el7                                   base                            55 k +
- slang-devel                                       x86_64                           2.2.4-11.el7                                   base                            91 k +
- source-highlight                                  x86_64                           3.1.6-6.el7                                    base                           611 k +
- systemtap-sdt-devel                               x86_64                           2.8-10.el7                                     base                            65 k+
  
-Transaction Summary +[root@centos7 ~]# nmcli g help 
-======================================================================================================================================================================== +Usage: nmcli general { COMMAND | help } 
-Install  7 Packages (+20 Dependent packages)+ 
 +COMMAND :{ status | hostname | permissions | logging } 
 + 
 +  status 
 + 
 +  hostname [<hostname>
 + 
 +  permissions 
 + 
 +  logging [level <log level>] [domains <log domains>
 + 
 + 
 +[root@centos7 ~]# nmcli g status help 
 +Usage: nmcli general status { help } 
 + 
 +Show overall status of NetworkManager. 
 +'status' is the default action, which means 'nmcli gen' calls 'nmcli gen status'
  
-Total download size: 9.0 M 
-Installed size: 43 M 
-Is this ok [y/d/N]: y 
 </code> </code>
  
-Installez maintenant le paquet **kernel-3.10.0-327.13.1.el7.src.rpm** :+====Connections et Profils==== 
 + 
 +NetworkManager inclus la notion de **connections** ou **profils** permettant des configurations différentes en fonction de la localisationPour voir les connections actuelles, utilisez la commande **nmcli c** avec la sous-commande **show** :
  
 <code> <code>
-[root@centos7 ~]# exit +[root@centos7 ~]# nmcli c show 
-logout +NAME                UUID                                  TYPE            DEVICE  
-[trainee@centos7 ~]$ rpm -Uvh kernel-3.10.0-327.13.1.el7.src.rpm  +Wired connection  45b701c1-0a21-4d76-a795-2f2bcba86955  802-3-ethernet  enp0s3 
-Mise à jour / installation... +
-   1:kernel-3.10.0-327.13.1.el7       ################################# [100%] +
-attention : utilisateur builder inexistant utilisation de root +
-attention : groupe builder inexistant utilisation de root +
-attention : utilisateur builder inexistant utilisation de root +
-attention : groupe builder inexistant - utilisation de root +
-attention : utilisateur builder inexistant - utilisation de root +
-attention : groupe builder inexistant - utilisation de root +
-attention : utilisateur builder inexistant - utilisation de root +
-attention : groupe builder inexistant - utilisation de root +
-attention : utilisateur builder inexistant - utilisation de root +
-attention : groupe builder inexistant - utilisation de root +
-attention : utilisateur builder inexistant - utilisation de root +
-attention : groupe builder inexistant - utilisation de root +
-attention : utilisateur builder inexistant - utilisation de root +
-attention : groupe builder inexistant - utilisation de root +
-attention : utilisateur builder inexistant - utilisation de root +
-attention : groupe builder inexistant - utilisation de root +
-attention : utilisateur builder inexistant - utilisation de root +
-attention : groupe builder inexistant - utilisation de root +
-attention : utilisateur builder inexistant - utilisation de root +
-attention : groupe builder inexistant - utilisation de root +
-attention : utilisateur builder inexistant - utilisation de root +
-attention : groupe builder inexistant - utilisation de root +
-attention : utilisateur builder inexistant - utilisation de root +
-attention : groupe builder inexistant - utilisation de root +
-attention : utilisateur builder inexistant - utilisation de root +
-attention : groupe builder inexistant - utilisation de root +
-attention : utilisateur builder inexistant - utilisation de root +
-attention : groupe builder inexistant - utilisation de root +
-attention : utilisateur builder inexistant - utilisation de root +
-attention : groupe builder inexistant - utilisation de root +
-attention : utilisateur builder inexistant - utilisation de root +
-attention : groupe builder inexistant - utilisation de root +
-attention : utilisateur builder inexistant - utilisation de root +
-attention : groupe builder inexistant - utilisation de root +
-attention : utilisateur builder inexistant - utilisation de root +
-attention : groupe builder inexistant - utilisation de root +
-attention : utilisateur builder inexistant - utilisation de root +
-attention : groupe builder inexistant - utilisation de root +
-attention : utilisateur builder inexistant - utilisation de root +
-attention : groupe builder inexistant - utilisation de root +
-attention : utilisateur builder inexistant - utilisation de root +
-attention : groupe builder inexistant - utilisation de root +
-attention : utilisateur builder inexistant - utilisation de root +
-attention : groupe builder inexistant - utilisation de root +
-attention : utilisateur builder inexistant - utilisation de root +
-attention : groupe builder inexistant - utilisation de root +
-attention : utilisateur builder inexistant - utilisation de root +
-attention : groupe builder inexistant - utilisation de root +
-attention : utilisateur builder inexistant - utilisation de root +
-attention : groupe builder inexistant - utilisation de root +
-attention : utilisateur builder inexistant - utilisation de root +
-attention : groupe builder inexistant - utilisation de root +
-attention : utilisateur builder inexistant - utilisation de root +
-attention : groupe builder inexistant - utilisation de root +
-attention : utilisateur builder inexistant - utilisation de root +
-attention : groupe builder inexistant - utilisation de root +
-attention : utilisateur builder inexistant - utilisation de root +
-attention : groupe builder inexistant - utilisation de root +
-attention : utilisateur builder inexistant - utilisation de root +
-attention : groupe builder inexistant - utilisation de root +
-attention : utilisateur builder inexistant - utilisation de root +
-attention : groupe builder inexistant utilisation de root+
 </code> </code>
  
-<WRAP center round important> +Comme on peut constater ici, il n'existe pour le moment, qu'un seul profil.
-Les erreurs sont sans importance. +
-</WRAP>+
  
-====Préparer l'Arborescence Source du Noyau==== +Créez donc un profil IP fixe rattaché au périphérique **enp0s3** :
- +
-Naviguez vers le repertoire **~/rpmbuild/SPECS** et utilisez la commande **rpmbuild** pour préparer l'arborescence source du noyau :+
  
 <code> <code>
-[trainee@centos7 ~]$ cd ~/rpmbuild/SPECS +[root@centos7 ~]# nmcli connection add con-name ip_fixe ifname enp0s3 type ethernet ip4 10.0.2.16/24 gw4 10.0.2.2 
-[trainee@centos7 SPECS]$ rpmbuild -bp --target=$(uname -m) kernel.spec +Connection 'ip_fixe' (fb3a11d9-4e03-4032-b26e-09d1195d2bcd) successfully added.
-Construction pour plate-formes cibles: x86_64 +
-Construction pour cible x86_64 +
-erreur : Dépendances de construction manquantes: +
- pesign >= 0.109-4 est nécessaire pour kernel-3.10.0-327.13.1.el7.x86_64 +
- elfutils-devel est nécessaire pour kernel-3.10.0-327.13.1.el7.x86_64 +
- binutils-devel est nécessaire pour kernel-3.10.0-327.13.1.el7.x86_64 +
- bison est nécessaire pour kernel-3.10.0-327.13.1.el7.x86_64 +
- audit-libs-devel est nécessaire pour kernel-3.10.0-327.13.1.el7.x86_64 +
- numactl-devel est nécessaire pour kernel-3.10.0-327.13.1.el7.x86_64 +
- pciutils-devel est nécessaire pour kernel-3.10.0-327.13.1.el7.x86_64+
 </code> </code>
  
-<WRAP center round important> +Constatez sa présence :
-Notez qu'il existe toujours des dépendances manquantes ! +
-</WRAP>+
  
-Redevenez root et installez les dépendances :+<code> 
 +[root@centos7 ~]# nmcli c show 
 +NAME                UUID                                  TYPE            DEVICE  
 +ip_fixe             fb3a11d9-4e03-4032-b26e-09d1195d2bcd  802-3-ethernet  --      
 +Wired connection 1  45b701c1-0a21-4d76-a795-2f2bcba86955  802-3-ethernet  enp0s3   
 +</code> 
 + 
 +Notez que la sortie n'indique pas que le profil **ip_fixe** soit associé au periphérique **enp0s3** car le profil **ip_fixe** n'est pas activé :
  
 <code> <code>
-[trainee@centos7 SPECS]$ cd - +[root@centos7 ~]# nmcli d show 
-/home/trainee +GENERAL.DEVICE:                         enp0s3 
-[trainee@centos7 ~]$ su - +GENERAL.TYPE:                           ethernet 
-Mot de passe :  +GENERAL.HWADDR:                         08:00:27:03:97:DD 
-Dernière connexion lundi  août 2016 à 16:39:54 CEST sur pts/0 +GENERAL.MTU:                            1500 
-[root@centos7 ~]# yum install elfutils-devel binutils-devel bison audit-libs-devel numactl-devel pciutils-devel pesign +GENERAL.STATE:                          100 (connected) 
-...+GENERAL.CONNECTION:                     Wired connection 1 
 +GENERAL.CON-PATH:                       /org/freedesktop/NetworkManager/ActiveConnection/2 
 +WIRED-PROPERTIES.CARRIER:               on 
 +IP4.ADDRESS[1]:                         10.0.2.15/24 
 +IP4.GATEWAY                           10.0.2.2 
 +IP4.DNS[1]                            8.8.8.8 
 +IP6.ADDRESS[1]                        fe80::a00:27ff:fe03:97dd/64 
 +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:
 </code> </code>
  
-Vous pouvez maintenant utilisez la commande rpmbuild pour préparer l'arborescence source du noyau :+Pour activer le profil ip_fixe, utilisez la commande suivante :
  
 <code> <code>
-[root@centos7 ~]# exit +[root@centos7 ~]# nmcli connection up ip_fixe
-logout +
-[trainee@centos7 ~]$ cd ~/rpmbuild/SPECS +
-[trainee@centos7 SPECS]$ rpmbuild -bp --target=$(uname -m) kernel.spec +
-Construction pour plate-formes cibles: x86_64 +
-Construction pour cible x86_64 +
-Exécution_de(%prep) : /bin/sh -e /var/tmp/rpm-tmp.xP6OkC +
-+ umask 022 +
-+ cd /home/trainee/rpmbuild/BUILD +
-+ patch_command='patch -p1 -F1 -s' +
-+ cd /home/trainee/rpmbuild/BUILD +
-+ rm -rf kernel-3.10.0-327.13.1.el7 +
-+ /usr/bin/mkdir -p kernel-3.10.0-327.13.1.el7 +
-+ cd kernel-3.10.0-327.13.1.el7 +
-+ /usr/bin/xz -dc /home/trainee/rpmbuild/SOURCES/linux-3.10.0-327.13.1.el7.tar.xz +
-+ /usr/bin/tar -xf - +
-...+
 </code> </code>
  
-A l'issu du processus, examinez l'arborescence :+Le profil ip_fixe est maintenant activé tandis que le profil enp0s3 a été désactivé :
  
 <code> <code>
-[trainee@centos7 SPECS]$ ls -la ~/rpmbuild/BUILD/kernel-3.10.0-327.13.1.el7/linux-3.10.0-327.13.1.el7.x86_64/ +[root@centos7 ~]# nmcli c show 
-total 824 +NAME                UUID                                  TYPE            DEVICE  
-drwxr-xr-x.  24 trainee trainee   4096  8 août  16:52 . +ip_fixe             fb3a11d9-4e03-4032-b26e-09d1195d2bcd  802-3-ethernet  enp0s3  
-drwxr-xr-x.   3 trainee trainee   4096  8 août  16:52 .. +Wired connection 1  45b701c1-0a21-4d76-a795-2f2bcba86955  802-3-ethernet  --      
-drwxr-xr-x.  32 trainee trainee   4096  8 août  16:52 arch +[root@centos7 ~]# nmcli d show 
-drwxr-xr-x.   3 trainee trainee   4096 29 févr. 18:35 block +GENERAL.DEVICE                        enp0s3 
--rw-r--r--.   trainee trainee 126411  8 août  16:52 .config +GENERAL.TYPE                          ethernet 
--rw-r--r--.   1 trainee trainee 126420  8 août  16:52 .config.old +GENERAL.HWADDR                        08:00:27:03:97:DD 
-drwxr-xr-x  2 trainee trainee   4096  8 août  16:52 configs +GENERAL.MTU                           1500 
--rw-r--r--  1 trainee trainee  18693 29 févr. 18:35 COPYING +GENERAL.STATE                         100 (connected) 
--rw-r--r--.   1 trainee trainee  95317 29 févr18:35 CREDITS +GENERAL.CONNECTION                    ip_fixe 
-drwxr-xr-x  4 trainee trainee   4096 29 févr. 18:35 crypto +GENERAL.CON-PATH                      /org/freedesktop/NetworkManager/ActiveConnection/3 
-drwxr-xr-x101 trainee trainee  12288  8 août  16:52 Documentation +WIRED-PROPERTIES.CARRIER              on 
-drwxr-xr-x114 trainee trainee   4096 29 févr. 18:35 drivers +IP4.ADDRESS[1]                        10.0.2.16/24 
-drwxr-xr-x.  36 trainee trainee   4096  8 août  16:52 firmware +IP4.GATEWAY                           10.0.2.2 
-drwxr-xr-x.  74 trainee trainee   4096 29 févr18:35 fs +IP6.ADDRESS[1]:                         fe80::a00:27ff:fe03:97dd/64 
--rw-r--r--  trainee trainee     46 29 févr. 18:35 .gitattributes +IP6.GATEWAY                            
-drwxr-xr-x 27 trainee trainee   4096  8 août  16:52 include + 
-drwxr-xr-x  2 trainee trainee   4096 29 févr. 18:35 init +GENERAL.DEVICE                        lo 
-drwxr-xr-x  trainee trainee   4096 29 févr18:35 ipc +GENERAL.TYPE                          loopback 
--rw-r--r--  trainee trainee   2536 29 févr. 18:35 Kbuild +GENERAL.HWADDR:                         00:00:00:00:00:00 
--rw-r--r--  1 trainee trainee    505 29 févr. 18:35 Kconfig +GENERAL.MTU                           65536 
-drwxr-xr-x 11 trainee trainee   4096  8 août  16:52 kernel +GENERAL.STATE                         10 (unmanaged) 
-drwxr-xr-x 10 trainee trainee   4096  8 août  16:52 lib +GENERAL.CONNECTION                    -- 
--rw-r--r--  1 trainee trainee   4465 29 févr. 18:35 .mailmap +GENERAL.CON-PATH                      -- 
--rw-r--r--  1 trainee trainee 260223 29 févr. 18:35 MAINTAINERS +IP4.ADDRESS[1]                        127.0.0.1/
--rw-r--r--  1 trainee trainee  49887 29 févr. 18:35 Makefile +IP4.GATEWAY                            
-drwxr-xr-x.   2 trainee trainee   4096 29 févr18:35 mm +IP6.ADDRESS[1]                        ::1/128 
-drwxr-xr-x 56 trainee trainee   4096 29 févr. 18:35 net +IP6.GATEWAY
--rw-r--r--.   1 trainee trainee  18736 29 févr. 18:35 README +
--rw-r--r--  trainee trainee   7485 29 févr. 18:35 REPORTING-BUGS +
-drwxr-xr-x 12 trainee trainee   4096 29 févr18:35 samples +
--rw-r--r--  trainee trainee      0  août  16:52 .scmversion +
-drwxr-xr-x 13 trainee trainee   4096  8 août  16:52 scripts +
-drwxr-xr-x  9 trainee trainee   4096 29 févr. 18:35 security +
-drwxr-xr-x.  23 trainee trainee   4096 29 févr. 18:35 sound +
-drwxr-xr-x.  19 trainee trainee   4096 29 févr. 18:35 tools +
-drwxr-xr-x.   2 trainee trainee   4096  8 août  16:52 usr +
-drwxr-xr-x.   3 trainee trainee   4096 29 févr18:35 virt+
 </code> </code>
  
-A l'intérieur de ce répertoire se trouve le fichier .config utilisé pour compiler le noyau :+Pour consulter les paramètres d'un profil, utilisez la commande suivante :
  
 <code> <code>
-[trainee@centos7 SPECS]$ more ~/rpmbuild/BUILD/kernel-3.10.0-327.13.1.el7/linux-3.10.0-327.13.1.el7.x86_64/.config +[root@centos7 ~]# nmcli -p connection show "Wired connection 1" 
-# +=============================================================================== 
-# Automatically generated file; DO NOT EDIT+                Connection profile details (Wired connection 1) 
-# Linux/x86_64 3.10.0 Kernel Configuration +=============================================================================== 
-+connection.id:                          Wired connection 1 
-CONFIG_64BIT=+connection.uuid:                        45b701c1-0a21-4d76-a795-2f2bcba86955 
-CONFIG_X86_64=+connection.interface-name:              -- 
-CONFIG_X86=+connection.type:                        802-3-ethernet 
-CONFIG_INSTRUCTION_DECODER=y +connection.autoconnect:                 yes 
-CONFIG_OUTPUT_FORMAT="elf64-x86-64" +connection.autoconnect-priority:        0 
-CONFIG_ARCH_DEFCONFIG="arch/x86/configs/x86_64_defconfig" +connection.timestamp:                   1470647387 
-CONFIG_LOCKDEP_SUPPORT=y +connection.read-only:                   no 
-CONFIG_STACKTRACE_SUPPORT=y +connection.permissions:                  
-CONFIG_HAVE_LATENCYTOP_SUPPORT=y +connection.zone:                        -- 
-CONFIG_MMU=y +connection.master:                      -- 
-CONFIG_NEED_DMA_MAP_STATE=y +connection.slave-type:                  -- 
-CONFIG_NEED_SG_DMA_LENGTH=y +connection.autoconnect-slaves:          -(default) 
-CONFIG_GENERIC_ISA_DMA=y +connection.secondaries:                  
-CONFIG_GENERIC_BUG=y +connection.gateway-ping-timeout:        0 
-CONFIG_GENERIC_BUG_RELATIVE_POINTERS=y +connection.metered:                     unknown 
-CONFIG_GENERIC_HWEIGHT=y +------------------------------------------------------------------------------- 
-CONFIG_ARCH_MAY_HAVE_PC_FDC=y +802-3-ethernet.port:                    -- 
-CONFIG_RWSEM_XCHGADD_ALGORITHM=y +802-3-ethernet.speed:                   0 
-CONFIG_GENERIC_CALIBRATE_DELAY=y +802-3-ethernet.duplex:                  -- 
-CONFIG_ARCH_HAS_CPU_RELAX=y +802-3-ethernet.auto-negotiate:          yes 
-CONFIG_ARCH_HAS_CACHE_LINE_SIZE=y +802-3-ethernet.mac-address:             08:00:27:03:97:DD 
-CONFIG_ARCH_HAS_CPU_AUTOPROBE=y +802-3-ethernet.cloned-mac-address:      -- 
-CONFIG_HAVE_SETUP_PER_CPU_AREA=y +802-3-ethernet.mac-address-blacklist:    
-CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK=y +802-3-ethernet.mtu:                     auto 
-CONFIG_NEED_PER_CPU_PAGE_FIRST_CHUNK=y +802-3-ethernet.s390-subchannels:         
-CONFIG_ARCH_HIBERNATION_POSSIBLE=y +802-3-ethernet.s390-nettype:            -- 
-CONFIG_ARCH_SUSPEND_POSSIBLE=y +802-3-ethernet.s390-options:             
-CONFIG_ZONE_DMA32=y +802-3-ethernet.wake-on-lan:             1 (default) 
-CONFIG_AUDIT_ARCH=y +802-3-ethernet.wake-on-lan-password:    -- 
-CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING=y +------------------------------------------------------------------------------- 
-CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y +ipv4.method:                            auto 
-CONFIG_HAVE_INTEL_TXT=y +ipv4.dns:                                
-CONFIG_X86_64_SMP=y +ipv4.dns-search:                         
-CONFIG_X86_HT=y +ipv4.addresses:                          
-CONFIG_ARCH_HWEIGHT_CFLAGS="-fcall-saved-rdi -fcall-saved-rsi -fcall-saved-rdx -fcall-saved-rcx -fcall-saved-r8 -fcall-saved-r9 -fcall-saved-r10 -fcall-saved-r11" +ipv4.gateway:                           -- 
-CONFIG_ARCH_SUPPORTS_UPROBES=y +ipv4.routes:                             
-CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" +ipv4.route-metric:                      -1 
-CONFIG_IRQ_WORK=y +ipv4.ignore-auto-routes:                no 
-CONFIG_BUILDTIME_EXTABLE_SORT=y+ipv4.ignore-auto-dns:                   no 
 +ipv4.dhcp-client-id:                    -- 
 +ipv4.dhcp-send-hostname:                yes 
 +ipv4.dhcp-hostname:                     -- 
 +ipv4.never-default:                     no 
 +ipv4.may-fail:                          yes 
 +------------------------------------------------------------------------------- 
 +ipv6.method:                            auto 
 +ipv6.dns:                                
 +ipv6.dns-search:                         
 +ipv6.addresses:                          
 +ipv6.gateway:                           -- 
 +ipv6.routes:                             
 +ipv6.route-metric:                      -1 
 +ipv6.ignore-auto-routes:                no 
 +ipv6.ignore-auto-dns:                   no 
 +ipv6.never-default:                     no 
 +ipv6.may-fail:                          yes 
 +ipv6.ip6-privacy:                       -1 (unknown) 
 +ipv6.dhcp-send-hostname:                yes 
 +ipv6.dhcp-hostname:                     -- 
 +------------------------------------------------------------------------------- 
 +[root@centos7 ~]nmcli -p connection show ip_fixe 
 +=============================================================================== 
 +                     Connection profile details (ip_fixe) 
 +=============================================================================== 
 +connection.id:                          ip_fixe 
 +connection.uuid:                        fb3a11d9-4e03-4032-b26e-09d1195d2bcd 
 +connection.interface-name:              enp0s3 
 +connection.type:                        802-3-ethernet 
 +connection.autoconnect:                 yes 
 +connection.autoconnect-priority:        0 
 +connection.timestamp:                   1470647577 
 +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 
 +------------------------------------------------------------------------------- 
 +802-3-ethernet.port:                    -- 
 +802-3-ethernet.speed:                   0 
 +802-3-ethernet.duplex:                  -- 
 +802-3-ethernet.auto-negotiate:          yes 
 +802-3-ethernet.mac-address:             -- 
 +802-3-ethernet.cloned-mac-address:      -- 
 +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:             1 (default) 
 +802-3-ethernet.wake-on-lan-password:    -- 
 +------------------------------------------------------------------------------- 
 +ipv4.method:                            manual 
 +ipv4.dns:                                
 +ipv4.dns-search:                         
 +ipv4.addresses:                         10.0.2.16/24 
 +ipv4.gateway:                           10.0.2.2 
 +ipv4.routes:                             
 +ipv4.route-metric:                      -1 
 +ipv4.ignore-auto-routes:                no 
 +ipv4.ignore-auto-dns:                   no 
 +ipv4.dhcp-client-id:                    -- 
 +ipv4.dhcp-send-hostname:                yes 
 +ipv4.dhcp-hostname:                     -- 
 +ipv4.never-default:                     no 
 +ipv4.may-fail:                          yes 
 +------------------------------------------------------------------------------- 
 +ipv6.method:                            auto 
 +ipv6.dns:                                
 +ipv6.dns-search:                         
 +ipv6.addresses:                          
 +ipv6.gateway:                           -- 
 +ipv6.routes:                             
 +ipv6.route-metric:                      -1 
 +ipv6.ignore-auto-routes:                no 
 +ipv6.ignore-auto-dns:                   no 
 +ipv6.never-default:                     no 
 +ipv6.may-fail:                          yes 
 +ipv6.ip6-privacy:                       -1 (unknown) 
 +ipv6.dhcp-send-hostname:                yes 
 +ipv6.dhcp-hostname:                     -- 
 +------------------------------------------------------------------------------- 
 +==============================================================================
 +      Activate connection details (fb3a11d9-4e03-4032-b26e-09d1195d2bcd) 
 +=============================================================================== 
 +GENERAL.NAME:                           ip_fixe 
 +GENERAL.UUID:                           fb3a11d9-4e03-4032-b26e-09d1195d2bcd 
 +GENERAL.DEVICES:                        enp0s3 
 +GENERAL.STATE:                          activated 
 +GENERAL.DEFAULT:                        yes 
 +GENERAL.DEFAULT6:                       no 
 +GENERAL.VPN:                            no 
 +GENERAL.ZONE:                           -- 
 +GENERAL.DBUS-PATH:                      /org/freedesktop/NetworkManager/ActiveConnection/
 +GENERAL.CON-PATH:                       /org/freedesktop/NetworkManager/Settings/1 
 +GENERAL.SPEC-OBJECT:                    / 
 +GENERAL.MASTER-PATH:                    -- 
 +------------------------------------------------------------------------------- 
 +IP4.ADDRESS[1]:                         10.0.2.16/24 
 +IP4.GATEWAY:                            10.0.2.2 
 +------------------------------------------------------------------------------- 
 +IP6.ADDRESS[1]:                         fe80::a00:27ff:fe03:97dd/64 
 +IP6.GATEWAY:                             
 +------------------------------------------------------------------------------- 
 +</code>
  
-+Pour consulter la liste profils associés à un périphérique, utilisez la commande suivante : 
---Plus--(1%)+ 
 +<code> 
 +[root@centos7 ~]nmcli -f CONNECTIONS device show enp0s3 
 +CONNECTIONS.AVAILABLE-CONNECTION-PATHS: /org/freedesktop/NetworkManager/Settings/{0,1} 
 +CONNECTIONS.AVAILABLE-CONNECTIONS[1]:   45b701c1-0a21-4d76-a795-2f2bcba86955 | Wired connection 1 
 +CONNECTIONS.AVAILABLE-CONNECTIONS[2]:   fb3a11d9-4e03-4032-b26e-09d1195d2bcd | ip_fixe
 </code> </code>
  
-Ce fichier est généré par une des trois commandes suivantes et ne doit **pas** être édité manuellement :+Les fichiers de configuration pour le periphérique **enp0s3** se trouvent dans le répertoire **/etc/sysconfig/network-scripts/** :
  
-  * make config +<code> 
-  * make menuconfig +[root@centos7 ~]# ls -l /etc/sysconfig/network-scripts/ | grep ifcfg 
-  * make xconfig+-rw-r--r--. 1 root root   296 Aug  8 11:08 ifcfg-ip_fixe 
 +-rw-r--r--. 1 root root   254 Sep 16  2015 ifcfg-lo 
 +</code>
  
-Dans ce fichier, vous pouvez constater la présence de lignes correspondantes à des fonctionalités suivies par une lettre ou une valeur. Dans le cas d'une lettre, la signification est la suivante :+L'étude du fichier **/etc/sysconfig/network-scripts/ifcfg-ip_fixe** démontre l'abscence de directives concernant les DNS :
  
-  * **y** +<code> 
-    * la fonctionalité est incluse dans le noyau monolithique ou dans le cas d'une dépendance d'un module, dans le module concerné, +[root@centos7 ~]# cat /etc/sysconfig/network-scripts/ifcfg-ip_fixe 
-  * **m** +TYPE=Ethernet 
-    * la fonctionalité est incluse en tant que module, +BOOTPROTO=none 
-  * **n** +IPADDR=10.0.2.16 
-    * la fonctionalité n'est pas incluseCette option est rarement visible car dans bien les cas, la fonctionalité est simplement commentée dans le fichier lui-même.+PREFIX=24 
 +GATEWAY=10.0.2.2 
 +DEFROUTE=yes 
 +IPV4_FAILURE_FATAL=no 
 +IPV6INIT=yes 
 +IPV6_AUTOCONF=yes 
 +IPV6_DEFROUTE=yes 
 +IPV6_PEERDNS=yes 
 +IPV6_PEERROUTES=yes 
 +IPV6_FAILURE_FATAL=no 
 +NAME=ip_fixe 
 +UUID=fb3a11d9-4e03-4032-b26e-09d1195d2bcd 
 +DEVICE=enp0s3 
 +ONBOOT=yes 
 +</code>
  
-Le fichier **Makefile** contient le nom du noyau et spécifie les informations suivantes :+La résolution des noms est donc inactive :
  
-  * VERSION, +<code> 
-  * PATCHLEVEL, +[root@centos7 ~]# ping www.free.fr 
-  * SUBLEVEL, +ping: unknown host www.free.fr 
-  * EXTRAVERSION.+</code>
  
-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 :+Modifiez donc la configuration du profil **ip_fixe** :
  
 <code> <code>
-[trainee@centos7 SPECS]$ more ~/rpmbuild/BUILD/kernel-3.10.0-327.13.1.el7/linux-3.10.0-327.13.1.el7.x86_64/Makefile  +[root@centos7 ~]# nmcli connection mod ip_fixe ipv4.dns 8.8.8.
-VERSION = 3 +</code>
-PATCHLEVEL = 10 +
-SUBLEVEL = 0 +
-EXTRAVERSION = +
-NAME = Unicycling Gorilla +
-RHEL_MAJOR = 7 +
-RHEL_MINOR = 2 +
-RHEL_RELEASE = 327.13.1 +
-RHEL_DRM_VERSION = 4 +
-RHEL_DRM_PATCHLEVEL = 1 +
-RHEL_DRM_SUBLEVEL = 0+
  
-*DOCUMENTATION* +L'étude du fichier **/etc/sysconfig/network-scripts/ifcfg-ip_fixe** démontre que la directive concernant le serveur DNS a été ajoutée :
-# To see a list of typical targets execute "make help" +
-# More info can be located in ./README +
-# Comments in this file are targeted only to the developer, do not +
-# expect to learn how to build the kernel reading this file.+
  
-# Do not: +<code> 
-o  use make's built-in rules and variables +[root@centos7 ~]cat /etc/sysconfig/network-scripts/ifcfg-ip_fixe 
-#    (this increases performance and avoids hard-to-debug behaviour); +TYPE=Ethernet 
-# o  print "Entering directory ..."; +BOOTPROTO=none 
-MAKEFLAGS +-rR --no-print-directory+DEFROUTE=yes 
 +IPV4_FAILURE_FATAL=no 
 +IPV6INIT=yes 
 +IPV6_AUTOCONF=yes 
 +IPV6_DEFROUTE=yes 
 +IPV6_FAILURE_FATAL=no 
 +NAME=ip_fixe 
 +UUID=fb3a11d9-4e03-4032-b26e-09d1195d2bcd 
 +DEVICE=enp0s3 
 +ONBOOT=yes 
 +IPADDR=10.0.2.16 
 +PREFIX=24 
 +GATEWAY=10.0.2.2 
 +DNS1=8.8.8.8 
 +IPV6_PEERDNS=yes 
 +IPV6_PEERROUTES=yes 
 +</code>
  
-# Avoid funny character set dependencies +Afin que la modification du serveur DNS soit prise en compte, re-démarrez le service NetworkManager :
-unexport LC_ALL +
-LC_COLLATE=C +
-LC_NUMERIC=C +
-export LC_COLLATE LC_NUMERIC+
  
-# We are using a recursive build, so we need to do a little thinking +<code> 
-to get the ordering right+[root@centos7 ~]systemctl restart NetworkManager.service 
-+[root@centos7 ~]systemctl status NetworkManager.service 
-# Most importantlysub-Makefiles should only ever modify files in +● NetworkManager.service - Network Manager 
-# their own directoryIf in some directory we have a dependency on +   Loadedloaded (/usr/lib/systemd/system/NetworkManager.service; enabled; vendor preset: enabled) 
-# a file in another dir (which doesn't happen often, but it's often +   Active: active (running) since Mon 2016-08-08 11:16:53 CEST; 7s ago 
-# unavoidable when linking the built-in.o targets which finally + Main PID: 8394 (NetworkManager) 
-# turn into vmlinux), we will call a sub make in that other dir, and +   CGroup: /system.slice/NetworkManager.service 
-# after that we are sure that everything which is in that other dir +           └─8394 /usr/sbin/NetworkManager --no-daemon 
-is now up to date. + 
-+Aug 08 11:16:53 centos7.fenestros.loc NetworkManager[8394]: <info>  (enp0s3): device state change: prepare -> config (reason 'none') [40 50 0] 
-# The only cases where we need to modify files which have global +Aug 08 11:16:53 centos7.fenestros.loc NetworkManager[8394]: <info>  (enp0s3): device state change: config -> ip-config (reason 'none') [50 70 0] 
-# effects are thus separated out and done before the recursive +Aug 08 11:16:53 centos7.fenestros.loc NetworkManager[8394]: <info>  (enp0s3): device state change: ip-config -> ip-check (reason 'none') [70 80 0] 
-# descending is startedThey are now explicitly listed as the +Aug 08 11:16:53 centos7.fenestros.loc NetworkManager[8394]: <info>  (enp0s3): device state change: ip-check -> secondaries (reason 'none') [80 90 0] 
-# prepare rule+Aug 08 11:16:53 centos7.fenestros.loc NetworkManager[8394]: <info>  (enp0s3): device state change: secondaries -> activated (reason 'none') [90 100 0] 
---Plus--(2%)+Aug 08 11:16:53 centos7.fenestros.loc NetworkManager[8394]: <info>  NetworkManager state is now CONNECTED_LOCAL 
 +Aug 08 11:16:53 centos7.fenestros.loc NetworkManager[8394]: <info>  NetworkManager state is now CONNECTED_GLOBAL 
 +Aug 08 11:16:53 centos7.fenestros.loc NetworkManager[8394]: <info>  Policy set 'ip_fixe' (enp0s3) as default for IPv4 routing and DNS
 +Aug 08 11:16:53 centos7.fenestros.loc NetworkManager[8394]: <info>  (enp0s3): Activation: successful, device activated. 
 +Aug 08 11:16:53 centos7.fenestros.loc NetworkManager[8394]: <info>  wpa_supplicant running
 </code> </code>
  
-<WRAP center round important> +Vérifiez que le fichier **/etc/resolv.conf** ait été modifié par NetworkManager :
-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. +
-</WRAP>+
  
-Utilisez maintenant la commande **make oldconfig** :+<code> 
 +[root@centos7 ~]# cat /etc/resolv.conf 
 +# Generated by NetworkManager 
 +search fenestros.loc 
 +nameserver 8.8.8.8 
 +</code> 
 + 
 +Dernièrement vérifiez la resolution des noms :
  
 <code> <code>
-[trainee@centos7 SPECS]$ cd ~/rpmbuild/BUILD/kernel-3.10.0-327.13.1.el7/linux-3.10.0-327.13.1.el7.x86_64 +[root@centos7 ~]# ping www.free.fr 
-[trainee@centos7 linux-3.10.0-327.13.1.el7.x86_64]$ make oldconfig +PING www.free.fr (212.27.48.10) 56(84) bytes of data. 
-scripts/kconfig/conf --oldconfig Kconfig +64 bytes from www.free.fr (212.27.48.10): icmp_seq=1 ttl=63 time=10.4 ms 
-# +64 bytes from www.free.fr (212.27.48.10): icmp_seq=2 ttl=63 time=9.44 ms 
-# configuration written to .config +64 bytes from www.free.fr (212.27.48.10): icmp_seq=3 ttl=63 time=12.1 ms 
-#+^C 
 +--- www.free.fr ping statistics --- 
 +3 packets transmitted, 3 received, 0% packet loss, time 2002ms 
 +rtt min/avg/max/mdev = 9.448/10.680/12.171/1.126 ms
 </code> </code>
  
 <WRAP center round important> <WRAP center round 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 noyaula commande vous pose des questions.+**Important** : Notez qu'il existe un front-end graphique en mode texte**nmtui**, pour configurer NetworkManager.
 </WRAP> </WRAP>
  
-====Paramétrage du noyau====+====Ajouter une Deuxième Adresse IP à un Profil====
  
-Après avoir modifié la configuration du noyau selon vos besoins en utilisant soit la commande **menuconfig** soit la commande **xconfig** (pas necéssaire pour cet exemple)insérez la sortie de la commande **uname -i** sur la première ligne du fichier .config :+Pour ajouter une deuxième adresse IP à un profil sous RHEL/CentOS 7il convient d'utiliser la commande suivante :
  
 <code> <code>
-[trainee@centos7 linux-3.10.0-327.13.1.el7.x86_64]$ uname -i +[root@centos7 ~]# nmcli connection mod ip_fixe +ipv4.addresses 192.168.1.2/24
-x86_64 +
-[trainee@centos7 linux-3.10.0-327.13.1.el7.x86_64]$ vi .config +
-[trainee@centos7 linux-3.10.0-327.13.1.el7.x86_64]$ head .config +
-# x86_64 +
-+
-# Automatically generated file; DO NOT EDIT. +
-# Linux/x86 3.10.0 Kernel Configuration +
-+
-CONFIG_64BIT=y +
-CONFIG_X86_64=y +
-CONFIG_X86=y +
-CONFIG_INSTRUCTION_DECODER=y +
-CONFIG_OUTPUT_FORMAT="elf64-x86-64"+
 </code> </code>
  
-Renommez le fichier .config en le plaçant dans le répertoire **~/rpmbuild/SOURCES/** :+Redémarrez la machine virtuelle puis en tant que root saisissez la commande suivante :
  
 <code> <code>
-[trainee@centos7 linux-3.10.0-327.13.1.el7.x86_64]$ cp .config ~/rpmbuild/SOURCES/config-`uname -m`-generic +[root@centos7 ~]# nmcli connection show ip_fixe 
-[trainee@centos7 linux-3.10.0-327.13.1.el7.x86_64]$ ls ~/rpmbuild/SOURCES +connection.id:                          ip_fixe 
-centos.cer             cpupower.service            kernel-3.10.0-ppc64-debug.config    kernel-3.10.0-x86_64.config        Module.kabi_ppc64    x509.genkey +connection.uuid:                        fb3a11d9-4e03-4032-b26e-09d1195d2bcd 
-centos-kpatch.x509     debrand-rh-i686-cpu.patch   kernel-3.10.0-ppc64le.config        kernel-3.10.0-x86_64-debug.config  Module.kabi_ppc64le +connection.interface-name:              enp0s3 
-centos-ldup.x509       debrand-rh_taint.patch      kernel-3.10.0-ppc64le-debug.config  kernel-abi-whitelists-327.tar.bz2  Module.kabi_s390x +connection.type:                        802-3-ethernet 
-check-kabi             debrand-single-cpu.patch    kernel-3.10.0-s390x.config          linux-3.10.0-327.13.1.el7.tar.xz   Module.kabi_x86_64 +connection.autoconnect:                 yes 
-config-x86_64-generic  extra_certificates          kernel-3.10.0-s390x-debug.config    linux-kernel-test.patch            secureboot.cer +connection.autoconnect-priority:        0 
-cpupower.config        kernel-3.10.0-ppc64.config  kernel-3.10.0-s390x-kdump.config    Makefile.common                    sign-modules+connection.timestamp:                   1470555543 
 +connection.read-only:                   no 
 +connection.permissions:                  
 +connection.zone:                        -- 
 +connection.master:                      -
 +connection.slave-type:                  -- 
 +connection.autoconnect-slaves:          -(default) 
 +connection.secondaries:                  
 +connection.gateway-ping-timeout:        0 
 +connection.metered:                     unknown 
 +802-3-ethernet.port:                    -- 
 +802-3-ethernet.speed:                   0 
 +802-3-ethernet.duplex:                  -- 
 +802-3-ethernet.auto-negotiate:          yes 
 +802-3-ethernet.mac-address:             -- 
 +802-3-ethernet.cloned-mac-address:      -
 +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:             1 (default) 
 +802-3-ethernet.wake-on-lan-password:    -- 
 +ipv4.method:                            manual 
 +ipv4.dns:                               8.8.8.8 
 +ipv4.dns-search:                         
 +ipv4.addresses:                         10.0.2.16/24, 192.168.1.2/24 
 +ipv4.gateway:                           10.0.2.2 
 +ipv4.routes:                             
 +ipv4.route-metric:                      -
 +ipv4.ignore-auto-routes:                no 
 +ipv4.ignore-auto-dns:                   no 
 +ipv4.dhcp-client-id:                    -- 
 +ipv4.dhcp-send-hostname:                yes 
 +ipv4.dhcp-hostname:                     -- 
 +ipv4.never-default:                     no 
 +ipv4.may-fail:                          yes 
 +ipv6.method:                            auto 
 +ipv6.dns:                                
 +ipv6.dns-search:                         
 +ipv6.addresses:                          
 +ipv6.gateway:                           -
 +ipv6.routes:                             
 +ipv6.route-metric:                      -1 
 +ipv6.ignore-auto-routes:                no 
 +ipv6.ignore-auto-dns:                   no 
 +ipv6.never-default:                     no 
 +ipv6.may-fail:                          yes 
 +ipv6.ip6-privacy:                       -1 (unknown) 
 +ipv6.dhcp-send-hostname:                yes 
 +ipv6.dhcp-hostname:                     -
 +GENERAL.NAME:                           ip_fixe 
 +GENERAL.UUID:                           fb3a11d9-4e03-4032-b26e-09d1195d2bcd 
 +GENERAL.DEVICES:                        enp0s3 
 +GENERAL.STATE:                          activated 
 +GENERAL.DEFAULT:                        yes 
 +GENERAL.DEFAULT6:                       no 
 +GENERAL.VPN:                            no 
 +GENERAL.ZONE:                           -
 +GENERAL.DBUS-PATH:                      /org/freedesktop/NetworkManager/ActiveConnection/
 +GENERAL.CON-PATH:                       /org/freedesktop/NetworkManager/Settings/0 
 +GENERAL.SPEC-OBJECT:                    / 
 +GENERAL.MASTER-PATH:                    -- 
 +IP4.ADDRESS[1]:                         10.0.2.16/24 
 +IP4.ADDRESS[2]:                         192.168.1.2/24 
 +IP4.GATEWAY:                            10.0.2.2 
 +IP4.DNS[1]:                             8.8.8.8 
 +IP6.ADDRESS[1]:                         fe80::a00:27ff:fe03:97dd/64 
 +IP6.GATEWAY: 
 </code> </code>
  
 <WRAP center round important> <WRAP center round important>
-Pour un noyau 32 bits, remplacez **x86_64** par **i386** et **config-`uname -m`-generic** par **config-x86-32-generic**.+**Important** : Notez l'ajout de la ligne **IP4.ADDRESS[2]:**.
 </WRAP> </WRAP>
  
-Editez la directive **buildid** dans le fichier **~/rpmbuild/SPECS/kernel.spec** :+Consultez maintenant le contenu du fichier **/etc/sysconfig/network-scripts/ifcfg-ip_fixe** :
  
 <code> <code>
-[trainee@centos7 linux-3.10.0-327.13.1.el7.x86_64]$ cd ~/rpmbuild/SPECS +[root@centos7 ~]# cat /etc/sysconfig/network-scripts/ifcfg-ip_fixe 
-[trainee@centos7 SPECS]$ vi kernel.spec +TYPE=Ethernet 
-[trainee@centos7 SPECS]$ head kernel.spec  +BOOTPROTO=none 
-# We have to override the new %%install behavior because, well... the kernel is special. +DEFROUTE=yes 
-%global __spec_install_pre %{___build_pre}+IPV4_FAILURE_FATAL=no 
 +IPV6INIT=yes 
 +IPV6_AUTOCONF=yes 
 +IPV6_DEFROUTE=yes 
 +IPV6_FAILURE_FATAL=no 
 +NAME=ip_fixe 
 +UUID=fb3a11d9-4e03-4032-b26e-09d1195d2bcd 
 +DEVICE=enp0s3 
 +ONBOOT=yes 
 +DNS1=8.8.8.8 
 +IPADDR=10.0.2.16 
 +PREFIX=24 
 +IPADDR1=192.168.1.2 
 +PREFIX1=24 
 +GATEWAY=10.0.2.2 
 +IPV6_PEERDNS=yes 
 +IPV6_PEERROUTES=yes 
 +</code>
  
-SummaryThe Linux kernel+<WRAP center round important> 
 +**Important** Notez l'ajout de la ligne **IPADDR1=192.168.1.2**. 
 +</WRAP>
  
-%define buildid .i2tch+====La Commande hostname====
  
-For a kernel released for public testing, released_kernel should be 1+La procédure de la modification du hostname est simplifiée et sa prise en compte est immédiate : 
-For internal testing builds during development, it should be 0+ 
-%global released_kernel 1+<code> 
 +[root@centos7 ~]nmcli general hostname centos.fenestros.loc 
 +[root@centos7 ~]cat /etc/hostname 
 +centos.fenestros.loc 
 +[root@centos7 ~]# hostname 
 +centos.fenestros.loc 
 +[root@centos7 ~]# nmcli general hostname centos7.fenestros.loc 
 +[root@centos7 ~]# cat /etc/hostname 
 +centos7.fenestros.loc 
 +[root@centos7 ~]# hostname 
 +centos7.fenestros.loc
 </code> </code>
  
-====Compiler le Noyau====+====La Commande ip====
  
-La compilation du noyau peut prendre beaucoup de temps. La commande utilisée est la suivante :+Sous RHEL/CentOS 7 la commande **ip** est préférée par rapport à la commande ifconfig :
  
 <code> <code>
-[trainee@centos7 SPECS]$ rpmbuild -bb --target=`uname -m` kernel.spec+[root@centos7 ~]# ip address 
 +1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN  
 +    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: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000 
 +    link/ether 08:00:27:03:97:dd brd ff:ff:ff:ff:ff:ff 
 +    inet 10.0.2.16/24 brd 10.0.2.255 scope global enp0s3 
 +       valid_lft forever preferred_lft forever 
 +    inet 192.168.1.2/24 brd 192.168.1.255 scope global enp0s3 
 +       valid_lft forever preferred_lft forever 
 +    inet6 fe80::a00:27ff:fe03:97dd/64 scope link  
 +       valid_lft forever preferred_lft forever 
 +[root@centos7 ~]# ip addr 
 +1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN  
 +    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: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000 
 +    link/ether 08:00:27:03:97:dd brd ff:ff:ff:ff:ff:ff 
 +    inet 10.0.2.16/24 brd 10.0.2.255 scope global enp0s3 
 +       valid_lft forever preferred_lft forever 
 +    inet 192.168.1.2/24 brd 192.168.1.255 scope global enp0s3 
 +       valid_lft forever preferred_lft forever 
 +    inet6 fe80::a00:27ff:fe03:97dd/64 scope link  
 +       valid_lft forever preferred_lft forever
 </code> </code>
  
-A l'issu du processus, les rpm se trouvent dans le répertoire **/home/trainee/rpmbuild/RPMS/x86_64/** :+===Options de la Commande ip=== 
 + 
 +Les options de cette commande sont :
  
 <code> <code>
-... +[root@centos7 ~]# ip --help 
-Vérification des fichiers non empaquetés : /usr/lib/rpm/check-files /home/trainee/rpmbuild/BUILDROOT/kernel-3.10.0-327.13.1.el7.i2tch.x86_64 +Usageip [ OPTIONS ] OBJECT { COMMAND | help } 
-Écrit /home/trainee/rpmbuild/RPMS/x86_64/kernel-3.10.0-327.13.1.el7.i2tch.x86_64.rpm +       ip [ -force ] -batch filename 
-Écrit : /home/trainee/rpmbuild/RPMS/x86_64/kernel-headers-3.10.0-327.13.1.el7.i2tch.x86_64.rpm +where  OBJECT := { link | addr | addrlabel | route | rule | neigh | ntable | 
-Écrit /home/trainee/rpmbuild/RPMS/x86_64/kernel-debuginfo-common-x86_64-3.10.0-327.13.1.el7.i2tch.x86_64.rpm +                   tunnel | tuntap | maddr | mroute | mrule | monitor | xfrm | 
-Écrit : /home/trainee/rpmbuild/RPMS/x86_64/perf-3.10.0-327.13.1.el7.i2tch.x86_64.rpm +                   netns | l2tp | tcp_metrics | token } 
-Écrit : /home/trainee/rpmbuild/RPMS/x86_64/perf-debuginfo-3.10.0-327.13.1.el7.i2tch.x86_64.rpm +       OPTIONS := { -V[ersion] | -s[tatistics] | -d[etails] | -r[esolve] | 
-Écrit /home/trainee/rpmbuild/RPMS/x86_64/python-perf-3.10.0-327.13.1.el7.i2tch.x86_64.rpm +                    -f[amily] { inet | inet6 | ipx | dnet | bridge | link } | 
-Écrit : /home/trainee/rpmbuild/RPMS/x86_64/python-perf-debuginfo-3.10.0-327.13.1.el7.i2tch.x86_64.rpm +                    -4 | -6 | -I | -D | -B | -0 | 
-Écrit : /home/trainee/rpmbuild/RPMS/x86_64/kernel-tools-3.10.0-327.13.1.el7.i2tch.x86_64.rpm +                    -l[oops] { maximum-addr-flush-attempts } | 
-Écrit : /home/trainee/rpmbuild/RPMS/x86_64/kernel-tools-libs-3.10.0-327.13.1.el7.i2tch.x86_64.rpm +                    -o[neline] | -t[imestamp] | -b[atch] [filename] | 
-Écrit : /home/trainee/rpmbuild/RPMS/x86_64/kernel-tools-libs-devel-3.10.0-327.13.1.el7.i2tch.x86_64.rpm +                    -rc[vbuf] [size]} 
-Écrit : /home/trainee/rpmbuild/RPMS/x86_64/kernel-tools-debuginfo-3.10.0-327.13.1.el7.i2tch.x86_64.rpm +
-Écrit : /home/trainee/rpmbuild/RPMS/x86_64/kernel-devel-3.10.0-327.13.1.el7.i2tch.x86_64.rpm +
-Écrit : /home/trainee/rpmbuild/RPMS/x86_64/kernel-debuginfo-3.10.0-327.13.1.el7.i2tch.x86_64.rpm +
-Écrit : /home/trainee/rpmbuild/RPMS/x86_64/kernel-debug-3.10.0-327.13.1.el7.i2tch.x86_64.rpm +
-Écrit : /home/trainee/rpmbuild/RPMS/x86_64/kernel-debug-devel-3.10.0-327.13.1.el7.i2tch.x86_64.rpm +
-Écrit : /home/trainee/rpmbuild/RPMS/x86_64/kernel-debug-debuginfo-3.10.0-327.13.1.el7.i2tch.x86_64.rpm +
-Exécution_de(%clean) : /bin/sh -e /var/tmp/rpm-tmp.HNhcuC +
-+ umask 022 +
-+ cd /home/trainee/rpmbuild/BUILD +
-+ cd kernel-3.10.0-327.13.1.el7 +
-+ rm -rf /home/trainee/rpmbuild/BUILDROOT/kernel-3.10.0-327.13.1.el7.i2tch.x86_64 +
-+ exit 0+
 </code> </code>
  
-Notez que la génération du nouveau noyau a consommé plus de 9 Go d'espace disque :+====Activer/Désactiver une Interface Manuellement==== 
 + 
 +Deux commandes existent pour désactiver et activer manuellement une interface réseau :
  
 <code> <code>
-[trainee@centos7 SPECS]$ df -h +[root@centos7 ~]# nmcli device disconnect enp0s3 
-Sys. de fichiers Taille Utilisé Dispo Uti% Monté sur +[root@centos7 ~]# nmcli device connect enp0s3
-/dev/sda2          9,8G    4,3G  5,5G  44% / +
-devtmpfs           231M        231M   0% /dev +
-tmpfs              245M        245M   0% /dev/shm +
-tmpfs              245M    4,7M  240M   2% /run +
-tmpfs              245M        245M   0% /sys/fs/cgroup +
-tmpfs              245M     40K  245M   1% /tmp +
-/dev/sdb1           20G    9,5G  9,2G  51% /home +
-/dev/sda1          197M    197M   20K 100% /boot +
-tmpfs               49M         49M   0% /run/user/1000+
 </code> </code>
  
-====Installer le Nouveau Noyau====+====Routage Statique====
  
-Installez maintenant les deux paquets **kernel-devel** et **kernel-headers** :+===La commande ip=== 
 + 
 +Sous RHEL/CentOS 7, 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> <code>
-[root@centos7 ~]# rpm -ivh /home/trainee/rpmbuild/RPMS/x86_64/kernel-devel-3.10.0-327.13.1.el7.i2tch.x86_64.rpm  +[root@centos7 ~]# ip route 
-Preparing...                          ################################# [100%] +default via 10.0.2.2 dev enp0s3  proto static  metric 100  
-Updating / installing..+10.0.2.0/24 dev enp0s3  proto kernel  scope link  src 10.0.2.16  metric 100  
-   1:kernel-devel-3.10.0-327.13.1.el7.################################# [100%] +192.168.1.0/24 dev enp0s3  proto kernel  scope link  src 192.168.1.2  metric 100  
-[root@centos7 ~]# rpm -ivh /home/trainee/rpmbuild/RPMS/x86_64/kernel-headers-3.10.0-327.13.1.el7.i2tch.x86_64.rpm + 
-Preparing...                          ################################# [100%] +[root@centos7 ~]# ip route del 192.168.1.0/24 via 0.0.0.0 
-Updating / installing... + 
-   1:kernel-headers-3.10.0-327.13.1.el################################# [100%]+[root@centos7 ~]# ip route 
 +default via 10.0.2.2 dev enp0s3  proto static  metric 100  
 +10.0.2.0/24 dev enp0s3  proto kernel  scope link  src 10.0.2.16  metric 100 
 </code> </code>
  
-Installez en dernier le nouveau noyau avec la commande **rpm** :+Pour ajouter la route vers le réseau 192.168.1.0 :
  
 <code> <code>
-[root@centos7 ~]# rpm -ivh --force --nodeps /home/trainee/rpmbuild/RPMS/x86_64/kernel-3.10.0-327.13.1.el7.i2tch.x86_64.rpm +[root@centos7 ~]# ip route add 192.168.1.0/24 via 10.0.2.
-Preparing...                          ################################# [100%] + 
- installing package kernel-3.10.0-327.13.1.el7.i2tch.x86_64 needs 30MB on the /boot filesystem+[root@centos7 ~]# ip route 
 +default via 10.0.2.2 dev enp0s3  proto static  metric 100  
 +10.0.2.0/24 dev enp0s3  proto kernel  scope link  src 10.0.2.16  metric 100  
 +192.168.1.0/24 via 10.0.2.2 dev enp0s3
 </code> </code>
  
 <WRAP center round important> <WRAP center round important>
-**Important** : Notez le message d'erreur concernant le manque d'espace disponible sur /boot.+La commande utilisée pour ajouter une passerelle par défaut prend la forme suivante **ip route add default via //adresse ip//**.
 </WRAP> </WRAP>
  
-Lister maintenant les noyaux installés :+===Activer/désactiver le routage sur le serveur=== 
 + 
 +Pour activer le routage sur le serveur, il convient d'activer la retransmission des paquets:
  
 <code> <code>
-[root@centos7 ~]# rpm -qa | grep kernel-3 +[root@centos7 ~]# echo 1 > /proc/sys/net/ipv4/ip_forward 
-kernel-3.10.0-327.el7.x86_64 +[root@centos7 ~]# cat /proc/sys/net/ipv4/ip_forward 
-kernel-3.10.0-327.13.1.el7.x86_64+1
 </code> </code>
  
-Un noyau se désinstalle comme tout autre paquet :+Pour désactiver le routage sur le serveur, il convient de désactiver la retransmission des paquets:
  
 <code> <code>
-[root@centos7 ~]# yum remove kernel-3.10.0-327.el7.x86_64 +[root@centos7 ~]# echo > /proc/sys/net/ipv4/ip_forward 
-Loaded plugins: fastestmirror, langpacks +[root@centos7 ~]# cat /proc/sys/net/ipv4/ip_forward 
-Resolving Dependencies +
---> Running transaction check +</code>
----> Package kernel.x86_64 0:3.10.0-327.el7 will be erased +
---Finished Dependency Resolution+
  
-Dependencies Resolved+=====Diagnostique du Réseau=====
  
-======================================================================================================================================================================== +====ping====
- Package                            Arch                               Version                                      Repository                                     Size +
-======================================================================================================================================================================== +
-Removing: +
- kernel                             x86_64                             3.10.0-327.el7                               @base/$releasever                             136 M+
  
-Transaction Summary +Pour tester l'accessibilité d'une machine, vous devez utiliser la commande **ping** :
-======================================================================================================================================================================== +
-Remove  1 Package+
  
-Installed size: 136 M +<code> 
-Is this ok [y/N]: y+[root@centos7 ~]# ping 10.0.2.2 
 +PING 10.0.2.2 (10.0.2.2) 56(84) bytes of data. 
 +64 bytes from 10.0.2.2icmp_seq=1 ttl=63 time=0.602 ms 
 +64 bytes from 10.0.2.2: icmp_seq=2 ttl=63 time=0.375 ms 
 +64 bytes from 10.0.2.2: icmp_seq=3 ttl=63 time=0.512 ms 
 +64 bytes from 10.0.2.2: icmp_seq=4 ttl=63 time=0.547 ms 
 +^C 
 +--- 10.0.2.2 ping statistics --- 
 +4 packets transmitted, 4 received, 0% packet loss, time 3035ms 
 +rtt min/avg/max/mdev = 0.375/0.509/0.602/0.083 ms
 </code> </code>
  
-Installez le nouveau noyau avec la commande **rpm** :+===Options de la commande ping=== 
 + 
 +Les options de cette commande sont :
  
 <code> <code>
-[root@centos7 ~]# rpm -ivh --force --nodeps /home/trainee/rpmbuild/RPMS/x86_64/kernel-3.10.0-327.13.1.el7.i2tch.x86_64.rpm +[root@centos7 ~]# ping --help 
-Preparing...                          ################################# [100%+ping: invalid option -- '-
-Updating / installing... +Usage: ping [-aAbBdDfhLnOqrRUvV] [-c count] [-i interval] [-I interface] 
-   1:kernel-3.10.0-327.13.1.el7.i2tch ################################# [100%]+            [-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
 </code> </code>
  
-Lister maintenant les noyaux installés :+====netstat -i==== 
 + 
 +Pour visualiser les statistiques réseaux, vous disposez de la commande **netstat** :
  
 <code> <code>
-[root@centos7 ~]# rpm -qa | grep kernel-3 +[root@centos7 ~]# netstat -i 
-kernel-3.10.0-327.13.1.el7.i2tch.x86_64 +Kernel Interface table 
-kernel-3.10.0-327.13.1.el7.x86_64+Iface      MTU    RX-OK RX-ERR RX-DRP RX-OVR    TX-OK TX-ERR TX-DRP TX-OVR Flg 
 +enp0s3    1500   101676      0      0 0         72270      0      0      0 BMRU 
 +lo       65536  1606599      0      0 0       1606599      0      0      0 LRU
 </code> </code>
  
-Constatez la création d'un nouveau grub.cfg :+===Options de la commande netstat=== 
 + 
 +Les options de cette commande sont :
  
 <code> <code>
-[root@centos7 ~]# grep i2tch /boot/grub2/grub.cfg +[root@centos7 ~]# netstat --help 
-menuentry 'CentOS Linux (3.10.0-327.13.1.el7.i2tch.x86_64) 7 (Core)--class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-327.el7.x86_64-advanced-e65fe7da-cda8-4f5a-a827-1b5cabe94bed{ +usage: netstat [-vWeenNcCF] [<Af>] -r         netstat {-V|--version|-h|--help} 
- linux16 /vmlinuz-3.10.0-327.13.1.el7.i2tch.x86_64 root=UUID=e65fe7da-cda8-4f5a-a827-1b5cabe94bed ro rhgb quiet LANG=en_GB.UTF-8 +       netstat [-vWnNcaeol] [<Socket> ...
- initrd16 /initramfs-3.10.0-327.13.1.el7.i2tch.x86_64.img+       netstat { [-vWeenNac] -I[<Iface>] | [-veenNac] -i | [-cnNe] -M | -s [-6tuw] } [delay] 
 + 
 +        -r, --route              display routing table 
 +        -I, --interfaces=<Iface> display interface table for <Iface> 
 +        -i, --interfaces         display interface table 
 +        -g, --groups             display multicast group memberships 
 +        -s, --statistics         display networking statistics (like SNMP) 
 +        -M, --masquerade         display masqueraded connections 
 + 
 +        -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} {-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>
 +
 +====La commande traceroute====
 +
 +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é :
 +
 +<code>
 +[root@centos7 ~]# traceroute www.i2tch.eu
 +traceroute to www.i2tch.eu (217.160.122.33), 30 hops max, 60 byte packets
 +  gateway (10.0.2.2)  0.245 ms  0.098 ms  0.196 ms
 +  192.168.0.1 (192.168.0.1)  0.334 ms  0.312 ms  0.391 ms
 +  * * *
 +  195-132-10-137.rev.numericable.fr (195.132.10.137)  13.868 ms  13.799 ms  19.753 ms
 +  ip-190.net-80-236-8.asnieres.rev.numericable.fr (80.236.8.190)  20.041 ms  19.949 ms  19.859 ms
 +  ip-185.net-80-236-8.asnieres.rev.numericable.fr (80.236.8.185)  19.811 ms  15.239 ms  22.338 ms
 +  172.19.132.146 (172.19.132.146)  27.180 ms  27.044 ms  26.839 ms
 +  oneandone.franceix.net (37.49.236.42)  65.178 ms  64.946 ms  64.618 ms
 +  ae-8-0.bb-a.bap.rhr.de.oneandone.net (212.227.120.42)  30.706 ms  30.599 ms  30.493 ms
 +10  * * *
 +11  * * *
 +12  * * *
 +13  * * *
 +14  * * *
 +15  * * *
 +16  * * *
 +17  * * *
 +18  * * *
 +...
 +</code>
 +
 +===Options de la commande traceroute===
 +
 +Les options de cette commande sont :
 +
 +<code>
 +[root@centos7 ~]# traceroute --help
 +Usage:
 +  traceroute [ -46dFITnreAUDV ] [ -f first_ttl ] [ -g gate,... ] [ -i device ] [ -m max_ttl ] [ -N squeries ] [ -p port ] [ -t tos ] [ -l flow_label ] [ -w waittime ] [ -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 use. It 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 waittime  --wait=waittime
 +                              Set the number of seconds to wait for response to
 +                              a probe (default is 5.0). Non-integer (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 a
 +                              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 (`-I' means `-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 traced. Implies
 +                              `-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>
 +
 +=====Connexions à Distance=====
 +
 +==== Telnet ====
  
 <WRAP center round important> <WRAP center round important>
-**Important** : Re-démarrez votre VM en utilisant le nouveau noyau.+La commande **telnet** n'est pas installée par défaut sous CentOS 7. Installez-le à l'aide de la commande **yum install telnet** en tant que root.
 </WRAP> </WRAP>
  
-Vérifiez ensuite l'utilisation du nouveau noyau :+La commande **telnet** est utilisée pour établir une connexion à distance avec un serveur telnet : 
 + 
 +<file> 
 +  # telnet numero_ip 
 +</file> 
 + 
 +<WRAP center round 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>
-[root@centos7 ~]# uname -r +[root@centos7 ~]# telnet --help 
-3.10.0-327.13.1.el7.i2tch.x86_64+telnet: invalid option -- '-' 
 +Usage: telnet [-8] [-E] [-L] [-S tos] [-a] [-c] [-d] [-e char] [-l user] 
 + [-n tracefile] [-b hostalias ] [-r 
 + [host-name [port]]
 </code> </code>
  
-=====Gestion des Quotas=====+==== wget ====
  
-Sous Linux il est possible de mettre en place des quotas par utilisateur et par groupe. Ceci étantLinux ne sait  pas gérer des quotas par répertoire, uniquement des  +La commande **wget** est utilisée pour récupérer un fichier via httphttps ou ftp : 
-quotas par partition. L'administrateur met souvent des quotas en place sur l'arborescence de /home pour limiter l'espace de stockage occupé par les utilisateurs.+
  
-Déconnectez-vous et reconnectez-vous en tant que root.+<code> 
 +[root@centos7 ~]# wget https://www.dropbox.com/s/li5tyou8msofuwb/fichier_test?dl=0 
 +--2017-06-22 16:53:39--  https://www.dropbox.com/s/li5tyou8msofuwb/fichier_test?dl=0 
 +Resolving www.dropbox.com (www.dropbox.com)... 162.125.65.1 
 +Connecting to www.dropbox.com (www.dropbox.com)|162.125.65.1|:443... connected. 
 +HTTP request sent, awaiting response... 302 Found 
 +Location: https://dl.dropboxusercontent.com/content_link/enf8fglFyPxthmTsBfruPFaaOD7pStW4llpPQbU6SjeYhsRDwtN76xpVXuHrLIsZ/file [following] 
 +--2017-06-22 16:53:40--  https://dl.dropboxusercontent.com/content_link/enf8fglFyPxthmTsBfruPFaaOD7pStW4llpPQbU6SjeYhsRDwtN76xpVXuHrLIsZ/file 
 +Resolving dl.dropboxusercontent.com (dl.dropboxusercontent.com)... 162.125.65.6 
 +Connecting to dl.dropboxusercontent.com (dl.dropboxusercontent.com)|162.125.65.6|:443... connected. 
 +HTTP request sent, awaiting response..200 OK 
 +Length: 17 [text/plain] 
 +Saving to: ‘fichier_test?dl=0’
  
-Avant de mettre en place des quotas, configurer SELINUX en mode **permissive** afin de ne pas avoir d'erreurs de ce dernier :+100%[====================================================================================>] 17          --.-K/  in 0s      
  
-<code> +2017-06-22 16:53:41 (480 KB/s) - ‘fichier_test?dl=0’ saved [17/17]
-[root@centos7 ~]# getenforce +
-Enforcing +
-[root@centos7 ~]# setenforce permissive +
-[root@centos7 ~]# getenforce +
-Permissive+
 </code> </code>
  
-Editez ensuite le fichier /etc/sysconfig/selinux ainsi :+===Options de la commande wget=== 
 + 
 +Les options de cette commande sont :
  
 <code> <code>
-[root@centos7 ~]# vi /etc/sysconfig/selinux +[root@centos7 ~]# wget --help 
-[root@centos7 ~]# cat /etc/sysconfig/selinux+GNU Wget 1.14, a non-interactive network retriever. 
 +Usage: wget [OPTION]... [URL]...
  
-# This file controls the state of SELinux on the system+Mandatory arguments to long options are mandatory for short options too. 
-# SELINUXcan take one of these three values+ 
-    enforcing SELinux security policy is enforced+Startup: 
-    permissive SELinux prints warnings instead of enforcing+  -V,  --version           display the version of Wget and exit. 
-    disabled No SELinux policy is loaded+  -h,  --help              print this help. 
-SELINUX=permissive +  -b,  --background        go to background after startup. 
-# SELINUXTYPEcan take one of three two values+  -e,  --execute=COMMAND   execute a `.wgetrc'-style command. 
-    targeted Targeted processes are protected+ 
-    minimum Modification of targeted policyOnly selected processes are protected.  +Logging and input file
-    mls Multi Level Security protection+  -o,  --output-file=FILE    log messages to FILE. 
-SELINUXTYPE=targeted +  -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. 
 +  -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. 
 + 
 +Download: 
 +  -t,  --tries=NUMBER            set number of retries to NUMBER (0 unlimits). 
 +       --retry-connrefused       retry even if connection is refused. 
 +  -O,  --output-document=FILE    write documents to FILE. 
 +  -nc, --no-clobber              skip downloads that would download to 
 +                                 existing files (overwriting them). 
 +  -c,  --continue                resume getting a partially-downloaded file. 
 +       --progress=TYPE           select progress gauge type. 
 +  -N,  --timestamping            don't re-retrieve files unless newer than 
 +                                 local. 
 +  --no-use-server-timestamps     don't set the local file's 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 IP) on 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. 
 +       --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. 
 + 
 +Directories
 +  -nd, --no-directories           don't create directories. 
 +  -x,  --force-directories        force creation of directories. 
 +  -nH, --no-host-directories      don't create host directories. 
 +       --protocol-directories     use protocol name in directories. 
 +  -P,  --directory-prefix=PREFIX  save files to PREFIX/..
 +       --cut-dirs=NUMBER          ignore NUMBER remote directory components. 
 + 
 +HTTP 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. 
 +       --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. 
 +       --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'
 +                               challenge. 
 + 
 +HTTPS (SSL/TLS) options
 +       --secure-protocol=PR     choose secure protocol, one of auto, SSLv2, 
 +                                SSLv3, and TLSv1. 
 +       --no-check-certificate   don't validate the server's certificate. 
 +       --certificate=FILE       client certificate file. 
 +       --certificate-type=TYPE  client certificate typePEM 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 CA's. 
 +       --ca-directory=DIR       directory where hash list of CA's is stored. 
 +       --random-file=FILE       file with random data for seeding the SSL PRNG. 
 +       --egd-file=FILE          file naming the EGD socket with random data. 
 + 
 +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 recursing, get linked-to files (not dir). 
 + 
 +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 a 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. 
 +  --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|pcre). 
 +  -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 last component. 
 +  -X,  --exclude-directories=LIST  list of excluded directories. 
 +  -np, --no-parent                 don't ascend to the parent directory. 
 + 
 +Mail bug reports and suggestions to <bug-wget@gnu.org>.
 </code> </code>
  
-Commencez par vérifiez que le paquet **quota** est bien installé :+==== ftp ==== 
 + 
 +<WRAP center round important> 
 +La commande **ftp** n'est pas installée par défaut sous CentOS 7. Installez-le à l'aide de la commande **yum install ftp** en tant que root. 
 +</WRAP> 
 + 
 +La commande **ftp** est utilisée pour le transfert de fichiers:
  
 <code> <code>
-[root@centos7 ~]# rpm -qa | grep quota +[root@centos7 ~]# ftp ftp2.fenestros.com 
-quota-4.01-11.el7_2.1.x86_64 +Connected to ftp2.fenestros.com (213.186.33.14)
-quota-nls-4.01-11.el7_2.1.noarch+220 anonymous.ftp.ovh.net NcFTPd Server (licensed copy) ready. 
 +Name (ftp2.fenestros.com:root): anonymous 
 +331 Guest login ok, send your complete e-mail address as password. 
 +Password: 
 +230 Logged in anonymously. 
 +Remote system type is UNIX. 
 +Using binary mode to transfer files. 
 +ftp>  
 </code> </code>
  
-Editez le fichier **/etc/fstab** en ajoutant les options **usrquota** et **grpquota** à la ligne **/home** :+Une fois connecté, il convient d'utiliser la commande **help** pour afficher la liste des commandes disponibles :
  
 <code> <code>
-[root@centos7 ~]# vi /etc/fstab +ftp> help 
-[root@centos7 ~]# cat /etc/fstab+Commands may be abbreviated.  Commands are:
  
-# +! debug mdir sendport site 
-# /etc/fstab +$ dir mget put size 
-# Created by anaconda on Sat Apr 30 11:27:02 2016 +account disconnect mkdir pwd status 
-# +append exit mls quit struct 
-# Accessible filesystems, by reference, are maintained under '/dev/disk' +ascii form mode quote system 
-# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info +bell get modtime recv sunique 
-# +binary glob mput reget tenex 
-UUID=e65fe7da-cda8-4f5a-a827-1b5cabe94bed /                       xfs     defaults        0 0 +bye hash newer rstatus tick 
-UUID=2d947276-66e8-41f4-8475-b64b67d7a249 /boot                   xfs     defaults        0 0 +case help nmap rhelp trace 
-UUID=3181601a-7295-4ef0-a92c-f21f76b18e64 swap                    swap    defaults        0 0 +cd idle nlist rename type 
-UUID=a080ac6a-d15c-48e2-8461-a7b1aa3ebf1a /home   ext4    defaults,usrquota,grpquota        1 2+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>
  
-Démontez puis remontez /home :+Le caractère **!** permet d'exécuter une commande sur la machine cliente
  
 <code> <code>
-[root@centos7 ~]# umount /home +ftp> !pwd 
-[root@centos7 ~]# mount -a+/root
 </code> </code>
  
-Déconnectez-vous et reconnectez-vous en tant que traineeVérifiez ensuite que les options soient prises en compte :+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>
-[root@centos7 ~]# cat /etc/mtab +ftp> quit 
-rootfs / rootfs rw 0 0 +[root@centos7 ~]# 
-sysfs /sys sysfs rw,seclabel,nosuid,nodev,noexec,relatime 0 0 +
-proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0 +
-devtmpfs /dev devtmpfs rw,seclabel,nosuid,size=236036k,nr_inodes=59009,mode=755 0 0 +
-securityfs /sys/kernel/security securityfs rw,nosuid,nodev,noexec,relatime 0 0 +
-tmpfs /dev/shm tmpfs rw,seclabel,nosuid,nodev 0 0 +
-devpts /dev/pts devpts rw,seclabel,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000 0 0 +
-tmpfs /run tmpfs rw,seclabel,nosuid,nodev,mode=755 0 0 +
-tmpfs /sys/fs/cgroup tmpfs ro,seclabel,nosuid,nodev,noexec,mode=755 0 0 +
-cgroup /sys/fs/cgroup/systemd cgroup rw,nosuid,nodev,noexec,relatime,xattr,release_agent=/usr/lib/systemd/systemd-cgroups-agent,name=systemd 0 0 +
-pstore /sys/fs/pstore pstore rw,nosuid,nodev,noexec,relatime 0 0 +
-cgroup /sys/fs/cgroup/net_cls cgroup rw,nosuid,nodev,noexec,relatime,net_cls 0 0 +
-cgroup /sys/fs/cgroup/memory cgroup rw,nosuid,nodev,noexec,relatime,memory 0 0 +
-cgroup /sys/fs/cgroup/devices cgroup rw,nosuid,nodev,noexec,relatime,devices 0 0 +
-cgroup /sys/fs/cgroup/hugetlb cgroup rw,nosuid,nodev,noexec,relatime,hugetlb 0 0 +
-cgroup /sys/fs/cgroup/freezer cgroup rw,nosuid,nodev,noexec,relatime,freezer 0 0 +
-cgroup /sys/fs/cgroup/blkio cgroup rw,nosuid,nodev,noexec,relatime,blkio 0 0 +
-cgroup /sys/fs/cgroup/cpu,cpuacct cgroup rw,nosuid,nodev,noexec,relatime,cpuacct,cpu 0 0 +
-cgroup /sys/fs/cgroup/perf_event cgroup rw,nosuid,nodev,noexec,relatime,perf_event 0 0 +
-cgroup /sys/fs/cgroup/cpuset cgroup rw,nosuid,nodev,noexec,relatime,cpuset 0 0 +
-configfs /sys/kernel/config configfs rw,relatime 0 0 +
-/dev/sda2 / xfs rw,seclabel,relatime,attr2,inode64,noquota 0 0 +
-selinuxfs /sys/fs/selinux selinuxfs rw,relatime 0 0 +
-systemd-1 /proc/sys/fs/binfmt_misc autofs rw,relatime,fd=23,pgrp=1,timeout=300,minproto=5,maxproto=5,direct 0 0 +
-debugfs /sys/kernel/debug debugfs rw,relatime 0 0 +
-hugetlbfs /dev/hugepages hugetlbfs rw,seclabel,relatime 0 0 +
-tmpfs /tmp tmpfs rw,seclabel 0 0 +
-mqueue /dev/mqueue mqueue rw,seclabel,relatime 0 0 +
-sunrpc /var/lib/nfs/rpc_pipefs rpc_pipefs rw,relatime 0 0 +
-nfsd /proc/fs/nfsd nfsd rw,relatime 0 0 +
-/dev/sda1 /boot xfs rw,seclabel,relatime,attr2,inode64,noquota 0 0 +
-tmpfs /run/user/0 tmpfs rw,seclabel,nosuid,nodev,relatime,size=50080k,mode=700 0 0 +
-/dev/sdb1 /home ext4 rw,seclabel,relatime,quota,usrquota,grpquota,data=ordered 0 0+
 </code> </code>
  
-====La Commande quotacheck====+====SSH==== 
 + 
 +===Introduction=== 
 + 
 +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 distante. SSH comporte cinq acteurs : 
 + 
 +  * Le **serveur SSH** 
 +    * le démon sshd, qui s'occupe des authentifications et autorisations des clients,  
 +  * 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 serveur. Elle est détruite en fin de session. SSH-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. 
 + 
 +SSH fonctionne de la manière suivante pour la la mise en place d'un canal sécurisé: 
 + 
 +  * Le client contacte le serveur sur son port 22, 
 +  * Les client et le serveur échangent leur version de SSH. En cas de non-compatibilité de versions, l'un des deux met fin au processus, 
 +  * 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é serveur. Le 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é. 
 + 
 +==SSH-1== 
 + 
 +SSH-1 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**. 
 + 
 +Afin de s'identifier, le client essaie chacune des six méthodes suivantes : 
 + 
 +  * **Kerberos**, 
 +  * **Rhosts**, 
 +  * **%%RhostsRSA%%**, 
 +  * Par **clef asymétrique**, 
 +  * **TIS**, 
 +  * Par **mot de passe**. 
 + 
 +==SSH-2== 
 + 
 +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** : 
 + 
 +  * **SSH-TRANS** – Transport Layer Protocol, 
 +  * **SSH-AUTH** – Authentification Protocol, 
 +  * **SSH-CONN** – Connection Protocol. 
 + 
 +SSH-2 diffère de SSH-1 essentiellement dans la phase authentification.  
 + 
 +Trois méthodes d'authentification : 
 + 
 +  * Par **clef asymétrique**, 
 +    * Identique à SSH-1 sauf avec l'algorithme DSA, 
 +  * **%%RhostsRSA%%**, 
 +  * Par **mot de passe**. 
 + 
 +==Options de la commande==
  
-Pour activer les quotas sur /home, il convient d'utiliser la commande **quotacheck** :+Les options de cette commande sont :
  
 <code> <code>
-[root@centos7 ~]# quotacheck -cugvm -f /dev/sdb1 +[root@centos6 ~]# ssh --help 
-quotacheckYour kernel probably supports journaled quota but you are not using it. Consider switching to journaled quota to avoid running quotacheck after an unclean shutdown. +usagessh [-1246AaCfgKkMNnqsTtVvXxYy] [-b bind_address] [-c cipher_spec] 
-quotacheckParcours de /dev/sdb1 [/hometerminé +           [-D [bind_address:]port] [-e escape_char] [-F configfile
-quotacheckCannot stat old user quota file /home/aquota.userAucun fichier ou dossier de ce type. Usage will not be subtracted. +           [-i identity_file] [-L [bind_address:]port:host:hostport] 
-quotacheckCannot stat old group quota file /home/aquota.group: Aucun fichier ou dossier de ce type. Usage will not be subtracted. +           [-l login_name] [-m mac_spec] [-O ctl_cmd] [-o option] [-p port] 
-quotacheck: Cannot stat old user quota file /home/aquota.user: Aucun fichier ou dossier de ce type. Usage will not be subtracted. +           [-R [bind_address:]port:host:hostport] [-S ctl_path] 
-quotacheckCannot stat old group quota file /home/aquota.groupAucun fichier ou dossier de ce type. Usage will not be subtracted. +           [-w local_tun[:remote_tun]] [user@]hostname [command]
-quotacheckVérifié 100 répertoires et 230 fichiers +
-quotacheckAncien fichier non trouvé. +
-quotacheck: Ancien fichier non trouvé.+
 </code> </code>
  
-Les options de la commande quotacheck sont :+===L'authentification par mot de passe===
  
-<code> +L'utilisateur fournit un mot de passe au client ssh. Le 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.
-[root@centos7 ~]# quotacheck --help +
-Utility for checking and repairing quota files. +
-quotacheck [-gucbfinvdmMR] [-F <quota-format>] filesystem|-a+
  
--u, --user                check user files +Avantage: 
--g, --group               check group files +  * Aucune configuration de clef asymétrique n'est nécessaire.
--c, --create-files        create new quota files +
--b, --backup              create backups of old quota files +
--f, --force               force check even if quotas are enabled +
--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+
  
-Rapports de bugs à jack@suse.cz +Inconvénients: 
-</code>+  * L'utilisateur doit fournir à chaque connexion un identifiant et un mot de passe, 
 +  * Moins sécurisé qu'un système par clef asymétrique.
  
-Les quotas ont été activés et les fichier **aquota.user** et **aquota.group** ont été créés dans le répertoire /home :+===L'authentification par clef asymétrique=== 
 + 
 +  * Le **client** envoie au serveur une requête d'authentification par clé asymétrique qui contient le module de la clé à utiliser, 
 +  * Le **serveur** recherche une correspondance pour ce module dans le fichier des clés autorisés **~/.ssh/authorized_keys**, 
 +    * Dans le cas où une correspondance n'est pas trouvée, le serveur met fin à la communication, 
 +    * 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**, 
 +  * 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ésultat. Ensuite il envoie le résultat chiffré au serveur. 
 +  Le **serveur** génère le même haché et le compare avec celui reçu du client. Si les deux hachés sont identiques, l'authentification est réussie. 
 + 
 +===Installation=== 
 + 
 +Pour installer/mettre à jour le serveur **sshd**, utilisez **yum** :
  
 <code> <code>
-[root@centos7 ~]# ls -la /home +[root@centos7 ~]# yum install openssh-server 
-total 44 +Loaded plugins: fastestmirror, langpacks 
-drwxr-xr-x.  4 root    root     4096 11 août  13:39 +Loading mirror speeds from cached hostfile 
-dr-xr-xr-x. 18 root    root     4096 11 août  13:27 .. + * basecentos.mirror.fr.planethoster.net 
--rw------- 1 root    root     7168 11 août  13:39 aquota.group + * extrasftp.ciril.fr 
--rw-------.  1 root    root     7168 11 août  13:39 aquota.user + * updates: centos.mirrors.ovh.net 
-drwx------.  2 root    root    16384 11 août  13:26 lost+found +Package openssh-server-6.6.1p1-25.el7_2.x86_64 already installed and latest version 
-drwx------. 14 trainee trainee  4096 30 avril 15:29 trainee+Nothing to do
 </code> </code>
  
-Créez maintenant un utilisateur **fenestros** avec le mot de passe **fenestros** :+<WRAP center round important> 
 +**Important** - Pour les stations de travail, installez le client : **openssh-clients**. 
 +</WRAP> 
 + 
 +==Options de la commande== 
 + 
 +Les options de la commande sont : 
 + 
 +<file> 
 +SYNOPSIS 
 +     sshd [-46DdeiqTt] [-b bits] [-C connection_spec] [-f config_file] [-g login_grace_time] [-h host_key_file] [-k key_gen_time] [-o option] [-p port]  [-u len] 
 +</file> 
 + 
 +===Configuration=== 
 + 
 +<WRAP center round important> 
 +**Important** - La configuration doit s'effectuer dans la fenêtre de la VM sous VirtualBox. Les connexions en ssh doivent de faire à partir d'un terminal ou à partir de l'application putty. 
 +</WRAP> 
 + 
 +==Serveur== 
 + 
 +La configuration du serveur s'effectue dans le fichier **/etc/ssh/sshd_config** :
  
 <code> <code>
-[root@centos7 ~]# groupadd fenestros && useradd fenestros -c FenestrOs -d /home/fenestros -g fenestros -s /bin/bash +[root@centos7 ~]# cat /etc/ssh/sshd_config 
-[root@centos7 ~]passwd fenestros +# $OpenBSD: sshd_config,v 1.93 2014/01/10 05:59:19 djm Exp $
-Changement de mot de passe pour l'utilisateur fenestros. +
-Nouveau mot de passe fenestros +
-MOT DE PASSE INCORRECT Le mot de passe contient le nom d'utilisateur sous une forme +
-Retapez le nouveau mot de passe : fenestros +
-passwd : mise à jour réussie de tous les jetons d'authentification. +
-[root@centos7 ~]#  +
-</code>+
  
-====La Commande edquota====+# This is the sshd server system-wide configuration file.  See 
 +# sshd_config(5) for more information.
  
-Mettez en place maintenant un quota de 10Mo pour l'utilisateur **fenestros** :+# This sshd was compiled with PATH=/usr/local/bin:/usr/bin 
 + 
 +# The strategy used for options in the default sshd_config shipped with 
 +# OpenSSH is to specify options with their default value where 
 +# possible, but leave them commented.  Uncommented options override the 
 +# default value. 
 + 
 +# If you want to change the port on a SELinux system, you have to tell 
 +# SELinux about this change. 
 +# semanage port -a -t ssh_port_t -p tcp #PORTNUMBER 
 +
 +#Port 22 
 +#AddressFamily any 
 +#ListenAddress 0.0.0.0 
 +#ListenAddress :: 
 + 
 +# The default requires explicit activation of protocol 1 
 +#Protocol 2 
 + 
 +# HostKey for protocol version 1 
 +#HostKey /etc/ssh/ssh_host_key 
 +# HostKeys for protocol version 2 
 +HostKey /etc/ssh/ssh_host_rsa_key 
 +#HostKey /etc/ssh/ssh_host_dsa_key 
 +HostKey /etc/ssh/ssh_host_ecdsa_key 
 +HostKey /etc/ssh/ssh_host_ed25519_key 
 + 
 +# Lifetime and size of ephemeral version 1 server key 
 +#KeyRegenerationInterval 1h 
 +#ServerKeyBits 1024 
 + 
 +# Ciphers and keying 
 +#RekeyLimit default none 
 + 
 +# Logging 
 +# obsoletes QuietMode and FascistLogging 
 +#SyslogFacility AUTH 
 +SyslogFacility AUTHPRIV 
 +#LogLevel INFO 
 + 
 +# Authentication: 
 + 
 +#LoginGraceTime 2m 
 +#PermitRootLogin yes 
 +#StrictModes yes 
 +#MaxAuthTries 6 
 +#MaxSessions 10 
 + 
 +#RSAAuthentication yes 
 +#PubkeyAuthentication yes 
 + 
 +# The default is to check both .ssh/authorized_keys and .ssh/authorized_keys2 
 +# but this is overridden so installations will only check .ssh/authorized_keys 
 +AuthorizedKeysFile .ssh/authorized_keys 
 + 
 +#AuthorizedPrincipalsFile none 
 + 
 +#AuthorizedKeysCommand none 
 +#AuthorizedKeysCommandUser nobody 
 + 
 +# For this to work you will also need host keys in /etc/ssh/ssh_known_hosts 
 +#RhostsRSAAuthentication no 
 +# similar for protocol version 2 
 +#HostbasedAuthentication no 
 +# Change to yes if you don't trust ~/.ssh/known_hosts for 
 +# RhostsRSAAuthentication and HostbasedAuthentication 
 +#IgnoreUserKnownHosts no 
 +# Don't read the user's ~/.rhosts and ~/.shosts files 
 +#IgnoreRhosts yes 
 + 
 +# To disable tunneled clear text passwords, change to no here! 
 +#PasswordAuthentication yes 
 +#PermitEmptyPasswords no 
 +PasswordAuthentication yes 
 + 
 +# Change to no to disable s/key passwords 
 +#ChallengeResponseAuthentication yes 
 +ChallengeResponseAuthentication no 
 + 
 +# Kerberos options 
 +#KerberosAuthentication no 
 +#KerberosOrLocalPasswd yes 
 +#KerberosTicketCleanup yes 
 +#KerberosGetAFSToken no 
 +#KerberosUseKuserok yes 
 + 
 +# GSSAPI options 
 +GSSAPIAuthentication yes 
 +GSSAPICleanupCredentials no 
 +#GSSAPIStrictAcceptorCheck yes 
 +#GSSAPIKeyExchange no 
 +#GSSAPIEnablek5users no 
 + 
 +# Set this to 'yes' to enable PAM authentication, account processing, 
 +# and session processing. If this is enabled, PAM authentication will 
 +# be allowed through the ChallengeResponseAuthentication and 
 +# PasswordAuthentication.  Depending on your PAM configuration, 
 +# PAM authentication via ChallengeResponseAuthentication may bypass 
 +# the setting of "PermitRootLogin without-password"
 +# If you just want the PAM account and session checks to run without 
 +# PAM authentication, then enable this but set PasswordAuthentication 
 +# and ChallengeResponseAuthentication to 'no'
 +# WARNING: 'UsePAM no' is not supported in Red Hat Enterprise Linux and may cause several 
 +# problems. 
 +UsePAM yes 
 + 
 +#AllowAgentForwarding yes 
 +#AllowTcpForwarding yes 
 +#GatewayPorts no 
 +X11Forwarding yes 
 +#X11DisplayOffset 10 
 +#X11UseLocalhost yes 
 +#PermitTTY yes 
 +#PrintMotd yes 
 +#PrintLastLog yes 
 +#TCPKeepAlive yes 
 +#UseLogin no 
 +UsePrivilegeSeparation sandbox # Default for new installations. 
 +#PermitUserEnvironment no 
 +#Compression delayed 
 +#ClientAliveInterval 0 
 +#ClientAliveCountMax 3 
 +#ShowPatchLevel no 
 +#UseDNS yes 
 +#PidFile /var/run/sshd.pid 
 +#MaxStartups 10:30:100 
 +#PermitTunnel no 
 +#ChrootDirectory none 
 +#VersionAddendum none 
 + 
 +# no default banner path 
 +#Banner none 
 + 
 +# Accept locale-related environment variables 
 +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 
 + 
 +# override default of no subsystems 
 +Subsystem sftp /usr/libexec/openssh/sftp-server 
 + 
 +# Example of overriding settings on a per-user basis 
 +#Match User anoncvs 
 +# X11Forwarding no 
 +# AllowTcpForwarding no 
 +# PermitTTY no 
 +# ForceCommand cvs server 
 +</code> 
 + 
 +Pour ôter les lignes de commentaires dans ce fichier, utilisez la commande suivante :
  
 <code> <code>
-[root@centos ~]# edquota -u fenestros -/home+[root@centos7 ~]# cd /tmp ; grep --v '^(#|$)'  /etc/ssh/sshd_config > sshd_config 
 +[root@centos7 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 
 +AuthorizedKeysFile .ssh/authorized_keys 
 +PasswordAuthentication yes 
 +ChallengeResponseAuthentication no 
 +GSSAPIAuthentication yes 
 +GSSAPICleanupCredentials no 
 +UsePAM yes 
 +X11Forwarding yes 
 +UsePrivilegeSeparation sandbox # Default for new installations. 
 +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>
  
-L'éditeur **vi** se lance et vous obtiendrez un résultat similaire à celui-ci :+Pour sécuriser le serveur ssh, ajoutez ou modifiez les directives suivantes :
  
 <file> <file>
-Quotas disque pour user fenestros (uid 1001) : +AllowGroups adm 
- Système de fichiers           blocs       souple     stricte   inodes    souple   stricte +Banner /etc/issue.net 
-  /dev/sdb1                                  0          0          0        0        0+HostbasedAuthentication no 
 +IgnoreRhosts yes 
 +LoginGraceTime 60 
 +LogLevel INFO 
 +PermitEmptyPasswords no 
 +PermitRootLogin no 
 +PrintLastLog yes 
 +Protocol 2 
 +StrictModes yes 
 +X11Forwarding no
 </file> </file>
  
-Modifiez ce fichier ainsi :+Votre fichier ressemblera à celui-ci :
  
 <file> <file>
-Quotas disque pour user fenestros (uid 1001) : +AllowGroups adm 
- Système de fichiers           blocs       souple     stricte   inodes    souple   stricte +Banner /etc/issue.net 
-  /dev/sdb1                                8000       10000        0        0        0+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 
 +AuthorizedKeysFile .ssh/authorized_keys 
 +PasswordAuthentication yes 
 +ChallengeResponseAuthentication no 
 +GSSAPIAuthentication yes 
 +GSSAPICleanupCredentials no 
 +UsePAM yes 
 +UsePrivilegeSeparation sandbox # Default for new installations. 
 +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
 </file> </file>
  
-Les options de la commande **edquota** sont :+<WRAP center round todo> 
 +**A Faire** - Renommez le fichier **/etc/ssh/sshd_config** en **/etc/ssh/sshd_config.old** puis copiez le fichier **/tmp/sshd_config** vers **/etc/ssh/**. Redémarrez ensuite le service sshd. N'oubliez pas de mettre l'utilisateur **trainee** dans le groupe **adm** 
 +</WRAP>
  
-<code> +Pour générer les clefs sur le serveur saisissez la commande suivante en tant que **root**:
-[root@centos7 ~]# edquota --help +
-edquotaUsage: +
- edquota [-rm] [-u] [-F formatname] [-p username] [-f filesystem] username ... +
- edquota [-rm] -g [-F formatname] [-p groupname] [-f filesystem] groupname ... +
- edquota [-u|g] [-F formatname] [-f filesystem] -t +
- edquota [-u|g] [-F formatname] [-f filesystem] -T username|groupname ...+
  
--u--user                    edit user data +Lors de la génération des clefsla passphrase doit être **vide**.
--g, --group                   edit group data +
--r, --remote                  edit remote quota (via RPC) +
--m, --no-mixed-pathnames      trim leading slashes from NFSv4 mountpoints +
--F, --format=formatname       edit quotas of a specific format +
--p, --prototype=name          copy data from a prototype user/group +
-    --always-resolve          always try to resolve name, even if it is +
-                              composed only of digits +
--f, --filesystem=filesystem   edit data only on a specific filesystem +
--t, --edit-period             edit grace period +
--T, --edit-times              edit grace time of a user/group +
--h, --help                    display this help text and exit +
--V, --version                 display version information and exit+
  
-Rapports de bugs à jack@suse.cz+<code> 
 +[root@centos7 ~]# ssh-keygen -t dsa 
 +Generating public/private dsa key pair. 
 +Enter file in which to save the key (/root/.ssh/id_dsa)/etc/ssh/ssh_host_dsa_key 
 +Enter passphrase (empty for no passphrase):  
 +Enter same passphrase again:  
 +Your identification has been saved in /etc/ssh/ssh_host_dsa_key. 
 +Your public key has been saved in /etc/ssh/ssh_host_dsa_key.pub. 
 +The key fingerprint is: 
 +d5:54:d3:30:1c:f5:da:f8:21:15:1f:c8:6c:3b:b1:ff root@centos7.fenestros.loc 
 +The key's randomart image is: 
 ++--[ DSA 1024]----+ 
 +|            +oBB.| 
 +|           o *.o*| 
 +|          . o +.o| 
 +|           +.+ | 
 +|        S    .=..| 
 +|              .o.
 +|                o| 
 +|                E| 
 +|                 | 
 ++-----------------+
 </code> </code>
  
 <WRAP center round important> <WRAP center round important>
-Pour mettre en place un quota par group, la procédure est similaireIl suffit d'utiliser l'option -g de la commande edquota.+Le chemin à indiquer pour le fichier est **/etc/ssh/ssh_host_dsa_key**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]]**
 </WRAP> </WRAP>
  
-====La Commande quotaon==== +Les clefs publiques générées possèdent l'extension **.pub**. Les clefs privées n'ont pas d'extension :
- +
-Appliquez maintenant les quotas :+
  
 <code> <code>
-[root@centos7 ~]# quotaon -a+[root@centos7 ~]# ls /etc/ssh 
 +moduli      sshd_config       ssh_host_dsa_key.pub  ssh_host_ecdsa_key.pub  ssh_host_ed25519_key.pub  ssh_host_rsa_key.pub 
 +ssh_config  ssh_host_dsa_key  ssh_host_ecdsa_key    ssh_host_ed25519_key    ssh_host_rsa_key
 </code> </code>
  
-Les options de la commande **quotaon** sont :+Re-démarrez ensuite le service sshd :
  
 <code> <code>
-[root@centos7 ~]# quotaon --help +[root@centos7 ~]# systemctl restart sshd.service
-quotaon: Usage: +
- quotaon [-guvp] [-F quotaformat] [-x state] -a +
- quotaon [-guvp] [-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, --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. +Saisissez maintenant les commandes suivantes en tant que **trainee** :
  
-Quand l'utilisateur fenestros aura dépassé le quota **souple**, il recevra un message d'avertissement. Quand 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**.+<WRAP center round important> 
 +Lors de la génération des clefs, la passphrase doit être **vide**. 
 +</WRAP>
  
-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.+<code> 
 +[trainee@centos7 ~]$ ssh-keygen -t dsa 
 +Generating public/private dsa key pair. 
 +Enter file in which to save the key (/home/trainee/.ssh/id_dsa):  
 +Created directory '/home/trainee/.ssh'. 
 +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: 
 +97:92:85:d1:ae:97:f7:64:d2:54:45:89:eb:57:b1:66 trainee@centos7.fenestros.loc 
 +The key's randomart image is: 
 ++--[ DSA 1024]----+ 
 +|        ..    ..=| 
 +|         o.  . o.| 
 +|        ...   ..o| 
 +|         o.. ..E.| 
 +|        S.o..oo .| 
 +|        .oo o.+. | 
 +|         . . =.  | 
 +|              .  | 
 +|                 | 
 ++-----------------+ 
 +[trainee@centos7 ~]$ ssh-keygen -t rsa 
 +Generating public/private rsa key pair. 
 +Enter file in which to save the key (/home/trainee/.ssh/id_rsa):  
 +Enter passphrase (empty for no passphrase):  
 +Enter same passphrase again:  
 +Your identification has been saved in /home/trainee/.ssh/id_rsa. 
 +Your public key has been saved in /home/trainee/.ssh/id_rsa.pub. 
 +The key fingerprint is: 
 +80:4c:5a:bf:d0:2f:d1:a1:34:7c:09:a1:9c:0d:ed:2d trainee@centos7.fenestros.loc 
 +The key's randomart image is: 
 ++--[ RSA 2048]----+ 
 +|    +o=o..       | 
 +|   * Xo+o.       | 
 +|  . B.Bo.        | 
 +|     .E=.        | 
 +|      o.S        | 
 +|               | 
 +|                 | 
 +|                 | 
 +|                 | 
 ++-----------------+ 
 +[trainee@centos7 ~]$ 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: 
 +41:5d:64:cf:d6:4a:ce:8e:a9:a8:4a:62:04:57:09:fc trainee@centos7.fenestros.loc 
 +The key's randomart image is: 
 ++--[ECDSA  256]---+ 
 +| .....  .. o+    | 
 +|  ...  .  .. o . | 
 +|. ..    .     = .| 
 +| o  E    .   = . | 
 +|  .         
 +| .             | 
 +|  o .       o .  | 
 +| . o     . .     | 
 +|    ..... .      | 
 ++-----------------+ 
 +[trainee@centos7 ~]$ 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: 
 +66:3a:83:d1:6d:79:46:48:88:7c:d9:65:59:bb:e6:d0 trainee@centos7.fenestros.loc 
 +The key's randomart image is: 
 ++--[ED25519  256--+ 
 +|   . . +..oo.    | 
 +|    o +..o.  .   | 
 +|      . . .    | 
 +|     . . o . .   | 
 +|    . . S + E    | 
 +|     o = o +     | 
 +|    . +        | 
 +|               | 
 +|                 | 
 ++-----------------+ 
 +</code>
  
 <WRAP center round important> <WRAP center round important>
-La commande pour désactivez les quotas est **quotaoff**. +Les clés générées seront placées dans le répertoire **~/.ssh/**.
 </WRAP> </WRAP>
  
-====La Commande repquota====+==Utilisation==
  
-Pour visualiser les quotas utilisez la commande **repquota** :+La commande ssh prend la forme suivante: 
 + 
 +  ssh -l nom_de_compte numero_ip (nom_de_machine) 
 + 
 +En saisissant cette commande sur votre propre machine, vous obtiendrez un résultat similaire à celle-ci :
  
 <code> <code>
-[root@centos7 ~]# repquota /home +[trainee@centos7 ~]$ su - 
-*** Rapport pour les quotas user sur le périphérique /dev/sdb1 +Mot de passe  
-Période de sursis bloc 7days ; période de sursis inode 7days +Dernière connexion lundi  9 mai 2016 à 22:47:48 CEST sur pts/0 
-                        Block limits                File limits + 
-Utilisateur     utilisé souple stricte sursis utilisé souple stricte sursis +[root@centos7 ~]# ssh -l trainee localhost 
----------------------------------------------------------------------- +The authenticity of host 'localhost (127.0.0.1)' can't be established. 
-root      --      20                                         +ECDSA key fingerprint is 19:cd:05:58:af:2c:10:82:52:ba:e3:31:df:bd:72:54. 
-trainee   --   20484                        328                +Are you sure you want to continue connecting (yes/no)? yes 
-   +Warning: Permanently added 'localhost' (ECDSA) to the list of known hosts. 
 +trainee@localhost's password: trainee 
 +Last login: Mon May  9 23:25:15 2016 from localhost.localdomain
 </code> </code>
  
-<WRAP center round important> +===Tunnels SSH===
-Notez que l'utilisateur fenestros ne figure pas dans la liste. Sous CentOS, le quota n'est pas visible tant que l'utilisateur ne s'est pas connecté pour la première fois. Notez aussi les période de grâce de **7** jours. +
-</WRAP>+
  
-Les options de la commande **repquota** sont :+Le protocole SSH peut être utilisé pour sécuriser les protocoles tels telnet, pop3 etc.. En effet, on peut créer un //tunnel// SSH dans lequel passe les communications du protocole non-sécurisé.
  
-<code> +La commande pour créer un tunnel ssh prend la forme suivante :
-[root@centos7 ~]# repquota --help +
-repquotaUtility for reporting quotas. +
-Usage: +
-repquota [-vugsi] [-c|C] [-t|n] [-F quotaformat] (-a | mntpoint)+
  
--v, --verbose               display also users/groups without any usage +  ssh --f compte@hôte -Lport-local:localhost:port_distant
--u, --user                  display information about users +
--g, --group                 display information about groups +
--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 +
--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+
  
-Rapports de bugs à jack@suse.cz+Dans votre cas, vous allez créer un tunnel dans votre propre vm entre le port 15023 et le port 23 : 
 + 
 +<code> 
 +[root@centos7 ~]# ssh -N -f trainee@localhost -L15023:localhost:23 
 +trainee@localhost's password: 
 </code> </code>
  
-====La Commande quota====+Installez maintenant le client et le serveur telnet : 
 + 
 +<code> 
 +[root@centos7 ~]# yum install telnet telnet-server 
 +</code>
  
-Pour visualiser les quotas d'un utilisateur spécifique, il convient d'utiliser la commande **quota** :+Telnet n'est ni démarré ni activé. Il convient donc de le démarrer et de l'activer :
  
 <code> <code>
-[root@centos7 ~]# quota fenestros +[root@centos7 ~]# systemctl status telnet.socket 
-Disk quotas for user fenestros (uid 1001): aucun +● telnet.socket - Telnet Server Activation Socket 
-[root@centos7 ~]# su - fenestros +   Loaded: loaded (/usr/lib/systemd/system/telnet.socket; disabled; vendor preset: disabled) 
-[fenestros@centos7 ~]$ touch test +   Activeinactive (dead) 
-[fenestros@centos7 ~]$ exit +     Docs: man:telnetd(8) 
-logout +   Listen: [::]:23 (Stream) 
-[root@centos7 ~]# quota fenestros + Accepted: 0; Connected: 0 
-Disk quotas for user fenestros (uid 1001):  + 
-Système fichiers   blocs   quota  limite  sursisfichiers   quota  limite  sursis +[root@centos7 ~]# systemctl start telnet.socket 
-      /dev/sdb1      24    8000   10000                                      + 
 +[root@centos7 ~]# 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 2016-05-09 23:40:13 CEST; 3s ago 
 +     Docs: man:telnetd(8) 
 +   Listen: [::]:23 (Stream) 
 + Accepted: 0; Connected: 0 
 + 
 +May 09 23:40:13 centos7.fenestros.loc systemd[1]: Listening on Telnet Server Activation Socket. 
 +May 09 23:40:13 centos7.fenestros.loc systemd[1]: Starting Telnet Server Activation Socket. 
 + 
 +[root@centos7 ~]# systemctl enable telnet.socket 
 +Created symlink from /etc/systemd/system/sockets.target.wants/telnet.socket to /usr/lib/systemd/system/telnet.socket. 
 +[root@centos7 ~]# systemctl status telnet.socket 
 +● telnet.socket - Telnet Server Activation Socket 
 +   Loaded: loaded (/usr/lib/systemd/system/telnet.socket; enabled; vendor presetdisabled) 
 +   Active: active (listening) since Mon 2016-05-09 23:40:13 CEST; 36s ago 
 +     Docs: man:telnetd(8) 
 +   Listen: [::]:23 (Stream) 
 + Accepted: 0; Connected: 0 
 + 
 +May 09 23:40:13 centos7.fenestros.loc systemd[1]: Listening on Telnet Server Activation Socket. 
 +May 09 23:40:13 centos7.fenestros.loc systemd[1]: Starting Telnet Server Activation Socket.
 </code> </code>
  
-Les options de la commande **quota** sont :+Connectez-vous ensuite via telnet sur le port 15023, vous constaterez que votre connexion n'aboutit pas :
  
 <code> <code>
-[root@centos7 ~]# quota --help +[root@centos7 ~]# telnet localhost 15023 
-quota: Usage: quota [-guqvswim] [-l | [-Q | -A]] [-F quotaformat] +Trying 127.0.0.1... 
- quota [-qvswim] [-l | [-Q | -A]] [-F quotaformat] -u username ... +Connected to localhost. 
- quota [-qvswim] [-l | [-Q | -A]] [-F quotaformat] -g groupname ... +Escape character is '^]'.
- quota [-qvswugQm[-F quotaformat] -f filesystem ...+
  
--u, --user                display quota for user +Kernel 3.10.0-327.13.1.el7.x86_64 on an x86_64 
--g, --group               display quota for group +centos7 login: trainee 
--q, --quiet               print more terse message +Password:  
--v, --verbose             print more verbose message +Last login: Mon May  9 23:26:32 from localhost.localdomain 
--s, --human-readable      display numbers in human friendly units (MB, GB...) +[trainee@centos7 ~]$ 
-    --always-resolve      always try to translate name to id, even if it is +
-   composed of only digits +
--w, --no-wrap             do not wrap long lines +
--p, --raw-grace           print grace time in seconds since epoch +
--l, --local-only          do not query NFS filesystems +
--Q, --quiet-refuse        do not print error message when NFS server does +
-                          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+
  
-Rapports de bugs à : jack@suse.cz 
 </code> </code>
  
-====La Commande warnquota====+<WRAP center round important> 
 +Notez bien que votre communication telnet passe par le tunnel SSH. 
 +</WRAP>
  
-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.+====SCP====
  
-Sous RHEL/CentOS 7, warnquota n'est pas installé par défaut :+===Introduction=== 
 + 
 +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 : 
 + 
 +  $ scp compte@numero_ip(nom_de_machine):/chemin_distant/fichier_distant /chemin_local/fichier_local 
 + 
 +ou vers une machine distante : 
 + 
 +  $ 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@centos7 ~]# yum install quota-warnquota +[trainee@centos7 ~]$ pwd 
-Modules complémentaires chargés : fastestmirror, langpacks +/home/trainee 
-base                                                                                                                                             | 3.6 kB  00:00:00      +[trainee@centos7 ~]$ touch scp_test 
-extras                                                                                                                                           | 3.4 kB  00:00:00      +</code>
-updates                                                                                                                                          | 3.4 kB  00:00:00      +
-Loading mirror speeds from cached hostfile +
- * base: centos.quelquesmots.fr +
- * extras: miroir.univ-paris13.fr +
- * updates: miroir.univ-paris13.fr +
-Résolution des dépendances +
---> Lancement de la transaction de test +
----> Le paquet quota-warnquota.x86_64 1:4.01-11.el7_2.1 sera installé +
---Résolution des dépendances terminée+
  
-Dépendances résolues+Récupérez le fichier **scp_test** en utilisant scp :
  
-======================================================================================================================================================================== +<code> 
- Package                                     Architecture                       Version                                       Dépôt                               Taille +[trainee@centos7 ~]$ touch /home/trainee/scp_test 
-======================================================================================================================================================================== +[trainee@centos7 ~]$ scp trainee@127.0.0.1:/home/trainee/scp_test /tmp/scp_test 
-Installation +The authenticity of host '127.0.0.(127.0.0.1)' can't be established. 
- quota-warnquota                             x86_64                             1:4.01-11.el7_2.1                             updates                              76 k+ECDSA key fingerprint is 19:cd:05:58:af:2c:10:82:52:ba:e3:31:df:bd:72:54. 
 +Are you sure you want to continue connecting (yes/no)? yes 
 +Warning: Permanently added '127.0.0.1' (ECDSA) to the list of known hosts. 
 +trainee@127.0.0.1's password: trainee 
 +scp_test                                                                                         100%    0     0.0KB/  00:00     
 +[trainee@centos7 ~]$ ls /tmp/scp_test  
 +/tmp/scp_test 
 +</code>
  
-Résumé de la transaction +==Mise en place des clefs==
-======================================================================================================================================================================== +
-Installation   1 Paquet+
  
-Taille totale des téléchargements 76 k +Il convient maintenant de se connecter sur le <<serveur>> en utilisant ssh et vérifiez la présence du répertoire ~/.ssh 
-Taille d'installation 137 k + 
-Is this ok [y/d/N]: y+En saisissant cette commande, vous obtiendrez une fenêtre similaire à celle-ci : 
 + 
 +<code> 
 +[trainee@centos7 ~]$ ssh -l trainee 127.0.0.1 
 +trainee@127.0.0.1's password:  
 +Last login: Mon May  9 23:42:46 2016 from localhost.localdomain 
 +[trainee@centos7 ~]$ ls -la | grep .ssh 
 +drwx------.  2 trainee trainee 4096 May  9 23:25 .ssh 
 +[trainee@centos7 ~]$ exit 
 +logout 
 +Connection to 127.0.0.1 closed.
 </code> </code>
  
-Les options de la commande **warnquota** sont :+<WRAP center round 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@centos7 ~]# warnquota --help +[trainee@centos7 ~]$ scp .ssh/id_ecdsa.pub trainee@127.0.0.1:/home/trainee/.ssh/authorized_keys 
-warnquota: Usage+trainee@127.0.0.1's password: trainee 
-  warnquota [-ugsid] [-F quotaformat] [-c configfile] [-q quotatabfile] [-a adminsfile] [filesystem...]+id_ecdsa.pub                                                                                     100%  227     0.2KB/  00:00  
 +</code>
  
--u, --user                      warn users +Connectez-vous via telnet et insérer les clefs publiques restantes dans le fichier .ssh/authorized_keys :
--g, --group                     warn groups +
--s, --human-readable            send information in more human friendly units +
--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+
  
-Rapports de bugs à jack@suse.cz+<code> 
 +root@centos7 ~]# ssh -l trainee localhost 
 +trainee@localhost's password: trainee 
 +Last login: Tue May 10 01:39:33 2016 from localhost.localdomain 
 +[trainee@centos7 ~]$ cat .ssh/id_rsa.pub >> .ssh/authorized_keys  
 +[trainee@centos7 ~]$ cat .ssh/id_dsa.pub >> .ssh/authorized_keys  
 +[trainee@centos7 ~]$ cat .ssh/id_ed25519.pub >> .ssh/authorized_keys  
 +[trainee@centos7 ~]$ cat .ssh/authorized_keys  
 +ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBG5BtOMFLrUbxD//RLELvkkA06CQvXuJqKSjSB2dlUXgaPyEJXuwHO0pxcdbrg4qqb0f9sE75oMVowXxYgqhWDE= trainee@centos7.fenestros.loc 
 +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC9KOuEH5+kyihhm99Na8UTA4Gi5AfiOVeJyS3UzH7ta73ewmv7JZqaXzar1NlHcpEMkCUs2yKxHyO/yAfjbCSdow5vfwJiuJTes+HbpvsJqKp1+OR7tf+OMgjDcajoGi7DYuybIs9QrbWgh57QclbldHQXRO+xbeUTykxcRun7AvR5uWZe4zMooBAmVVEms+l1rn8CUi+D811jqQGSpU39PxkojTAwgbxlevT/Twy4sfeRR47UHc3AbrHb8SgyKqbx5/S9UxkbkhJjckx0s58fnAwf9nX5rKE7RdCQisRvdLeLHozq3EOomvc7kzejefBtUDWxBEjnSeAgIP3+OEQl trainee@centos7.fenestros.loc 
 +ssh-dss AAAAB3NzaC1kc3MAAACBAK9/4siucBnf/NAHBMjZWIx1coA/wYVBjfudVyKArip1fVUuYqf0Ri9vTorG8KJ2zzLRbW5z7V5ZDSn4f6P5Kv7K5xVPne9dYQHxImkZIljpFseUW56BwCvcgTNZVLD0tYZzF+B0/Py4waJW+pnTDfZush6DYyAhVnEuxIPI4i+PAAAAFQCeCZyDRo1o41lf19qWGJTG7W+ChQAAAIAKtQe9QlkW4CA9kP+q4v3N07WR5TzWsvfZARjGXgrSqTo0BeQgMLwRJHeEOhdsgJ30cNbl6QXlB4G4J6dUoTiN/sY1dFbXzjzsT/MHLedsllVfXXRQxgvN2nsbsKEUnmqEBWzgw5s6KOkGX33+0Six0E3xvOrYxkMNLP/5VT4aQwAAAIEAmOS94peBeo78yCKzCvSFnEL72dUCFFA6CGFGqgffhK1vP5H5pG5vQxzBn9NnIXURCACF7ZxtZaxohSoB1M0/s0DfrfNIvXRMGvsJpZ9B2psTMDl9qBffIfIARnwkWKG1gC/lWaovUpDByE1wl09ZCDCnZp/16ULJY0zvJ566Seg= trainee@centos7.fenestros.loc 
 +ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIENas3A3hmXFj1cb+lrn2NAt6g95Pla6qUFQHd1wg2y1 trainee@centos7.fenestros.loc 
 +ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBG5BtOMFLrUbxD//RLELvkkA06CQvXuJqKSjSB2dlUXgaPyEJXuwHO0pxcdbrg4qqb0f9sE75oMVowXxYgqhWDE= trainee@centos7.fenestros.loc
 </code> </code>
 +
 +Lors de la connexion suivante au serveur, l'authentification utilise le couple de clefs asymétrique et aucun mot de passe n'est requis :
 +
 +<code>
 +[trainee@centos7 ~]$ ssh -l trainee localhost
 +Last login: Tue May 10 01:50:39 2016 from localhost.localdomain
 +[trainee@centos7 ~]$ exit
 +déconnexion
 +Connection to localhost closed.
 +</code>
 +
 +<WRAP center round important>
 +Le fichier **authorized_keys** doit avoir les permissions de 600.
 +</WRAP>
  
 ----- -----
-<html> + 
-<div align="center"> +Copyright © 2023 Hugh Norris.
-Copyright © 2020 Hugh Norris. +
-</html>+
Menu