Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
elearning:workbooks:centos:6:avance:l104 [2020/08/08 12:12] – admin | elearning:workbooks:centos:6:avance:l104 [2023/02/15 15:54] (Version actuelle) – admin | ||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
~~PDF: | ~~PDF: | ||
+ | |||
+ | Version : **2022.01** | ||
Dernière mise-à-jour : ~~LASTMOD~~ | Dernière mise-à-jour : ~~LASTMOD~~ | ||
- | ======LCF304 | + | ======LCF303 |
=====Contenu du Module===== | =====Contenu du Module===== | ||
- | * **LCF304 | + | * **LCF303 |
- | * X Window System | + | * Contenu du Module |
- | * Configuration | + | * Configuration |
- | * Gestionnaire | + | * Configuration |
- | * Toolkits | + | * DHCP |
- | * Freedesktop | + | * / |
- | * Display Manager | + | * / |
- | * XDM, GDM et KDM | + | * IP Fixe |
- | * LightDM | + | * / |
- | * X.orgX11 | + | * / |
- | * Présentation | + | * La Commande hostname |
- | * Démarrage et Arrêt | + | * La Commande ifconfig |
- | * Utilisation | + | * Activer/ |
- | * Configuration | + | * / |
- | * La Section ServerFlags | + | * Résolution d' |
- | * La Section ServerLayout | + | * / |
- | * La Section Files | + | * / |
- | * La Section Modules | + | * /etc/hosts |
- | * La Section InputDevice | + | * Services réseaux |
- | * La Section Monitor | + | * xinetd |
- | * La Section Device | + | * TCP Wrapper |
- | * La Section Screen | + | |
- | * La Commande xwininfo | + | |
- | * La Commande xdpyinfo | + | * Activer/ |
- | * L' | + | * Configuration du Réseau sous RHEL/CentOS 7 |
- | * Le Clavier et la Souris | + | * La Commande nmcli |
- | * Claviers Visuels | + | * Connections et Profils |
- | * L'Ecran | + | * Ajouter une Deuxième Adresse IP à un Profil |
- | * Autres Technologies | + | * La Commande hostname |
+ | * La Commande ip | ||
+ | | ||
+ | * Routage Statique | ||
+ | | ||
+ | * Activer/ | ||
+ | * Diagnostique du Réseau | ||
+ | * ping | ||
+ | * netstat -i | ||
+ | * traceroute | ||
+ | * Connexions à Distance | ||
+ | * Telnet | ||
+ | * wget | ||
+ | | ||
+ | * SSH | ||
+ | * Introduction | ||
+ | * SSH-1 | ||
+ | * SSH-2 | ||
+ | | ||
+ | * L' | ||
+ | * Installation | ||
+ | * Configuration | ||
+ | * Serveur | ||
+ | * Utilisation | ||
+ | * Tunnels SSH | ||
+ | * SCP | ||
+ | * Introduction | ||
+ | * Utilisation | ||
+ | * Mise en place des clefs | ||
- | =====X Window System===== | + | =====Configuration du Réseau sous RHEL/CentOS 5 et 6===== |
- | L' | + | ==== Configuration |
- | | + | La configuration TCP/IP se trouve dans le répertoire |
- | | + | |
- | | + | |
- | | + | |
- | * etc. | + | |
- | **X** est une application client/ | + | === DHCP === |
- | Il existe trois versions de X : | + | == / |
- | * **[[http:// | + | < |
- | * un logiciel libre utilisé par la majorité des distributions jusqu' | + | [root@centos6 ~]# cat /etc/sysconfig/network |
- | * **[[http://www.x.org/wiki/ | + | NETWORKING=yes |
- | * un logiciel libre utilisé depuis les modifications de la licence de XFree86 en 2004. La version 6.7.0 était basé sur la version 4.3.99 de XFree86. Depuis le développement est indépendant de son prédécesseur. | + | HOSTNAME=centos6 |
- | * **[[http:// | + | </code> |
- | * un logiciel commercial édité par la société **Xi Graphics** possedant sa propre base de pilotes graphiques. | + | |
- | ====Configuration==== | + | Dans ce fichier vous pouvez constater les directives suivantes : |
- | IL existe plusieurs outils pour configurer | + | ^ Directive ^ Description ^ |
+ | | NETWORKING | Indique que la prise en charge du réseau est activée | | ||
+ | | HOSTNAME | Indique | ||
- | * **XFree86 configure** est la commande utilisé pour configurer un serveur X basé sur XFree86 4.x. Cette commande produit le fichier | + | Ce fichier peut également contenir les directives suivantes : |
- | * **Xorg configure** est la commande utilisé pour configurer un serveur X basé sur X.orgX11. Cette commande produit le fichier **/ | + | |
- | <WRAP center round important> | + | ^ Directive ^ Description ^ |
- | **Important** : Ces deux commandes doivent être utilisées quand le serveur X est arrêté. | + | | GATEWAY | Indique l' |
+ | | GATEWAYDEV | Indique l' | ||
+ | | NISDOMAIN | Indique le domaine NIS s'il en existe un | | ||
+ | | NETWORKING_IPV6 | Active ou désactive le support IPv6 | | ||
+ | |||
+ | ==/ | ||
+ | |||
+ | **ifcfg-eth0** | ||
+ | |||
+ | < | ||
+ | [root@centos6 ~]# cat / | ||
+ | DEVICE=" | ||
+ | NM_CONTROLLED=" | ||
+ | ONBOOT=yes | ||
+ | TYPE=Ethernet | ||
+ | BOOTPROTO=dhcp | ||
+ | DEFROUTE=yes | ||
+ | IPV4_FAILURE_FATAL=yes | ||
+ | IPV6INIT=no | ||
+ | NAME=" | ||
+ | UUID=5fb06bd0-0bb0-7ffb-45f1-d6edd65f3e03 | ||
+ | HWADDR=08: | ||
+ | PEERDNS=yes | ||
+ | PEERROUTES=yes | ||
+ | </ | ||
+ | |||
+ | Dans ce fichier vous pouvez constater les directives suivantes : | ||
+ | |||
+ | ^ Directive ^ Description ^ | ||
+ | | DEVICE | Indique le nom de l' | ||
+ | | NM_CONTROLLED | Indique que le service NetworkManager est utilisé pour gérer les interfaces réseau | | ||
+ | | ONBOOT | Indique que l' | ||
+ | | TYPE | Indique que le type de réseau est ethernet. | ||
+ | | BOOTPROTO | Indique comment monter l' | ||
+ | | DEFROUTE | Définit l' | ||
+ | | 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' | ||
+ | | IPV6INIT | Indique que le support IPv6 ne sera pas initialisé | | ||
+ | | NAME | Indique un nom descriptif de l' | ||
+ | | UUID | Indique la valeur de l'UUID de l' | ||
+ | | HWADDR | Indique l' | ||
+ | | PEERDNS |Indique que le fichier / | ||
+ | |||
+ | |||
+ | <WRAP center round todo> | ||
+ | Recherchez la définition de la directive | ||
</ | </ | ||
- | Deux outils qui ne bénéficient plus de support sont **xf86cfg** et **xorgcfg** sont parfois présents dans la distribution et peuvent être utilisés pour configurer le serveur X. | + | === IP Fixe === |
- | Dernièrement il existe des outils spécifiques à une distribution : | + | == / |
- | * Red Hat, CentOS, Fedora : **system-config-display**. | + | < |
+ | NETWORKING=yes | ||
+ | NETWORKING_IPV6=no | ||
+ | HOSTNAME=centos6.fenestros.loc | ||
+ | </ | ||
+ | |||
+ | ==/ | ||
+ | |||
+ | **ifcfg-eth0** | ||
+ | |||
+ | < | ||
+ | DEVICE=" | ||
+ | NM_CONTROLLED=" | ||
+ | ONBOOT=yes | ||
+ | TYPE=Ethernet | ||
+ | BOOTPROTO=static | ||
+ | IPV6INIT=no | ||
+ | HWADDR=" | ||
+ | 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 | ||
+ | </ | ||
+ | |||
+ | Dans ce fichier vous pouvez constater les nouvelles directives suivantes : | ||
+ | |||
+ | ^ Directive ^ Description ^ | ||
+ | | NETMASK | Indique le masque de sous-réseau IPv4 associé à l' | ||
+ | | IPADDR | Indique l' | ||
+ | | GATEWAY | ||
+ | | DNS1 | Indique le DNS primaire | | ||
+ | | DNS2 | Indique le DNS secondaire | | ||
+ | | DOMAIN | ||
+ | | USERCTL | Indique que les utilisateurs normaux peuvent activer/ | ||
<WRAP center round important> | <WRAP center round important> | ||
- | **Important** : Les outils disponibles pour le serveur XFree86 version 3.3.6 et antérieure était **xf86config**, | + | Notez que %%VirtualBox%% fournit une passerelle par défaut ( 10.0.2.2 ). |
</ | </ | ||
- | Les fichiers | + | Après avoir modifier les deux fichiers |
- | * **[[http:// | + | < |
- | * **/ | + | [root@centos6 ~]# service NetworkManager stop |
- | | + | Arrêt du démon NetworkManager : |
- | * **/ | + | [root@centos6 ~]# chkconfig --del NetworkManager |
- | * **[[http:// | + | [root@centos6 ~]# service network start |
- | * **/ | + | Activation de l' |
+ | Activation de l' | ||
+ | [root@centos6 ~]# | ||
+ | </code> | ||
- | =====Gestionnaire de Fenêtres===== | ||
- | **X** ne doit être confondue avec un **Gestionnaire de Fenêtres** (//Window Manager//). Le Gestionnaire de Fenêtres est responsable de la mise en page des élements fournis pas **X**. C'est pour cette raison que sous Linux il existe de nombreux Gestionnaires différents tels : | + | ====La Commande hostname==== |
- | | + | Lors du passage à une configuration en IPv4 fixe vous avez modifié la directive |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | Les Gestionnaires les plus connus sont : | + | < |
+ | [root@centos6 ~]# hostname | ||
+ | centos6 | ||
+ | [root@centos6 ~]# hostname centos6.fenestros.loc | ||
+ | [root@centos6 ~]# hostname | ||
+ | centos6.fenestros.loc | ||
+ | </ | ||
- | * **KDE** (//Kool Desktop Environment// | + | Pour afficher le FQDN du système vous pouvez également utiliser la commande suivante : |
- | * **GNOME** (//Gnu Network Object Model Environment// | + | |
- | =====Toolkits===== | + | < |
+ | [root@centos6 ~]# uname -n | ||
+ | centos6.fenestros.loc | ||
+ | </ | ||
- | Chaque Gestionnaire utilise une bibliothèque graphique contenant des fonctions " | + | ===Options de la commande hostname=== |
- | Une bibliothèque complète est appelée un **Widget Toolkit**. Le Toolkit le plus connu est **MOTIF**. Cependant **MOTIF** n'est pas libre. Pour cette raison les développeurs | + | Les options |
- | Comme dans beaucoup de cas de développement sous Linux, il existe plusieurs Toolkits dont les deux les plus connus sont : | + | < |
+ | [root@centos6 ~]# hostname --help | ||
+ | Syntaxe | ||
+ | | ||
+ | | ||
+ | | ||
- | * **GTK** (//GIMP Toolkit//), programé en langage C et embarqué par défaut dans le Gestionnaire de Fenêtres **Gnome**, | + | |
- | * **QT** (//Cute//), programé en langage C++ et embarqué par défaut dans le Gestionnaire de Fenêtres **KDE**. | + | |
- | =====Freedesktop===== | + | dnsdomainname=hostname -d, {yp, |
- | Afin d'assurer la possibilité | + | -s, --short |
+ | -a, --alias | ||
+ | | ||
+ | -f, --fqdn, --long | ||
+ | -d, --domain | ||
+ | -y, --yp, --nis nom de domaine NIS/YP | ||
+ | -F, --file | ||
- | =====Display Manager===== | + | This command can read or set the hostname or the NIS domainname. You can |
+ | also read the DNS domain or the FQDN (fully qualified domain name). | ||
+ | | ||
+ | FQDN (Fully Qualified Domain Name) and the DNS domain name (which is | ||
+ | part of the FQDN) in the /etc/hosts file. | ||
+ | </ | ||
- | Le **Display Manager** est chargé de gérer les connexions locales et à distance, les authentifications et les ouvertures de sessions. De ce fait, Le Display Manager est l' | + | ====La Commande ifconfig==== |
- | Pour les connexions à distance le Display Manager utilise le protocole **XDMCP** (//X Display Manager Control Panel//)). Le fichier de configuration de XDMCP est **/ | + | Pour afficher la configuration |
- | ====XDM, GDM et KDM==== | + | < |
+ | [root@centos6 ~]# ifconfig | ||
+ | eth0 Link encap: | ||
+ | inet adr: | ||
+ | adr inet6: fe80:: | ||
+ | UP BROADCAST RUNNING MULTICAST | ||
+ | RX packets: | ||
+ | TX packets: | ||
+ | collisions: | ||
+ | RX bytes: | ||
- | Le Display Manager par défaut, compatible avec tous les serveurs **X**, est **XDM**. Les deux autres Display Managers les plus connus sont : | + | lo Link encap: |
+ | inet adr:127.0.0.1 Masque:255.0.0.0 | ||
+ | adr inet6: ::1/128 Scope: | ||
+ | UP LOOPBACK RUNNING | ||
+ | RX packets:8 errors:0 dropped:0 overruns:0 frame:0 | ||
+ | TX packets:8 errors:0 dropped:0 overruns:0 carrier:0 | ||
+ | collisions: | ||
+ | RX bytes:480 (480.0 b) TX bytes:480 (480.0 b) | ||
+ | </ | ||
- | * **GDM** | + | La commande ifconfig est également utilisée |
- | * **KDM** pour KDE, | + | |
- | * **LightDM** de Canonical. | + | |
- | Les deux premiers sont essentiellement des XDM avec des fonctionnalités supplémentaires telles | + | Créez maintenant une interface fictive ainsi : |
- | * le passage d'un utilisateur à un autre, | + | < |
- | * la liste des utilisateurs, | + | [root@centos6 ~]# ifconfig eth0:1 192.168.1.2 netmask 255.255.255.0 broadcast 192.168.1.255 |
- | * le choix d'un gestionnaire de fenêtres, | + | </ |
- | * la possibilité d'une autoconnexion, | + | |
- | * la liste des serveurs **X** distants, | + | |
- | * etc. | + | |
- | ====LightDM==== | + | Constatez maintenant le résultat : |
- | LightDM est un gestionnaire d' | + | < |
+ | [root@centos6 ~]# ifconfig | ||
+ | eth0 Link encap: | ||
+ | inet adr:10.0.2.15 | ||
+ | adr inet6: fe80:: | ||
+ | UP BROADCAST RUNNING MULTICAST | ||
+ | RX packets: | ||
+ | TX packets: | ||
+ | collisions: | ||
+ | RX bytes: | ||
- | * Pas de dépendances de Gnome | + | eth0: |
- | | + | inet adr: |
- | | + | UP BROADCAST RUNNING MULTICAST |
- | Sous RHEL/CentOS 7, LightDM n'est pas installé par défaut et se trouve dans le dépôt EPEL. Installez donc le dépôt | + | lo Link encap: |
+ | inet adr: | ||
+ | adr inet6: ::1/128 Scope: | ||
+ | UP LOOPBACK RUNNING | ||
+ | RX packets:8 errors:0 dropped:0 overruns:0 frame:0 | ||
+ | TX packets:8 errors:0 dropped:0 overruns:0 carrier:0 | ||
+ | collisions: | ||
+ | RX bytes:480 (480.0 b) TX bytes:480 (480.0 b) | ||
+ | </ | ||
+ | |||
+ | ===Options de la commande ifconfig=== | ||
+ | |||
+ | Les options de cette commande sont : | ||
< | < | ||
- | [root@centos7 | + | [root@centos6 |
- | Loaded plugins: fastestmirror, | + | Usage: |
- | Loading mirror speeds from cached hostfile | + | |
- | * base: fr.mirror.babylon.network | + | [add < |
- | * extras: fr.mirror.babylon.network | + | [del < |
- | * updates: fr.mirror.babylon.network | + | [[-]broadcast [< |
- | Resolving Dependencies | + | |
- | --> | + | [outfill <NN>] [keepalive < |
- | ---> Package epel-release.noarch 0:7-6 will be installed | + | [hw <HW> < |
- | --> Finished Dependency Resolution | + | [[-]trailers] |
+ | | ||
+ | [mem_start <NN>] [io_addr < | ||
+ | [txqueuelen < | ||
+ | [[-]dynamic] | ||
+ | [up|down] ... | ||
- | Dependencies Resolved | + | < |
+ | 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' | ||
+ | sit (IPv6-dans-IPv4) fddi (Fiber Distributed Data Interface) hippi (HIPPI) | ||
+ | irda (IrLAP) ec (Econet) x25 (generic X.25) | ||
+ | infiniband (InfiniBand) | ||
+ | < | ||
+ | Liste des familles d' | ||
+ | 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) | ||
+ | </ | ||
- | ================================================================================ | + | ====Activer/ |
- | | + | |
- | ================================================================================ | + | |
- | Installing: | + | |
- | | + | |
- | Transaction Summary | + | Deux commandes existent pour activer et désactiver manuellement une interface réseau : |
- | ================================================================================ | + | |
- | Install | + | |
- | Total download size: 14 k | + | < |
- | Installed size: 24 k | + | [root@centos6 ~]# ifdown eth0 |
- | Downloading packages: | + | [root@centos6 ~]# ifconfig |
- | epel-release-7-6.noarch.rpm | 14 kB 00:01 | + | lo Link encap:Boucle locale |
- | Running transaction check | + | inet adr:127.0.0.1 Masque:255.0.0.0 |
- | Running transaction test | + | adr inet6: ::1/128 Scope:Hôte |
- | Transaction test succeeded | + | UP LOOPBACK RUNNING |
- | Running transaction | + | RX packets:384 errors:0 dropped:0 overruns:0 frame:0 |
- | Installing | + | TX packets:384 errors:0 dropped:0 overruns:0 carrier:0 |
- | | + | collisions: |
+ | RX bytes:32496 (31.7 KiB) TX bytes:32496 (31.7 KiB) | ||
- | Installed: | + | [root@centos6 ~]# ifup eth0 |
- | | + | État de connexion active& |
+ | État de chemin actif& | ||
+ | état& | ||
+ | Connexion activée | ||
+ | [root@centos6 ~]# ifconfig | ||
+ | eth0 Link encap: | ||
+ | inet adr:10.0.2.15 Bcast:10.0.2.255 | ||
+ | adr inet6: fe80:: | ||
+ | UP BROADCAST RUNNING MULTICAST | ||
+ | RX packets:27 errors:0 dropped:0 overruns:0 frame:0 | ||
+ | TX packets:42 errors:0 dropped:0 overruns:0 carrier:0 | ||
+ | collisions: | ||
+ | RX bytes:4271 (4.1 KiB) TX bytes:6145 (6.0 KiB) | ||
- | Complete! | + | lo Link encap: |
+ | inet adr: | ||
+ | adr inet6: ::1/128 Scope: | ||
+ | UP LOOPBACK RUNNING | ||
+ | RX packets:392 errors:0 dropped:0 overruns:0 frame:0 | ||
+ | TX packets:392 errors:0 dropped:0 overruns:0 carrier:0 | ||
+ | collisions: | ||
+ | RX bytes:33600 (32.8 KiB) TX bytes:33600 (32.8 KiB) | ||
</ | </ | ||
- | Installez ensuite LightDM | + | ===/ |
+ | |||
+ | Ce fichier contient la correspondance entre des noms de réseaux et l' | ||
< | < | ||
- | [root@centos7 | + | [root@centos6 |
- | Loaded plugins: fastestmirror, | + | default 0.0.0.0 |
- | epel/x86_64/metalink | + | loopback 127.0.0.0 |
- | epel | + | link-local 169.254.0.0 |
- | (1/3): epel/x86_64/group_gz | + | </ |
- | (2/3): epel/x86_64/updateinfo | + | |
- | (3/3): epel/x86_64/primary_db | + | === Résolution d' |
+ | |||
+ | La configuration DNS est stockée dans le fichier **/ | ||
+ | |||
+ | |||
+ | == / | ||
+ | |||
+ | La configuration DNS est stockée dans le fichier / | ||
+ | |||
+ | < | ||
+ | [root@centos6 ~]# cat /etc/resolv.conf | ||
+ | # Generated by NetworkManager | ||
+ | |||
+ | |||
+ | # No nameservers found; try putting DNS servers into your | ||
+ | # ifcfg files in / | ||
+ | # | ||
+ | # 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> | ||
+ | |||
+ | <WRAP center round important> | ||
+ | Notez que les DNS utilisés sont les serveurs DNS publics de Google. | ||
+ | </ | ||
+ | |||
+ | |||
+ | ==/ | ||
+ | |||
+ | L' | ||
+ | |||
+ | < | ||
+ | [root@centos6 ~]# grep ' | ||
+ | hosts: files dns | ||
+ | </code> | ||
+ | |||
+ | == /etc/hosts == | ||
+ | |||
+ | Le mot **files** dans la sortie de la commande précédente fait référence au fichier **/ | ||
+ | |||
+ | < | ||
+ | [root@centos6 ~]# cat /etc/hosts | ||
+ | 10.0.2.15 centos6 # | ||
+ | 127.0.0.1 localhost.localdomain localhost | ||
+ | :: | ||
+ | </code> | ||
+ | |||
+ | Pour tester le serveur DNS, deux commandes sont possibles : | ||
+ | |||
+ | < | ||
+ | [root@centos6 ~]# nslookup www.i2tch.com | ||
+ | Server: | ||
+ | Address: | ||
+ | |||
+ | Non-authoritative answer: | ||
+ | www.i2tch.com canonical name = i2tch.com. | ||
+ | Name: | ||
+ | Address: 90.119.37.144 | ||
+ | |||
+ | [root@centos6 ~]# dig www.i2tch.com | ||
+ | |||
+ | ; <<>> | ||
+ | ;; global options: +cmd | ||
+ | ;; Got answer: | ||
+ | ;; ->> | ||
+ | ;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 1 | ||
+ | |||
+ | ;; OPT PSEUDOSECTION: | ||
+ | ; EDNS: version: 0, flags:; udp: 65494 | ||
+ | ;; QUESTION SECTION: | ||
+ | ; | ||
+ | |||
+ | ;; 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# | ||
+ | ;; WHEN: Mon Jan 22 18:00:27 CET 2018 | ||
+ | ;; MSG SIZE rcvd: 72 | ||
+ | </code> | ||
+ | |||
+ | ==== 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' | ||
+ | |||
+ | === xinetd === | ||
+ | |||
+ | Sous RHEL/CentOS 6 xinetd n'est pas installé par défaut. Installez-le grâce à yum : | ||
+ | |||
+ | < | ||
+ | [root@centos6 ~]# yum install xinetd | ||
+ | Loaded plugins: fastestmirror, | ||
Loading mirror speeds from cached hostfile | Loading mirror speeds from cached hostfile | ||
- | * base: fr.mirror.babylon.network | + | * base: fr2.rpmfind.net |
- | * epel: mirrors.ircam.fr | + | * extras: |
- | * extras: | + | * updates: |
- | * updates: | + | Setting up Install Process |
Resolving Dependencies | Resolving Dependencies | ||
--> Running transaction check | --> Running transaction check | ||
- | ---> Package | + | ---> Package |
- | --> Processing Dependency: lightdm-greeter = 1.2 for package: lightdm-1.10.6-4.el7.x86_64 | + | |
- | --> Processing Dependency: lightdm-gobject(x86-64) = 1.10.6-4.el7 for package: lightdm-1.10.6-4.el7.x86_64 | + | |
- | --> Running transaction check | + | |
- | ---> Package lightdm-gobject.x86_64 0: | + | |
- | ---> Package lightdm-gtk.x86_64 0: | + | |
- | --> Processing Dependency: lightdm-gtk-common = 1.8.5-19.el7 for package: lightdm-gtk-1.8.5-19.el7.x86_64 | + | |
- | --> Running transaction check | + | |
- | ---> Package lightdm-gtk-common.noarch 0:1.8.5-19.el7 will be installed | + | |
--> Finished Dependency Resolution | --> Finished Dependency Resolution | ||
Ligne 236: | Ligne 509: | ||
================================================================================ | ================================================================================ | ||
- | | + | |
================================================================================ | ================================================================================ | ||
Installing: | Installing: | ||
- | lightdm | + | xinetd |
- | Installing for dependencies: | + | |
- | | + | |
- | | + | |
- | | + | |
Transaction Summary | Transaction Summary | ||
================================================================================ | ================================================================================ | ||
- | Install | + | Install |
+ | Upgrade | ||
- | Total download size: 362 k | + | Total download size: 121 k |
- | Installed size: 970 k | + | Installed size: 258 k |
- | Downloading packages: | + | Is this ok [y/N]: y |
- | warning: / | + | Downloading Packages: |
- | Public key for lightdm-1.10.6-4.el7.x86_64.rpm is not installed | + | xinetd-2.3.14-33.el6.i686.rpm | 121 kB |
- | (1/4): lightdm-1.10.6-4.el7.x86_64.rpm | + | Running |
- | (2/4): lightdm-gobject-1.10.6-4.el7.x86_64.rpm | + | Running |
- | (3/4): lightdm-gtk-1.8.5-19.el7.x86_64.rpm | + | Transaction |
- | (4/4): lightdm-gtk-common-1.8.5-19.el7.noarch.rpm | + | Running |
- | -------------------------------------------------------------------------------- | + | Installing |
- | Total 179 kB/s | 362 kB 00:02 | + | |
- | Retrieving key from file:/// | + | |
- | Importing GPG key 0x352C64E5: | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | Running | + | |
- | Running | + | |
- | Transaction | + | |
- | Running | + | |
- | Installing : lightdm-gobject-1.10.6-4.el7.x86_64 | + | |
- | Installing | + | |
- | Installing : lightdm-1.10.6-4.el7.x86_64 | + | |
- | Installing : lightdm-gtk-1.8.5-19.el7.x86_64 | + | |
- | Verifying | + | |
- | Verifying | + | |
- | Verifying | + | |
- | Verifying | + | |
Installed: | Installed: | ||
- | | + | |
- | + | ||
- | Dependency Installed: | + | |
- | lightdm-gobject.x86_64 0: | + | |
Complete! | Complete! | ||
</ | </ | ||
- | Le fichier | + | Le programme xinetd est configuré via le fichier **/etc/xinetd.conf** : |
< | < | ||
- | [root@centos7 | + | [root@centos6 |
# | # | ||
- | # General | + | # This is the master xinetd |
+ | # 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. | ||
# | # | ||
- | # start-default-seat | + | # enabled = |
- | # greeter-user | + | # disabled = |
- | # minimum-display-number = Minimum display number to use for X servers | + | |
- | # minimum-vt = First VT to run displays on | + | # Define general logging characteristics. |
- | # lock-memory = True to prevent memory from being paged to disk | + | log_type = SYSLOG daemon info |
- | # user-authority-in-system-dir = True if session authority should be in the system location | + | log_on_failure = HOST |
- | # guest-account-script = Script to be run to setup guest account | + | log_on_success = PID HOST DURATION EXIT |
- | # logind-load-seats = True to automatically set up multi-seat configuration from logind | + | |
- | # logind-check-graphical = True to on start seats that are marked as graphical by logind | + | |
- | # log-directory = Directory to log information to | + | |
- | # run-directory = Directory to put running state in | + | |
- | # cache-directory = Directory to cache to | + | |
- | # sessions-directory = Directory to find sessions | + | |
- | # remote-sessions-directory = Directory to find remote sessions | + | |
- | # greeters-directory = Directory to find greeters | + | |
- | # backup-logs = True to move add a .old suffix to old log files when opening new ones | + | |
- | # | + | |
- | [LightDM] | + | |
- | # | + | |
- | # | + | |
- | # | + | |
- | minimum-vt=1 | + | |
- | # | + | |
- | user-authority-in-system-dir=true | + | |
- | # | + | |
- | # | + | |
- | # | + | |
- | # | + | |
- | # | + | |
- | # | + | |
- | # | + | |
- | # | + | |
- | # | + | |
- | # | + | |
+ | # Define access restriction defaults | ||
# | # | ||
- | # Seat defaults | + | # no_access = |
- | # | + | # only_from = |
- | # type = Seat type (xlocal, xremote) | + | # max_load = 0 |
- | # xdg-seat | + | cps = 50 10 |
- | # pam-service = PAM service to use for login | + | instances = 50 |
- | # pam-autologin-service = PAM service to use for autologin | + | per_source = 10 |
- | # pam-greeter-service = PAM service to use for greeters | + | |
- | # xserver-command = X server command to run (can also contain arguments e.g. X -special-option) | + | |
- | # xmir-command = Xmir server command to run (can also contain arguments e.g. Xmir -special-option) | + | |
- | # xserver-layout = Layout to pass to X server | + | |
- | # xserver-config = Config file to pass to X server | + | |
- | # xserver-allow-tcp = True if TCP/IP connections are allowed to this X server | + | |
- | # xserver-share = True if the X server is shared for both greeter and session | + | |
- | # xserver-hostname = Hostname of X server (only for type=xremote) | + | |
- | # xserver-display-number = Display number of X server (only for type=xremote) | + | |
- | # xdmcp-manager = XDMCP manager to connect to (implies xserver-allow-tcp=true) | + | |
- | # xdmcp-port = XDMCP UDP/IP port to communicate on | + | |
- | # xdmcp-key = Authentication key to use for XDM-AUTHENTICATION-1 (stored in keys.conf) | + | |
- | # unity-compositor-command = Unity compositor command to run (can also contain arguments e.g. unity-system-compositor -special-option) | + | |
- | # unity-compositor-timeout = Number of seconds to wait for compositor to start | + | |
- | # greeter-session = Session to load for greeter | + | |
- | # greeter-hide-users = True to hide the user list | + | |
- | # greeter-allow-guest = True if the greeter should show a guest login option | + | |
- | # greeter-show-manual-login = True if the greeter should offer a manual login option | + | |
- | # greeter-show-remote-login = True if the greeter should offer a remote login option | + | |
- | # user-session = Session to load for users | + | |
- | # allow-user-switching = True if allowed to switch users | + | |
- | # allow-guest = True if guest login is allowed | + | |
- | # guest-session = Session to load for guests (overrides user-session) | + | |
- | # session-wrapper = Wrapper script to run session with | + | |
- | # greeter-wrapper = Wrapper script to run greeter with | + | |
- | # guest-wrapper = Wrapper script to run guest sessions with | + | |
- | # display-setup-script = Script to run when starting a greeter session (runs as root) | + | |
- | # display-stopped-script = Script to run after stopping the display server (runs as root) | + | |
- | # greeter-setup-script = Script to run when starting a greeter (runs as root) | + | |
- | # session-setup-script = Script to run when starting a user session (runs as root) | + | |
- | # session-cleanup-script = Script to run when quitting a user session (runs as root) | + | |
- | # autologin-guest = True to log in as guest by default | + | |
- | # autologin-user = User to log in with by default (overrides autologin-guest) | + | |
- | # autologin-user-timeout = Number of seconds to wait before loading default user | + | |
- | # autologin-session = Session to load for automatic login (overrides user-session) | + | |
- | # autologin-in-background = True if autologin session should not be immediately activated | + | |
- | # exit-on-failure = True if the daemon should exit if this seat fails | + | |
- | # | + | |
- | [SeatDefaults] | + | |
- | # | + | |
- | # | + | |
- | # | + | |
- | # | + | |
- | # | + | |
- | xserver-command=X -background none | + | |
- | # | + | |
- | # | + | |
- | # | + | |
- | # | + | |
- | # | + | |
- | # | + | |
- | # | + | |
- | # | + | |
- | # | + | |
- | # | + | |
- | # | + | |
- | # | + | |
- | greeter-session=lightdm-greeter | + | |
- | # | + | |
- | # | + | |
- | # | + | |
- | # | + | |
- | # | + | |
- | # | + | |
- | # | + | |
- | # | + | |
- | session-wrapper=/ | + | |
- | # | + | |
- | # | + | |
- | # | + | |
- | # | + | |
- | # | + | |
- | # | + | |
- | # | + | |
- | # | + | |
- | # | + | |
- | # | + | |
- | # | + | |
- | # | + | |
- | # | + | |
+ | # Address and networking defaults | ||
# | # | ||
- | # Seat configuration | + | # bind = |
- | # | + | # mdns = yes |
- | # Each seat must start with " | + | v6only = no |
- | # Uses settings from [SeatDefaults], | + | |
- | # | + | |
- | #[Seat:0] | + | |
+ | # setup environmental attributes | ||
# | # | ||
- | # XDMCP Server configuration | + | # passenv = |
- | # | + | groups = yes |
- | # enabled = True if XDMCP connections should be allowed | + | umask = 002 |
- | # port = UDP/IP port to listen for connections on | + | |
- | # listen-address = Host/ | + | |
- | # key = Authentication key to use for XDM-AUTHENTICATION-1 or blank to not use authentication (stored in keys.conf) | + | |
- | # | + | |
- | # The authentication key is a 56 bit DES key specified in hex as 0xnnnnnnnnnnnnnn. | + | |
- | # it can be a word and the first 7 characters are used as the key. | + | |
- | # | + | |
- | [XDMCPServer] | + | |
- | # | + | |
- | #port=177 | + | |
- | # | + | |
- | #key= | + | |
+ | # Generally, banners are not used. This sets up their global defaults | ||
# | # | ||
- | # VNC Server configuration | + | # banner = |
- | # | + | # banner_fail = |
- | # enabled | + | # banner_success = |
- | # command | + | } |
- | # port = TCP/IP port to listen for connections on | + | |
- | # listen-address = Host/ | + | includedir / |
- | # width = Width of display to use | + | |
- | # height = Height of display to use | + | |
- | # depth = Color depth of display to use | + | |
- | # | + | |
- | [VNCServer] | + | |
- | # | + | |
- | # | + | |
- | # | + | |
- | # | + | |
- | # | + | |
- | # | + | |
- | #depth=8 | + | |
</ | </ | ||
- | La configuration | + | Les valeurs des directives dans le fichier **/ |
+ | |||
+ | Les variables les plus importantes dans **/ | ||
+ | |||
+ | ^ Directive | ||
+ | | instances | ||
+ | | log_type | ||
+ | | log_on_succes | ||
+ | | log_on_failure | ||
+ | | cps | Indique 50 connexions par seconde avec un temps d' | ||
+ | |||
+ | Les options concernant les journaux sont : | ||
+ | |||
+ | | HOST | Journalisation de l' | ||
+ | | PID | Journalisation du PID du processus qui reçoit la demande d' | ||
+ | | DURATION | ||
+ | | EXIT | Journalisation de l' | ||
+ | |||
+ | Il est aussi possible de trouver les options suivantes pour les journaux : | ||
+ | |||
+ | | ATTEMPT | ||
+ | | USERID | ||
+ | |||
+ | Examinons maintenant le répertoire | ||
< | < | ||
- | [root@centos7 | + | [root@centos6 |
- | # | + | total 52 |
- | # background = Background file to use, either an image path or a color (e.g. #772953) | + | -rw-------. 1 root root 1157 7 déc. 22:07 chargen-dgram |
- | # theme-name = GTK+ theme to use | + | -rw-------. 1 root root 1159 7 déc. 22:07 chargen-stream |
- | # icon-theme-name = Icon theme to use | + | -rw-r--r--. 1 root root 523 25 juin 2011 cvs |
- | # font-name = Font to use | + | -rw-------. 1 root root 1157 7 déc. 22:07 daytime-dgram |
- | # xft-antialias = Whether to antialias Xft fonts (true or false) | + | -rw-------. 1 root root 1159 7 déc. 22:07 daytime-stream |
- | # xft-dpi = Resolution for Xft in dots per inch (e.g. 96) | + | -rw-------. 1 root root 1157 7 déc. 22:07 discard-dgram |
- | # xft-hintstyle = What degree of hinting to use (none, slight, medium, or hintfull) | + | -rw-------. 1 root root 1159 7 déc. 22:07 discard-stream |
- | # xft-rgba = Type of subpixel antialiasing (none, rgb, bgr, vrgb or vbgr) | + | -rw-------. 1 root root 1148 7 déc. 22:07 echo-dgram |
- | # show-indicators = semi-colon ";" | + | -rw-------. 1 root root 1150 7 déc. 22:07 echo-stream |
- | # show-clock (true or false) | + | -rw-r--r--. 1 root root 332 20 mai 2009 rsync |
- | # clock-format = strftime-format string, e.g. %H:%M | + | -rw-------. 1 root root 1212 7 déc. 22:07 tcpmux-server |
- | # keyboard = command to launch on-screen keyboard | + | -rw-------. 1 root root 1149 7 déc. 22:07 time-dgram |
- | # position = main window position: x y | + | -rw-------. 1 root root 1150 7 déc. 22:07 time-stream |
- | # default-user-image = Image used as default user icon, path or #icon-name | + | |
- | # screensaver-timeout = Timeout (in seconds) until the screen blanks when the greeter is called as lockscreen | + | |
- | # | + | |
- | [greeter] | + | |
- | background=/ | + | |
- | #theme-name= | + | |
- | #icon-theme-name= | + | |
- | #font-name= | + | |
- | #xft-antialias= | + | |
- | #xft-dpi= | + | |
- | #xft-hintstyle= | + | |
- | #xft-rgba= | + | |
- | #show-indicators= | + | |
- | #show-clock= | + | |
- | #clock-format= | + | |
- | # | + | |
- | # | + | |
- | # | + | |
</ | </ | ||
- | =====X.orgX11===== | + | A l' |
- | ====Présentation==== | + | < |
+ | [root@centos6 ~]# cat / | ||
+ | # default: off | ||
+ | # description: | ||
+ | # 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 = / | ||
+ | env = HOME=/ | ||
+ | server_args = -f --allow-root=/ | ||
+ | # bind = 127.0.0.1 | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | Les directives principales de ce fichier sont : | ||
+ | |||
+ | ^ Paramètre | ||
+ | | disable | ||
+ | | port | Le numéro de port ou, à défaut, le numéro indiqué pour le service dans le fichier / | ||
+ | | socket_type | ||
+ | | protocol | ||
+ | | 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 | ||
+ | | env | Définit un environnement système | | ||
+ | | server_args | ||
+ | |||
+ | Cependant il est aussi possible d' | ||
+ | |||
+ | ^ Paramètre | ||
+ | | nice | Fixe le niveau de nice entre -19 et +20 | 10 | | ||
+ | | max_load | ||
+ | | bind | Limite le service à l' | ||
+ | | only_from | ||
+ | | no_access | ||
+ | | access_time | ||
+ | | redirect | ||
+ | |||
+ | Afin d' | ||
+ | |||
+ | === TCP Wrapper === | ||
+ | |||
+ | **TCP Wrapper** contrôle l' | ||
+ | |||
+ | Quand une requête arrive pour un serveur, xinetd active le wrapper **tcpd** au lieu d' | ||
+ | |||
+ | **tcpd** met à jour un journal et vérifie si le client a le droit d' | ||
+ | |||
+ | * **/ | ||
+ | * **/ | ||
+ | |||
+ | Il faut noter que si ces fichiers n' | ||
+ | |||
+ | Le format d'une ligne dans un de ces deux fichiers est: | ||
+ | |||
+ | < | ||
+ | démon : liste_de_clients | ||
+ | </ | ||
+ | |||
+ | Par exemple dans le cas d'un serveur **démon**, on verrait une ligne dans le fichier **/ | ||
+ | |||
+ | < | ||
+ | démon : LOCAL, .fenestros.loc | ||
+ | </ | ||
+ | |||
+ | 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 **/ | ||
+ | |||
+ | ====Routage Statique==== | ||
+ | |||
+ | ===La Commande route=== | ||
- | L' | + | Pour afficher la table de routage de la machine vous pouvez utiliser la commande |
< | < | ||
- | [root@centos7 | + | [root@centos6 |
- | Xorg: / | + | Table de routage IP du noyau |
+ | Destination | ||
+ | 192.168.1.0 | ||
+ | 10.0.2.0 | ||
+ | link-local | ||
+ | default | ||
</ | </ | ||
- | Les modules | + | La table issue de la commande |
+ | |||
+ | * La destination qui peut être un hôte ou un réseau et est identifiée | ||
+ | * 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' | ||
+ | * Le champ **Indic** qui peux prendre un ou plusieurs de svaleurs suivantes: | ||
+ | | ||
+ | * 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 | ||
< | < | ||
- | [root@centos7 | + | [root@centos6 |
- | / | + | [root@centos6 ~]# route |
- | total 36 | + | Table de routage IP du noyau |
- | drwxr-xr-x. 5 root root 4096 Jun 4 10:00 modules | + | Destination |
- | -rw-r--r--. 1 root root 31246 Apr 10 2015 protocol.txt | + | 10.0.2.0 |
+ | link-local * 255.255.0.0 | ||
+ | default | ||
+ | </ | ||
- | / | + | Pour ajouter la route vers le réseau 192.168.1.0 : |
- | total 776 | + | |
- | drwxr-xr-x. 2 root root 4096 Jun 4 15:33 drivers | + | |
- | drwxr-xr-x. 2 root root 22 Jun 4 10:00 extensions | + | |
- | drwxr-xr-x. 2 root root 106 Jun 4 10:02 input | + | |
- | -rwxr-xr-x. 1 root root 99568 Apr 10 2015 libexa.so | + | |
- | -rwxr-xr-x. 1 root root 20016 Apr 10 2015 libfbdevhw.so | + | |
- | -rwxr-xr-x. 1 root root 153528 Apr 10 2015 libfb.so | + | |
- | -rwxr-xr-x. 1 root root 19952 Mar 6 2015 libglamoregl.so | + | |
- | -rwxr-xr-x. 1 root root 150992 Apr 10 2015 libint10.so | + | |
- | -rwxr-xr-x. 1 root root 36552 Apr 10 2015 libshadowfb.so | + | |
- | -rwxr-xr-x. 1 root root 36248 Apr 10 2015 libshadow.so | + | |
- | -rwxr-xr-x. 1 root root 28232 Apr 10 2015 libvbe.so | + | |
- | -rwxr-xr-x. 1 root root 33576 Apr 10 2015 libvgahw.so | + | |
- | -rwxr-xr-x. 1 root root 198568 Apr 10 2015 libwfb.so | + | |
- | / | + | < |
- | total 2616 | + | [root@centos6 ~]# route add -net 192.168.1.0 netmask 255.255.255.0 gw 192.168.1.2 |
- | -rwxr-xr-x. 1 root root 11296 Mar 6 2015 ati_drv.so | + | [root@centos6 ~]# route |
- | -rwxr-xr-x. 1 root root 20408 Jun 9 2014 dummy_drv.so | + | Table de routage IP du noyau |
- | -rwxr-xr-x. 1 root root 24648 Jun 10 2014 fbdev_drv.so | + | Destination |
- | -rwxr-xr-x. 1 root root 1501152 Mar 6 2015 intel_drv.so | + | 192.168.1.0 |
- | -rwxr-xr-x. 1 root root 50472 Jun 9 2014 modesetting_drv.so | + | 10.0.2.0 * |
- | -rwxr-xr-x. 1 root root 211080 Jun 10 2014 nouveau_drv.so | + | link-local * 255.255.0.0 |
- | -rwxr-xr-x. 1 root root 181560 Mar 11 2015 qxl_drv.so | + | default |
- | -rwxr-xr-x. 1 root root 438848 Mar 6 2015 radeon_drv.so | + | </code> |
- | -rwxr-xr-x. 1 root root 24216 Jun 9 2014 v4l_drv.so | + | |
- | lrwxrwxrwx. 1 root root 50 Jun 4 15:33 vboxvideo_drv.so -> /usr/lib64/VBoxGuestAdditions/vboxvideo_drv_115.so | + | <WRAP center round important> |
- | -rwxr-xr-x. 1 root root 28936 Jun 10 2014 vesa_drv.so | + | La commande utilisée pour ajouter une passerelle par défaut prend la forme suivante **route add default gw //numéro_ip// // |
- | -rwxr-xr-x. 1 root root 162008 Mar 6 2015 vmware_drv.so | + | </ |
+ | |||
+ | Les options cette commande sont : | ||
+ | |||
+ | < | ||
+ | [root@centos6 ~]# route --help | ||
+ | Syntaxe: route [-nNvee] [-FC] [< | ||
+ | route [-v] [-FC] {add|del|flush} ... | ||
+ | |||
+ | route {-h|--help} [< | ||
+ | route {-V|--version} | ||
- | /usr/ | + | -v, --verbose |
- | total 296 | + | -n, --numeric |
- | -rwxr-xr-x. 1 root root 302520 Apr 10 2015 libglx.so | + | -e, --extend |
+ | -F, --fib display Forwarding Information Base (default) | ||
+ | -C, --cache affiche le cache de routage au lieu de FIB | ||
- | / | + | < |
- | total 276 | + | |
- | -rwxr-xr-x. 1 root root 58776 Jun 10 2014 evdev_drv.so | + | inet (DARPA Internet) inet6 (IPv6) ax25 (AMPR AX.25) |
- | -rwxr-xr-x. 1 root root 70464 Mar 6 2015 synaptics_drv.so | + | |
- | -rwxr-xr-x. 1 root root 20144 Jun 10 2014 vmmouse_drv.so | + | x25 (CCITT X.25) |
- | -rwxr-xr-x. 1 root root 11440 Jun 10 2014 void_drv.so | + | |
- | -rwxr-xr-x. 1 root root 113864 Jun 10 2014 wacom_drv.so | + | |
</ | </ | ||
- | Sous RHEL/CentOS 7 les paquets X.orgX11 installés peuvent être trouvés en utilisant | + | Vous pouvez aussi utiliser |
< | < | ||
- | [root@centos7 | + | [root@centos6 |
- | xorg-x11-drv-intel-2.99.916-5.el7.x86_64 | + | Table de routage IP du noyau |
- | xorg-x11-fonts-Type1-7.5-9.el7.noarch | + | Destination |
- | abrt-addon-xorg-2.1.11-19.el7.centos.0.3.x86_64 | + | 192.168.1.0 192.168.1.2 255.255.255.0 UG |
- | xorg-x11-utils-7.5-13.1.el7.x86_64 | + | 192.168.1.0 0.0.0.0 |
- | xorg-x11-drv-void-1.4.0-23.el7.x86_64 | + | 10.0.2.0 0.0.0.0 |
- | xorg-x11-drv-dummy-0.3.6-15.el7.x86_64 | + | 0.0.0.0 |
- | xorg-x11-drv-fbdev-0.4.3-15.el7.x86_64 | + | |
- | xorg-x11-drv-evdev-2.8.2-5.el7.x86_64 | + | |
- | xorg-x11-glamor-0.6.0-2.20140918git347ef4f.el7.x86_64 | + | |
- | xorg-x11-drv-qxl-0.1.1-12.el7.x86_64 | + | |
- | xorg-x11-server-utils-7.7-4.el7.x86_64 | + | |
- | xorg-x11-drivers-7.7-6.el7.x86_64 | + | |
- | xorg-x11-drv-modesetting-0.8.0-13.el7.x86_64 | + | |
- | xorg-x11-xinit-1.3.2-14.el7.x86_64 | + | |
- | xorg-x11-drv-ati-7.4.0-1.20140918git56c7fb8.el7.x86_64 | + | |
- | xorg-x11-xauth-1.0.7-6.1.el7.x86_64 | + | |
- | xorg-x11-drv-vesa-2.3.2-14.el7.x86_64 | + | |
- | xorg-x11-font-utils-7.5-18.1.el7.x86_64 | + | |
- | xorg-x11-server-common-1.15.0-33.el7_1.x86_64 | + | |
- | xorg-x11-drv-vmware-13.0.2-1.el7.x86_64 | + | |
- | xorg-x11-drv-vmmouse-13.0.0-10.el7.x86_64 | + | |
- | xorg-x11-server-Xorg-1.15.0-33.el7_1.x86_64 | + | |
- | xorg-x11-drv-wacom-0.23.0-6.el7.x86_64 | + | |
- | xorg-x11-drv-nouveau-1.0.10-5.el7.x86_64 | + | |
- | xorg-x11-drv-synaptics-1.7.1-13.el7.x86_64 | + | |
- | xorg-x11-xkb-utils-7.7-9.1.el7.x86_64 | + | |
- | xorg-x11-drv-v4l-0.2.0-35.el7.x86_64 | + | |
</ | </ | ||
- | ====Démarrage et Arrêt==== | + | La table issue de la commande **netstat -nr** indique les informations suivantes: |
- | Les distributions RHEL ont historiquement utilisés les niveaux d' | + | |
+ | | ||
+ | | ||
- | ====Utilisation==== | + | ===Activer/ |
- | Pour interagir avec et contrôler X.orgX11, un utilisateur dispose de plusieurs raccourcis claviers | + | Pour activer le routage sur le serveur, il convient d' |
- | ^ Raccourci | + | <code> |
- | | <key>Ctrl</ | + | [root@centos6 ~]# echo 1 > /proc/sys/net/ |
- | | < | + | [root@centos6 ~]# cat /proc/ |
- | | <key>Ctrl</key> | + | 1 |
+ | </code> | ||
+ | |||
+ | Pour désactiver le routage sur le serveur, il convient de désactiver | ||
+ | |||
+ | <code> | ||
+ | [root@centos6 ~]# echo 0 > / | ||
+ | [root@centos6 ~]# cat / | ||
+ | 0 | ||
+ | </code> | ||
+ | |||
+ | =====Configuration du Réseau sous RHEL/CentOS 7===== | ||
+ | |||
+ | RHEL/CentOS 7 utilise exclusivement **Network Manager** pour gérer le réseau. Network Manager | ||
- | ====Configuration==== | + | * 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> | <WRAP center round important> | ||
- | **Important** : Notez que X.orgX11 s'auto-configure. Il est rarement nécessaire | + | **Important** : Notez qu'avec cette version |
</ | </ | ||
- | Un fichier de configuration **/ | + | Le service NetworkManager doit toujours être lancé |
- | <file> | + | <code> |
- | Section " | + | [root@centos7 ~]# systemctl status NetworkManager.service |
- | Identifier | + | ● NetworkManager.service - Network Manager |
- | | + | Loaded: loaded (/ |
- | | + | |
- | EndSection | + | Main PID: 673 (NetworkManager) |
+ | | ||
+ | | ||
+ | └─2673 / | ||
- | Section " | + | Aug 08 11:03:55 centos7.fenestros.loc NetworkManager[673]: |
- | | + | Aug 08 11:03:55 centos7.fenestros.loc NetworkManager[673]: |
- | | + | Aug 08 11:03:55 centos7.fenestros.loc NetworkManager[673]: |
- | | + | Aug 08 11:03:55 centos7.fenestros.loc NetworkManager[673]: |
- | | + | Aug 08 11:03:55 centos7.fenestros.loc NetworkManager[673]: |
- | EndSection | + | Aug 08 11:03:55 centos7.fenestros.loc NetworkManager[673]: |
+ | Aug 08 11:03:55 centos7.fenestros.loc NetworkManager[673]: | ||
+ | Aug 08 11:03:55 centos7.fenestros.loc NetworkManager[673]: | ||
+ | Aug 08 11:03:55 centos7.fenestros.loc NetworkManager[673]: | ||
+ | Aug 08 11:03:55 centos7.fenestros.loc dhclient[2673]: | ||
+ | </ | ||
- | Section " | + | ====La Commande nmcli==== |
- | SubSection " | + | |
- | Depth 24 | + | |
- | EndSubSection | + | |
- | Device | + | |
- | Identifier | + | |
- | Monitor | + | |
- | EndSection | + | |
- | </ | + | |
- | Des applications tierces | + | La commande **nmcli** (Network Manager Command Line Interface) est utilisée pour configurer NetworkManager. |
+ | |||
+ | Les options et les sous-commandes | ||
+ | |||
+ | < | ||
+ | [root@centos7 ~]# nmcli help | ||
+ | Usage: nmcli [OPTIONS] OBJECT { COMMAND | help } | ||
+ | |||
+ | OPTIONS | ||
+ | -t[erse] | ||
+ | -p[retty] | ||
+ | -m[ode] tabular|multiline | ||
+ | -f[ields] < | ||
+ | -e[scape] yes|no | ||
+ | -n[ocheck] | ||
+ | -a[sk] | ||
+ | -w[ait] < | ||
+ | -v[ersion] | ||
+ | -h[elp] | ||
+ | |||
+ | OBJECT | ||
+ | g[eneral] | ||
+ | n[etworking] | ||
+ | r[adio] | ||
+ | c[onnection] | ||
+ | d[evice] | ||
+ | a[gent] | ||
+ | |||
+ | [root@centos7 ~]# nmcli g help | ||
+ | Usage: nmcli general { COMMAND | help } | ||
+ | |||
+ | COMMAND := { status | hostname | permissions | logging } | ||
+ | |||
+ | status | ||
+ | |||
+ | 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. | ||
+ | ' | ||
+ | |||
+ | </ | ||
+ | |||
+ | ====Connections et Profils==== | ||
+ | |||
+ | NetworkManager inclus la notion de **connections** ou **profils** permettant | ||
+ | |||
+ | < | ||
+ | [root@centos7 ~]# nmcli c show | ||
+ | NAME UUID TYPE DEVICE | ||
+ | Wired connection 1 45b701c1-0a21-4d76-a795-2f2bcba86955 | ||
+ | </ | ||
+ | |||
+ | Comme on peut constater ici, il n' | ||
+ | |||
+ | Créez donc un profil IP fixe rattaché au périphérique **enp0s3** : | ||
+ | |||
+ | < | ||
+ | [root@centos7 ~]# nmcli connection add con-name ip_fixe ifname enp0s3 type ethernet ip4 10.0.2.16/ | ||
+ | Connection ' | ||
+ | </ | ||
+ | |||
+ | Constatez sa présence : | ||
+ | |||
+ | < | ||
+ | [root@centos7 ~]# nmcli c show | ||
+ | NAME UUID TYPE DEVICE | ||
+ | ip_fixe | ||
+ | Wired connection 1 45b701c1-0a21-4d76-a795-2f2bcba86955 | ||
+ | </ | ||
+ | |||
+ | Notez que la sortie n' | ||
+ | |||
+ | < | ||
+ | [root@centos7 ~]# nmcli d show | ||
+ | GENERAL.DEVICE: | ||
+ | GENERAL.TYPE: | ||
+ | GENERAL.HWADDR: | ||
+ | GENERAL.MTU: | ||
+ | GENERAL.STATE: | ||
+ | GENERAL.CONNECTION: | ||
+ | GENERAL.CON-PATH: | ||
+ | WIRED-PROPERTIES.CARRIER: | ||
+ | IP4.ADDRESS[1]: | ||
+ | IP4.GATEWAY: | ||
+ | IP4.DNS[1]: | ||
+ | IP6.ADDRESS[1]: | ||
+ | IP6.GATEWAY: | ||
+ | |||
+ | GENERAL.DEVICE: | ||
+ | GENERAL.TYPE: | ||
+ | GENERAL.HWADDR: | ||
+ | GENERAL.MTU: | ||
+ | GENERAL.STATE: | ||
+ | GENERAL.CONNECTION: | ||
+ | GENERAL.CON-PATH: | ||
+ | IP4.ADDRESS[1]: | ||
+ | IP4.GATEWAY: | ||
+ | IP6.ADDRESS[1]: | ||
+ | IP6.GATEWAY: | ||
+ | </ | ||
+ | |||
+ | Pour activer le profil ip_fixe, utilisez la commande suivante : | ||
+ | |||
+ | < | ||
+ | [root@centos7 ~]# nmcli connection up ip_fixe | ||
+ | </ | ||
+ | |||
+ | Le profil ip_fixe est maintenant activé tandis que le profil enp0s3 a été désactivé : | ||
+ | |||
+ | < | ||
+ | [root@centos7 ~]# nmcli c show | ||
+ | NAME UUID TYPE DEVICE | ||
+ | ip_fixe | ||
+ | Wired connection 1 45b701c1-0a21-4d76-a795-2f2bcba86955 | ||
+ | [root@centos7 ~]# nmcli d show | ||
+ | GENERAL.DEVICE: | ||
+ | GENERAL.TYPE: | ||
+ | GENERAL.HWADDR: | ||
+ | GENERAL.MTU: | ||
+ | GENERAL.STATE: | ||
+ | GENERAL.CONNECTION: | ||
+ | GENERAL.CON-PATH: | ||
+ | WIRED-PROPERTIES.CARRIER: | ||
+ | IP4.ADDRESS[1]: | ||
+ | IP4.GATEWAY: | ||
+ | IP6.ADDRESS[1]: | ||
+ | IP6.GATEWAY: | ||
+ | |||
+ | GENERAL.DEVICE: | ||
+ | GENERAL.TYPE: | ||
+ | GENERAL.HWADDR: | ||
+ | GENERAL.MTU: | ||
+ | GENERAL.STATE: | ||
+ | GENERAL.CONNECTION: | ||
+ | GENERAL.CON-PATH: | ||
+ | IP4.ADDRESS[1]: | ||
+ | IP4.GATEWAY: | ||
+ | IP6.ADDRESS[1]: | ||
+ | IP6.GATEWAY: | ||
+ | </ | ||
+ | |||
+ | Pour consulter les paramètres d'un profil, utilisez la commande suivante : | ||
+ | |||
+ | < | ||
+ | [root@centos7 ~]# nmcli -p connection show "Wired connection 1" | ||
+ | =============================================================================== | ||
+ | Connection profile details (Wired connection 1) | ||
+ | =============================================================================== | ||
+ | connection.id: | ||
+ | connection.uuid: | ||
+ | connection.interface-name: | ||
+ | connection.type: | ||
+ | connection.autoconnect: | ||
+ | connection.autoconnect-priority: | ||
+ | connection.timestamp: | ||
+ | connection.read-only: | ||
+ | connection.permissions: | ||
+ | connection.zone: | ||
+ | connection.master: | ||
+ | connection.slave-type: | ||
+ | connection.autoconnect-slaves: | ||
+ | connection.secondaries: | ||
+ | connection.gateway-ping-timeout: | ||
+ | connection.metered: | ||
+ | ------------------------------------------------------------------------------- | ||
+ | 802-3-ethernet.port: | ||
+ | 802-3-ethernet.speed: | ||
+ | 802-3-ethernet.duplex: | ||
+ | 802-3-ethernet.auto-negotiate: | ||
+ | 802-3-ethernet.mac-address: | ||
+ | 802-3-ethernet.cloned-mac-address: | ||
+ | 802-3-ethernet.mac-address-blacklist: | ||
+ | 802-3-ethernet.mtu: | ||
+ | 802-3-ethernet.s390-subchannels: | ||
+ | 802-3-ethernet.s390-nettype: | ||
+ | 802-3-ethernet.s390-options: | ||
+ | 802-3-ethernet.wake-on-lan: | ||
+ | 802-3-ethernet.wake-on-lan-password: | ||
+ | ------------------------------------------------------------------------------- | ||
+ | ipv4.method: | ||
+ | ipv4.dns: | ||
+ | ipv4.dns-search: | ||
+ | ipv4.addresses: | ||
+ | ipv4.gateway: | ||
+ | ipv4.routes: | ||
+ | ipv4.route-metric: | ||
+ | ipv4.ignore-auto-routes: | ||
+ | ipv4.ignore-auto-dns: | ||
+ | ipv4.dhcp-client-id: | ||
+ | ipv4.dhcp-send-hostname: | ||
+ | ipv4.dhcp-hostname: | ||
+ | ipv4.never-default: | ||
+ | ipv4.may-fail: | ||
+ | ------------------------------------------------------------------------------- | ||
+ | ipv6.method: | ||
+ | ipv6.dns: | ||
+ | ipv6.dns-search: | ||
+ | ipv6.addresses: | ||
+ | ipv6.gateway: | ||
+ | ipv6.routes: | ||
+ | ipv6.route-metric: | ||
+ | ipv6.ignore-auto-routes: | ||
+ | ipv6.ignore-auto-dns: | ||
+ | ipv6.never-default: | ||
+ | ipv6.may-fail: | ||
+ | ipv6.ip6-privacy: | ||
+ | ipv6.dhcp-send-hostname: | ||
+ | ipv6.dhcp-hostname: | ||
+ | ------------------------------------------------------------------------------- | ||
+ | [root@centos7 ~]# nmcli -p connection show ip_fixe | ||
+ | =============================================================================== | ||
+ | | ||
+ | =============================================================================== | ||
+ | connection.id: | ||
+ | connection.uuid: | ||
+ | connection.interface-name: | ||
+ | connection.type: | ||
+ | connection.autoconnect: | ||
+ | connection.autoconnect-priority: | ||
+ | connection.timestamp: | ||
+ | connection.read-only: | ||
+ | connection.permissions: | ||
+ | connection.zone: | ||
+ | connection.master: | ||
+ | connection.slave-type: | ||
+ | connection.autoconnect-slaves: | ||
+ | connection.secondaries: | ||
+ | connection.gateway-ping-timeout: | ||
+ | connection.metered: | ||
+ | ------------------------------------------------------------------------------- | ||
+ | 802-3-ethernet.port: | ||
+ | 802-3-ethernet.speed: | ||
+ | 802-3-ethernet.duplex: | ||
+ | 802-3-ethernet.auto-negotiate: | ||
+ | 802-3-ethernet.mac-address: | ||
+ | 802-3-ethernet.cloned-mac-address: | ||
+ | 802-3-ethernet.mac-address-blacklist: | ||
+ | 802-3-ethernet.mtu: | ||
+ | 802-3-ethernet.s390-subchannels: | ||
+ | 802-3-ethernet.s390-nettype: | ||
+ | 802-3-ethernet.s390-options: | ||
+ | 802-3-ethernet.wake-on-lan: | ||
+ | 802-3-ethernet.wake-on-lan-password: | ||
+ | ------------------------------------------------------------------------------- | ||
+ | ipv4.method: | ||
+ | ipv4.dns: | ||
+ | ipv4.dns-search: | ||
+ | ipv4.addresses: | ||
+ | ipv4.gateway: | ||
+ | ipv4.routes: | ||
+ | ipv4.route-metric: | ||
+ | ipv4.ignore-auto-routes: | ||
+ | ipv4.ignore-auto-dns: | ||
+ | ipv4.dhcp-client-id: | ||
+ | ipv4.dhcp-send-hostname: | ||
+ | ipv4.dhcp-hostname: | ||
+ | ipv4.never-default: | ||
+ | ipv4.may-fail: | ||
+ | ------------------------------------------------------------------------------- | ||
+ | ipv6.method: | ||
+ | ipv6.dns: | ||
+ | ipv6.dns-search: | ||
+ | ipv6.addresses: | ||
+ | ipv6.gateway: | ||
+ | ipv6.routes: | ||
+ | ipv6.route-metric: | ||
+ | ipv6.ignore-auto-routes: | ||
+ | ipv6.ignore-auto-dns: | ||
+ | ipv6.never-default: | ||
+ | ipv6.may-fail: | ||
+ | ipv6.ip6-privacy: | ||
+ | ipv6.dhcp-send-hostname: | ||
+ | ipv6.dhcp-hostname: | ||
+ | ------------------------------------------------------------------------------- | ||
+ | =============================================================================== | ||
+ | Activate connection details (fb3a11d9-4e03-4032-b26e-09d1195d2bcd) | ||
+ | =============================================================================== | ||
+ | GENERAL.NAME: | ||
+ | GENERAL.UUID: | ||
+ | GENERAL.DEVICES: | ||
+ | GENERAL.STATE: | ||
+ | GENERAL.DEFAULT: | ||
+ | GENERAL.DEFAULT6: | ||
+ | GENERAL.VPN: | ||
+ | GENERAL.ZONE: | ||
+ | GENERAL.DBUS-PATH: | ||
+ | GENERAL.CON-PATH: | ||
+ | GENERAL.SPEC-OBJECT: | ||
+ | GENERAL.MASTER-PATH: | ||
+ | ------------------------------------------------------------------------------- | ||
+ | IP4.ADDRESS[1]: | ||
+ | IP4.GATEWAY: | ||
+ | ------------------------------------------------------------------------------- | ||
+ | IP6.ADDRESS[1]: | ||
+ | IP6.GATEWAY: | ||
+ | ------------------------------------------------------------------------------- | ||
+ | </ | ||
+ | |||
+ | Pour consulter la liste profils associés à un périphérique, | ||
+ | |||
+ | < | ||
+ | [root@centos7 ~]# nmcli -f CONNECTIONS device show enp0s3 | ||
+ | CONNECTIONS.AVAILABLE-CONNECTION-PATHS: | ||
+ | CONNECTIONS.AVAILABLE-CONNECTIONS[1]: | ||
+ | CONNECTIONS.AVAILABLE-CONNECTIONS[2]: | ||
+ | </ | ||
+ | |||
+ | Les fichiers de configuration | ||
+ | |||
+ | < | ||
+ | [root@centos7 ~]# ls -l / | ||
+ | -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 | ||
+ | </ | ||
+ | |||
+ | L' | ||
+ | |||
+ | < | ||
+ | [root@centos7 ~]# cat / | ||
+ | TYPE=Ethernet | ||
+ | BOOTPROTO=none | ||
+ | IPADDR=10.0.2.16 | ||
+ | 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 | ||
+ | </ | ||
+ | |||
+ | La résolution des noms est donc inactive : | ||
+ | |||
+ | < | ||
+ | [root@centos7 ~]# ping www.free.fr | ||
+ | ping: unknown host www.free.fr | ||
+ | </ | ||
+ | |||
+ | Modifiez donc la configuration du profil **ip_fixe** : | ||
+ | |||
+ | < | ||
+ | [root@centos7 ~]# nmcli connection mod ip_fixe ipv4.dns 8.8.8.8 | ||
+ | </ | ||
+ | |||
+ | L' | ||
+ | |||
+ | < | ||
+ | [root@centos7 ~]# cat / | ||
+ | TYPE=Ethernet | ||
+ | BOOTPROTO=none | ||
+ | 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 | ||
+ | </ | ||
+ | |||
+ | Afin que la modification du serveur DNS soit prise en compte, re-démarrez le service NetworkManager : | ||
+ | |||
+ | < | ||
+ | [root@centos7 ~]# systemctl restart NetworkManager.service | ||
+ | [root@centos7 ~]# systemctl status NetworkManager.service | ||
+ | ● NetworkManager.service - Network Manager | ||
+ | | ||
+ | | ||
+ | Main PID: 8394 (NetworkManager) | ||
+ | | ||
+ | | ||
+ | |||
+ | Aug 08 11:16:53 centos7.fenestros.loc NetworkManager[8394]: | ||
+ | Aug 08 11:16:53 centos7.fenestros.loc NetworkManager[8394]: | ||
+ | Aug 08 11:16:53 centos7.fenestros.loc NetworkManager[8394]: | ||
+ | Aug 08 11:16:53 centos7.fenestros.loc NetworkManager[8394]: | ||
+ | Aug 08 11:16:53 centos7.fenestros.loc NetworkManager[8394]: | ||
+ | Aug 08 11:16:53 centos7.fenestros.loc NetworkManager[8394]: | ||
+ | Aug 08 11:16:53 centos7.fenestros.loc NetworkManager[8394]: | ||
+ | Aug 08 11:16:53 centos7.fenestros.loc NetworkManager[8394]: | ||
+ | Aug 08 11:16:53 centos7.fenestros.loc NetworkManager[8394]: | ||
+ | Aug 08 11:16:53 centos7.fenestros.loc NetworkManager[8394]: | ||
+ | </ | ||
+ | |||
+ | Vérifiez que le fichier | ||
+ | |||
+ | < | ||
+ | [root@centos7 ~]# cat / | ||
+ | # Generated by NetworkManager | ||
+ | search fenestros.loc | ||
+ | nameserver 8.8.8.8 | ||
+ | </ | ||
+ | |||
+ | Dernièrement vérifiez la resolution des noms : | ||
< | < | ||
- | [root@centos7 ~]# ls -l / | + | [root@centos7 ~]# ping www.free.fr |
- | total 24 | + | PING www.free.fr (212.27.48.10) 56(84) bytes of data. |
- | -rw-r--r--. 1 root root 1099 Apr 10 2015 10-evdev.conf | + | 64 bytes from www.free.fr (212.27.48.10): icmp_seq=1 ttl=63 time=10.4 ms |
- | -rw-r--r--. 1 root root 1867 Apr 10 2015 10-quirks.conf | + | 64 bytes from www.free.fr (212.27.48.10): icmp_seq=2 ttl=63 time=9.44 ms |
- | -rw-r--r--. 1 root root 1704 Mar 6 2015 50-synaptics.conf | + | 64 bytes from www.free.fr (212.27.48.10): icmp_seq=3 ttl=63 time=12.1 ms |
- | -rw-r--r--. 1 root root 115 Jun 10 2014 50-vmmouse.conf | + | ^C |
- | -rw-r--r--. 1 root root 835 Jun 10 2014 50-wacom.conf | + | --- www.free.fr ping statistics |
- | -rw-r--r--. 1 root root 61 Mar 6 2015 glamor.conf | + | 3 packets transmitted, |
+ | rtt min/ | ||
</ | </ | ||
<WRAP center round important> | <WRAP center round important> | ||
- | **Important** : Les fichiers dans le répertoire **xorg.conf.d** sont numérotés. L'ordre de prise en compte des fichiers de configuration suit la numérotation. Le fichier xorg.conf lui-même est interprété | + | **Important** : Notez qu'il existe un front-end graphique |
</ | </ | ||
- | Les fichiers de configuration contiennent des sections. Chaque section commence par une directive **Section** : | + | ====Ajouter |
- | < | + | Pour ajouter une deuxième adresse IP à un profil sous RHEL/CentOS 7, il convient d' |
- | Section " | + | |
- | ... | + | |
- | </file> | + | |
- | et se termine par une directive **EndSection** : | + | < |
+ | [root@centos7 ~]# nmcli connection mod ip_fixe +ipv4.addresses 192.168.1.2/ | ||
+ | </ | ||
- | < | + | Redémarrez la machine virtuelle puis en tant que root saisissez la commande suivante : |
- | ... | + | |
- | EndSection | + | |
- | </ | + | |
- | Dans chaque section se trouvent des lignes comprennant une **Option** suivi d'une ou de plusieurs **Valeurs** | + | < |
+ | [root@centos7 ~]# nmcli connection show ip_fixe | ||
+ | connection.id: | ||
+ | connection.uuid: | ||
+ | connection.interface-name: | ||
+ | connection.type: | ||
+ | connection.autoconnect: | ||
+ | connection.autoconnect-priority: | ||
+ | connection.timestamp: | ||
+ | connection.read-only: | ||
+ | connection.permissions: | ||
+ | connection.zone: | ||
+ | connection.master: | ||
+ | connection.slave-type: | ||
+ | connection.autoconnect-slaves: | ||
+ | connection.secondaries: | ||
+ | connection.gateway-ping-timeout: | ||
+ | connection.metered: | ||
+ | 802-3-ethernet.port: | ||
+ | 802-3-ethernet.speed: | ||
+ | 802-3-ethernet.duplex: | ||
+ | 802-3-ethernet.auto-negotiate: | ||
+ | 802-3-ethernet.mac-address: | ||
+ | 802-3-ethernet.cloned-mac-address: | ||
+ | 802-3-ethernet.mac-address-blacklist: | ||
+ | 802-3-ethernet.mtu: | ||
+ | 802-3-ethernet.s390-subchannels: | ||
+ | 802-3-ethernet.s390-nettype: | ||
+ | 802-3-ethernet.s390-options: | ||
+ | 802-3-ethernet.wake-on-lan: | ||
+ | 802-3-ethernet.wake-on-lan-password: | ||
+ | ipv4.method: | ||
+ | ipv4.dns: | ||
+ | ipv4.dns-search: | ||
+ | ipv4.addresses: | ||
+ | ipv4.gateway: | ||
+ | ipv4.routes: | ||
+ | ipv4.route-metric: | ||
+ | ipv4.ignore-auto-routes: | ||
+ | ipv4.ignore-auto-dns: | ||
+ | ipv4.dhcp-client-id: | ||
+ | ipv4.dhcp-send-hostname: | ||
+ | ipv4.dhcp-hostname: | ||
+ | ipv4.never-default: | ||
+ | ipv4.may-fail: | ||
+ | ipv6.method: | ||
+ | ipv6.dns: | ||
+ | ipv6.dns-search: | ||
+ | ipv6.addresses: | ||
+ | ipv6.gateway: | ||
+ | ipv6.routes: | ||
+ | ipv6.route-metric: | ||
+ | ipv6.ignore-auto-routes: | ||
+ | ipv6.ignore-auto-dns: | ||
+ | ipv6.never-default: | ||
+ | ipv6.may-fail: | ||
+ | ipv6.ip6-privacy: | ||
+ | ipv6.dhcp-send-hostname: | ||
+ | ipv6.dhcp-hostname: | ||
+ | GENERAL.NAME: | ||
+ | GENERAL.UUID: | ||
+ | GENERAL.DEVICES: | ||
+ | GENERAL.STATE: | ||
+ | GENERAL.DEFAULT: | ||
+ | GENERAL.DEFAULT6: | ||
+ | GENERAL.VPN: | ||
+ | GENERAL.ZONE: | ||
+ | GENERAL.DBUS-PATH: | ||
+ | GENERAL.CON-PATH: | ||
+ | GENERAL.SPEC-OBJECT: | ||
+ | GENERAL.MASTER-PATH: | ||
+ | IP4.ADDRESS[1]: | ||
+ | IP4.ADDRESS[2]: | ||
+ | IP4.GATEWAY: | ||
+ | IP4.DNS[1]: | ||
+ | IP6.ADDRESS[1]: | ||
+ | IP6.GATEWAY: | ||
+ | </ | ||
- | <file> | + | <WRAP center round important> |
- | | + | **Important** : Notez l' |
- | </file> | + | </ |
+ | |||
+ | Consultez maintenant le contenu du fichier **/ | ||
+ | |||
+ | < | ||
+ | [root@centos7 ~]# cat / | ||
+ | TYPE=Ethernet | ||
+ | BOOTPROTO=none | ||
+ | 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 | ||
+ | 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> | ||
<WRAP center round important> | <WRAP center round important> | ||
- | **A faire** : Notez que la valeur est entourée | + | **Important** : Notez l' |
</ | </ | ||
- | Certaines options sont des booléenes. Les valeurs admises sont : | + | ====La Commande hostname==== |
- | * **Vrai** | + | La procédure de la modification du hostname est simplifiée et sa prise en compte est immédiate |
- | * **Faux** : 0, off, false, no. | + | |
- | ===La Section ServerFlags=== | + | < |
+ | [root@centos7 ~]# nmcli general hostname centos.fenestros.loc | ||
+ | [root@centos7 ~]# cat / | ||
+ | centos.fenestros.loc | ||
+ | [root@centos7 ~]# hostname | ||
+ | centos.fenestros.loc | ||
+ | [root@centos7 ~]# nmcli general hostname centos7.fenestros.loc | ||
+ | [root@centos7 ~]# cat / | ||
+ | centos7.fenestros.loc | ||
+ | [root@centos7 ~]# hostname | ||
+ | centos7.fenestros.loc | ||
+ | </ | ||
- | Cette section optionnelle contient des directives globales. Cependant les valeurs attribuées ici peuvent être modifiées par les valeurs des directives dans la section **ServerLayout**. | + | ====La Commande ip==== |
- | Un exemple de cette section | + | Sous RHEL/CentOS 7 la commande **ip** |
- | <file> | + | <code> |
- | Section " | + | [root@centos7 ~]# ip address |
- | Option " | + | 1: lo: < |
- | EndSection | + | link/ |
- | </file> | + | inet 127.0.0.1/8 scope host lo |
+ | | ||
+ | inet6 ::1/128 scope host | ||
+ | valid_lft forever preferred_lft forever | ||
+ | 2: enp0s3: < | ||
+ | link/ether 08: | ||
+ | inet 10.0.2.16/ | ||
+ | | ||
+ | inet 192.168.1.2/ | ||
+ | | ||
+ | inet6 fe80:: | ||
+ | | ||
+ | [root@centos7 ~]# ip addr | ||
+ | 1: lo: < | ||
+ | link/ | ||
+ | inet 127.0.0.1/8 scope host lo | ||
+ | | ||
+ | inet6 ::1/128 scope host | ||
+ | | ||
+ | 2: enp0s3: < | ||
+ | link/ether 08: | ||
+ | inet 10.0.2.16/ | ||
+ | | ||
+ | inet 192.168.1.2/ | ||
+ | | ||
+ | inet6 fe80:: | ||
+ | | ||
+ | </code> | ||
- | Les directives les plus courantes dans cette section sont : | + | ===Options de la Commande ip=== |
- | ^ Directive | + | Les options |
- | | " | + | |
- | | " | + | |
- | ===La Section ServerLayout=== | + | < |
+ | [root@centos7 ~]# ip --help | ||
+ | Usage: ip [ OPTIONS ] OBJECT { COMMAND | help } | ||
+ | ip [ -force ] -batch filename | ||
+ | where OBJECT := { link | addr | addrlabel | route | rule | neigh | ntable | | ||
+ | | ||
+ | netns | l2tp | tcp_metrics | token } | ||
+ | | ||
+ | -f[amily] { inet | inet6 | ipx | dnet | bridge | link } | | ||
+ | -4 | -6 | -I | -D | -B | -0 | | ||
+ | -l[oops] { maximum-addr-flush-attempts } | | ||
+ | -o[neline] | -t[imestamp] | -b[atch] [filename] | | ||
+ | -rc[vbuf] [size]} | ||
- | Cette section regroupe les informations concernant les périphériques en entrée et les périphériques en sortie. | + | </ |
- | Un exemple de cette section est : | + | ====Activer/ |
- | < | + | Deux commandes existent pour désactiver et activer manuellement une interface réseau : |
- | Section | + | |
- | Identifier | + | |
- | Screen | + | |
- | InputDevice | + | |
- | InputDevice | + | |
- | EndSection | + | |
- | </ | + | |
- | Les directives les plus courantes dans cette section sont : | + | < |
+ | [root@centos7 ~]# nmcli device disconnect enp0s3 | ||
+ | [root@centos7 ~]# nmcli device connect enp0s3 | ||
+ | </ | ||
- | ^ Directive | + | ====Routage Statique==== |
- | | " | + | |
- | | " | + | ===La commande ip=== |
- | | " | + | |
- | | " | + | Sous RHEL/CentOS 7, pour supprimer |
+ | |||
+ | < | ||
+ | [root@centos7 ~]# ip route | ||
+ | default via 10.0.2.2 dev enp0s3 | ||
+ | 10.0.2.0/24 dev enp0s3 | ||
+ | 192.168.1.0/24 dev enp0s3 | ||
+ | |||
+ | [root@centos7 ~]# ip route del 192.168.1.0/ | ||
+ | |||
+ | [root@centos7 ~]# ip route | ||
+ | default via 10.0.2.2 dev enp0s3 | ||
+ | 10.0.2.0/24 dev enp0s3 | ||
+ | </ | ||
+ | |||
+ | Pour ajouter | ||
+ | |||
+ | < | ||
+ | [root@centos7 ~]# ip route add 192.168.1.0/ | ||
+ | |||
+ | [root@centos7 ~]# ip route | ||
+ | default via 10.0.2.2 dev enp0s3 | ||
+ | 10.0.2.0/24 dev enp0s3 | ||
+ | 192.168.1.0/ | ||
+ | </ | ||
<WRAP center round important> | <WRAP center round important> | ||
- | **Important** : Le fichier de configuration peut contenir deux ou plusieurs sections ServerLayout. Seule la première sera prise en compte. | + | La commande utilisée pour ajouter une passerelle par défaut prend la forme suivante |
</ | </ | ||
- | ===La Section Files=== | + | ===Activer/ |
- | Cette section regroupe les informations concernant les fichiers de configuration supplémentaires. | + | Pour activer le routage sur le serveur, il convient d' |
- | Un exemple de cette section est : | + | < |
+ | [root@centos7 ~]# echo 1 > / | ||
+ | [root@centos7 ~]# cat / | ||
+ | 1 | ||
+ | </ | ||
- | < | + | Pour désactiver le routage sur le serveur, il convient de désactiver la retransmission des paquets: |
- | Section " | + | |
- | RgbPath | + | |
- | FontPath | + | |
- | EndSection | + | |
- | </ | + | |
- | Les directives les plus courantes dans cette section sont : | + | < |
+ | [root@centos7 ~]# echo 0 > / | ||
+ | [root@centos7 ~]# cat / | ||
+ | 0 | ||
+ | </ | ||
- | ^ Directive | + | =====Diagnostique du Réseau===== |
- | | " | + | |
- | | " | + | |
- | | " | + | |
- | Voici le fichier | + | ====ping==== |
+ | |||
+ | Pour tester l' | ||
< | < | ||
- | [root@centos7 ~]# more / | + | [root@centos7 ~]# ping 10.0.2.2 |
- | 255 250 250 snow | + | PING 10.0.2.2 (10.0.2.2) 56(84) bytes of data. |
- | 248 248 255 ghost white | + | 64 bytes from 10.0.2.2: icmp_seq=1 ttl=63 time=0.602 ms |
- | 248 248 255 GhostWhite | + | 64 bytes from 10.0.2.2: icmp_seq=2 ttl=63 time=0.375 ms |
- | 245 245 245 white smoke | + | 64 bytes from 10.0.2.2: icmp_seq=3 ttl=63 time=0.512 ms |
- | 245 245 245 WhiteSmoke | + | 64 bytes from 10.0.2.2: icmp_seq=4 ttl=63 time=0.547 ms |
- | 220 220 220 gainsboro | + | ^C |
- | 255 250 240 floral white | + | --- 10.0.2.2 ping statistics |
- | 255 250 240 FloralWhite | + | 4 packets transmitted, |
- | 253 245 230 old lace | + | rtt min/ |
- | 253 245 230 OldLace | + | |
- | 250 240 230 linen | + | |
- | 250 235 215 antique white | + | |
- | 250 235 215 AntiqueWhite | + | |
- | 255 239 213 papaya whip | + | |
- | 255 239 213 PapayaWhip | + | |
- | 255 235 205 blanched almond | + | |
- | 255 235 205 BlanchedAlmond | + | |
- | 255 228 196 bisque | + | |
- | 255 218 185 peach puff | + | |
- | 255 218 185 PeachPuff | + | |
- | 255 222 173 navajo white | + | |
- | 255 222 173 NavajoWhite | + | |
- | 255 228 181 moccasin | + | |
- | 255 248 220 cornsilk | + | |
- | 255 255 240 ivory | + | |
- | 255 250 205 lemon chiffon | + | |
- | 255 250 205 LemonChiffon | + | |
- | 255 245 238 seashell | + | |
- | 240 255 240 honeydew | + | |
- | --More--(3%) | + | |
</ | </ | ||
- | ===La Section Modules=== | + | ===Options de la commande ping=== |
- | Par défaut le serveur X charge ses modules à partir du répertoire **/ | + | Les options de cette commande sont : |
< | < | ||
- | [root@centos7 ~]# ls / | + | [root@centos7 ~]# ping --help |
- | drivers | + | ping: invalid option -- ' |
- | extensions | + | Usage: ping [-aAbBdDfhLnOqrRUvV] [-c count] [-i interval] [-I interface] |
+ | [-m mark] [-M pmtudisc_option] [-l preload] [-p pattern] [-Q tos] | ||
+ | [-s packetsize] [-S sndbuf] [-t ttl] [-T timestamp_option] | ||
+ | [-w deadline] [-W timeout] [hop1 ...] destination | ||
</ | </ | ||
+ | |||
+ | ====netstat -i==== | ||
+ | |||
+ | Pour visualiser les statistiques réseaux, vous disposez de la commande **netstat** : | ||
< | < | ||
- | root@debian8:~# ls / | + | [root@centos7 |
- | drivers | + | Kernel Interface table |
- | extensions | + | Iface MTU RX-OK RX-ERR RX-DRP RX-OVR |
+ | enp0s3 | ||
+ | lo | ||
</ | </ | ||
+ | |||
+ | ===Options de la commande netstat=== | ||
+ | |||
+ | Les options de cette commande sont : | ||
+ | |||
+ | < | ||
+ | [root@centos7 ~]# netstat --help | ||
+ | usage: netstat [-vWeenNcCF] [< | ||
+ | | ||
+ | | ||
+ | |||
+ | -r, --route | ||
+ | -I, --interfaces=< | ||
+ | -i, --interfaces | ||
+ | -g, --groups | ||
+ | -s, --statistics | ||
+ | -M, --masquerade | ||
+ | |||
+ | -v, --verbose | ||
+ | -W, --wide | ||
+ | -n, --numeric | ||
+ | --numeric-hosts | ||
+ | --numeric-ports | ||
+ | --numeric-users | ||
+ | -N, --symbolic | ||
+ | -e, --extend | ||
+ | -p, --programs | ||
+ | -o, --timers | ||
+ | -c, --continuous | ||
+ | |||
+ | -l, --listening | ||
+ | -a, --all display all sockets (default: connected) | ||
+ | -F, --fib display Forwarding Information Base (default) | ||
+ | -C, --cache | ||
+ | -Z, --context | ||
+ | |||
+ | < | ||
+ | | ||
+ | < | ||
+ | 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) | ||
+ | </ | ||
+ | |||
+ | ====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é : | ||
+ | |||
+ | < | ||
+ | [root@centos7 ~]# traceroute www.i2tch.eu | ||
+ | traceroute to www.i2tch.eu (217.160.122.33), | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | 10 * * * | ||
+ | 11 * * * | ||
+ | 12 * * * | ||
+ | 13 * * * | ||
+ | 14 * * * | ||
+ | 15 * * * | ||
+ | 16 * * * | ||
+ | 17 * * * | ||
+ | 18 * * * | ||
+ | ... | ||
+ | </ | ||
+ | |||
+ | ===Options de la commande traceroute=== | ||
+ | |||
+ | Les options de cette commande sont : | ||
+ | |||
+ | < | ||
+ | [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 | ||
+ | -F --dont-fragment | ||
+ | -f first_ttl | ||
+ | Start from the first_ttl hop (instead from 1) | ||
+ | -g gate, | ||
+ | Route packets through the specified gateway | ||
+ | (maximum 8 for IPv4 and 127 for IPv6) | ||
+ | -I --icmp | ||
+ | -T --tcp Use TCP SYN for tracerouting (default port is 80) | ||
+ | -i device | ||
+ | Specify a network interface to operate with | ||
+ | -m max_ttl | ||
+ | Set the max number of hops (max TTL to be | ||
+ | reached). Default is 30 | ||
+ | -N 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 | ||
+ | initial udp port value for " | ||
+ | (incremented by each probe, default is 33434), or | ||
+ | initial seq for " | ||
+ | default from 1), or some constant destination | ||
+ | port for other methods (with default of 80 for | ||
+ | " | ||
+ | -t tos --tos=tos | ||
+ | traffic class) value for outgoing packets | ||
+ | -l flow_label | ||
+ | Use specified flow_label for IPv6 packets | ||
+ | -w 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 | ||
+ | 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 | ||
+ | Use source src_addr for outgoing packets | ||
+ | -z sendwait | ||
+ | Minimal time interval between probes (default 0). | ||
+ | If the value is more than 10, then it specifies a | ||
+ | number in milliseconds, | ||
+ | seconds (float point values allowed too) | ||
+ | -e --extensions | ||
+ | -A --as-path-lookups | ||
+ | print results directly after the corresponding | ||
+ | addresses | ||
+ | -M name --module=name | ||
+ | for traceroute operations. Most methods have | ||
+ | their shortcuts (`-I' means `-M icmp' etc.) | ||
+ | -O OPTS, | ||
+ | Use module-specific option OPTS for the | ||
+ | traceroute module. Several OPTS allowed, | ||
+ | separated by comma. If OPTS is " | ||
+ | about available options | ||
+ | --sport=num | ||
+ | `-N 1' | ||
+ | --fwmark=num | ||
+ | -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 | ||
+ | is 33434) | ||
+ | -P prot --protocol=prot | ||
+ | --mtu | ||
+ | `-F -N 1' | ||
+ | --back | ||
+ | print if it differs | ||
+ | -V --version | ||
+ | --help | ||
+ | |||
+ | Arguments: | ||
+ | + | ||
+ | packetlen | ||
+ | header plus 40). Can be ignored or increased to a minimal | ||
+ | allowed value | ||
+ | </ | ||
+ | |||
+ | =====Connexions à Distance===== | ||
+ | |||
+ | ==== Telnet ==== | ||
<WRAP center round important> | <WRAP center round important> | ||
- | **Important** : Le chemin | + | La commande |
</ | </ | ||
- | Un exemple de cette section | + | La commande **telnet** |
< | < | ||
- | Section " | + | # telnet numero_ip |
- | Load " | + | |
- | EndSection | + | |
</ | </ | ||
<WRAP center round important> | <WRAP center round important> | ||
- | **Attention** : Dans l' | + | Le service telnet revient à une redirection des canaux standards d' |
</ | </ | ||
- | ===La Section InputDevice=== | + | ===Options de la commande telnet=== |
- | Cette section décrit un périphérique en entrée. Il n'ya normalement qu'une section pour le clavier, les souris étant généralement détectées automatiquement. Vous pouvez cependant configurer une section **InputDevice** pour une souris en ecrasant la configuration par défaut. | + | Les options de cette commande sont : |
- | Un exemple de cette section est : | + | < |
+ | [root@centos7 ~]# telnet --help | ||
+ | telnet: invalid option -- ' | ||
+ | Usage: telnet [-8] [-E] [-L] [-S tos] [-a] [-c] [-d] [-e char] [-l user] | ||
+ | [-n tracefile] [-b hostalias ] [-r] | ||
+ | | ||
+ | </ | ||
- | < | + | ==== wget ==== |
- | Section " | + | |
- | Identifier | + | |
- | Driver | + | |
- | Option | + | |
- | Option | + | |
- | EndSection | + | |
- | </ | + | |
- | Les directives les plus courantes dans cette section sont : | + | La commande **wget** est utilisée pour récupérer un fichier via http, https ou ftp : |
- | ^ Directive | + | < |
- | | " | + | [root@centos7 ~]# wget https:// |
- | | " | + | --2017-06-22 16: |
- | | " | + | 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:// | ||
+ | --2017-06-22 16: | ||
+ | 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/ | ||
+ | Saving to: ‘fichier_test? | ||
- | Quand la section décrit une souris, on trouve typiquement les options suivantes : | + | 100%[====================================================================================> |
- | ^ Option | + | 2017-06-22 16:53:41 (480 KB/s) - ‘fichier_test? |
- | | " | + | </ |
- | | " | + | |
- | | " | + | |
- | ===La Section Monitor=== | + | ===Options de la commande wget=== |
- | Cette section décrit l' | + | Les options |
+ | |||
+ | < | ||
+ | [root@centos7 ~]# wget --help | ||
+ | GNU Wget 1.14, a non-interactive network retriever. | ||
+ | Usage: wget [OPTION]... [URL]... | ||
+ | |||
+ | Mandatory arguments to long options are mandatory for short options too. | ||
+ | |||
+ | Startup: | ||
+ | -V, --version | ||
+ | -h, --help | ||
+ | -b, --background | ||
+ | -e, --execute=COMMAND | ||
+ | |||
+ | Logging and input file: | ||
+ | -o, --output-file=FILE | ||
+ | -a, --append-output=FILE | ||
+ | -d, --debug | ||
+ | -q, --quiet | ||
+ | -v, --verbose | ||
+ | -nv, --no-verbose | ||
+ | | ||
+ | -i, --input-file=FILE | ||
+ | -F, --force-html | ||
+ | -B, --base=URL | ||
+ | | ||
+ | | ||
+ | |||
+ | Download: | ||
+ | -t, --tries=NUMBER | ||
+ | | ||
+ | -O, --output-document=FILE | ||
+ | -nc, --no-clobber | ||
+ | | ||
+ | -c, --continue | ||
+ | | ||
+ | -N, --timestamping | ||
+ | | ||
+ | --no-use-server-timestamps | ||
+ | the one on the server. | ||
+ | -S, --server-response | ||
+ | | ||
+ | -T, --timeout=SECONDS | ||
+ | | ||
+ | | ||
+ | | ||
+ | -w, --wait=SECONDS | ||
+ | | ||
+ | | ||
+ | | ||
+ | -Q, | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | -4, --inet4-only | ||
+ | -6, --inet6-only | ||
+ | | ||
+ | one of IPv6, IPv4, or none. | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | Directories: | ||
+ | -nd, --no-directories | ||
+ | -x, --force-directories | ||
+ | -nH, --no-host-directories | ||
+ | | ||
+ | -P, --directory-prefix=PREFIX | ||
+ | | ||
+ | |||
+ | HTTP options: | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | this is `index.html' | ||
+ | -E, --adjust-extension | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | -U, --user-agent=AGENT | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | HTTPS (SSL/TLS) options: | ||
+ | | ||
+ | SSLv3, and TLSv1. | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | FTP options: | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | WARC options: | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | WARC writer. | ||
+ | |||
+ | Recursive download: | ||
+ | -r, --recursive | ||
+ | -l, --level=NUMBER | ||
+ | | ||
+ | -k, --convert-links | ||
+ | local files. | ||
+ | --backups=N | ||
+ | -K, --backup-converted | ||
+ | -m, --mirror | ||
+ | -p, --page-requisites | ||
+ | | ||
+ | |||
+ | Recursive accept/ | ||
+ | -A, --accept=LIST | ||
+ | -R, --reject=LIST | ||
+ | | ||
+ | | ||
+ | | ||
+ | -D, --domains=LIST | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | -H, --span-hosts | ||
+ | -L, --relative | ||
+ | -I, --include-directories=LIST | ||
+ | --trust-server-names | ||
+ | url last component. | ||
+ | -X, --exclude-directories=LIST | ||
+ | -np, --no-parent | ||
+ | |||
+ | Mail bug reports and suggestions to < | ||
+ | </ | ||
+ | |||
+ | ==== ftp ==== | ||
<WRAP center round important> | <WRAP center round important> | ||
- | **Attention** : Il est important | + | La commande |
</ | </ | ||
- | Un exemple de cette section | + | La commande **ftp** |
+ | |||
+ | < | ||
+ | [root@centos7 ~]# ftp ftp2.fenestros.com | ||
+ | Connected to ftp2.fenestros.com (213.186.33.14). | ||
+ | 220 anonymous.ftp.ovh.net NcFTPd Server (licensed copy) ready. | ||
+ | Name (ftp2.fenestros.com: | ||
+ | 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> | ||
+ | </ | ||
+ | |||
+ | Une fois connecté, il convient d' | ||
+ | |||
+ | < | ||
+ | ftp> help | ||
+ | Commands may be abbreviated. | ||
+ | |||
+ | ! debug mdir sendport site | ||
+ | $ dir mget put size | ||
+ | account disconnect mkdir pwd status | ||
+ | append exit mls quit struct | ||
+ | ascii form mode quote system | ||
+ | bell get modtime recv sunique | ||
+ | binary glob mput reget tenex | ||
+ | bye hash newer rstatus tick | ||
+ | case help nmap rhelp trace | ||
+ | cd idle nlist rename type | ||
+ | cdup image ntrans reset user | ||
+ | chmod lcd open restart umask | ||
+ | close ls prompt rmdir verbose | ||
+ | cr macdef passive runique ? | ||
+ | delete mdelete proxy send | ||
+ | ftp> | ||
+ | </ | ||
+ | |||
+ | Le caractère **!** permet d' | ||
+ | |||
+ | < | ||
+ | ftp> !pwd | ||
+ | /root | ||
+ | </ | ||
+ | |||
+ | Pour transférer un fichier vers le serveur, il convient d' | ||
< | < | ||
- | Section " | + | ftp> put nom_fichier_local nom_fichier_distant |
- | Identifier | + | |
- | VendorName | + | |
- | ModelName | + | |
- | DisplaySize | + | |
- | HorizSync | + | |
- | VertRefresh | + | |
- | EndSection | + | |
</ | </ | ||
- | Les directives les plus courantes dans cette section sont : | + | 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: |
- | ^ Directive | + | < |
- | | " | + | ftp> mput nom*.* |
- | | " | + | </ |
- | | " | + | |
- | | " | + | |
- | | " | + | |
- | | " | + | |
- | | " | + | |
- | | " | + | |
+ | Pour transférer un fichier du serveur, il convient d' | ||
- | ===La Section Device=== | + | < |
+ | ftp> get nom_fichier | ||
+ | </ | ||
- | Cette section décrit une carte vidéo. Il y a une section Device pour chaque carte vidéo présente dans la machine. | + | Vous pouvez également transférer plusieurs fichiers à la fois grâce à la commande **mget** ( voir la commande **mput** ci-dessus ). |
- | Un exemple de cette section est : | + | Pour supprimer un fichier sur le serveur, il convient d' |
< | < | ||
- | Section " | + | ftp> del nom_fichier |
- | Identifier | + | |
- | Driver | + | |
- | VendorName | + | |
- | BoardName | + | |
- | VideoRam | + | |
- | Option | + | |
- | EndSection | + | |
</ | </ | ||
- | Les directives les plus courantes dans cette section sont : | + | Pour fermer la session, il convient d' |
- | ^ Directive | + | < |
- | | " | + | ftp> quit |
- | | " | + | [root@centos7 ~]# |
- | | " | + | </code> |
- | | " | + | |
- | | " | + | |
- | | " | + | |
- | | " | + | |
- | | " | + | |
- | ===La Section Screen=== | + | ====SSH==== |
- | Cette section associe une carte vidéo décrite par une section **Device** avec un moniteur décrit par une section **Monitor** : | + | ===Introduction=== |
- | Un exemple | + | La commande **[[wpfr> |
+ | |||
+ | * Le **serveur SSH** | ||
+ | * le démon sshd, qui s' | ||
+ | * 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' | ||
+ | * Les **clefs** | ||
+ | * **Couple de clef utilisateur asymétriques** et persistantes qui assurent l' | ||
+ | * **Clef hôte asymétrique et persistante** garantissant l' | ||
+ | * **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' | ||
+ | * 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 | ||
+ | * 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' | ||
+ | |||
+ | Afin de s' | ||
+ | |||
+ | * **Kerberos**, | ||
+ | * **Rhosts**, | ||
+ | * **%%RhostsRSA%%**, | ||
+ | * Par **clef asymétrique**, | ||
+ | * **TIS**, | ||
+ | * Par **mot de passe**. | ||
+ | |||
+ | ==SSH-2== | ||
+ | |||
+ | SSH-2 utilise **DSA** ou **RSA**. Il assure l' | ||
+ | |||
+ | * **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' | ||
+ | |||
+ | * Par **clef asymétrique**, | ||
+ | * Identique à SSH-1 sauf avec l' | ||
+ | * **%%RhostsRSA%%**, | ||
+ | * Par **mot de passe**. | ||
+ | |||
+ | ==Options de la commande== | ||
+ | |||
+ | Les options de cette commande sont : | ||
+ | |||
+ | < | ||
+ | [root@centos6 ~]# ssh --help | ||
+ | usage: ssh [-1246AaCfgKkMNnqsTtVvXxYy] [-b bind_address] [-c cipher_spec] | ||
+ | [-D [bind_address: | ||
+ | [-i identity_file] [-L [bind_address: | ||
+ | [-l login_name] [-m mac_spec] [-O ctl_cmd] [-o option] [-p port] | ||
+ | [-R [bind_address: | ||
+ | [-w local_tun[: | ||
+ | </ | ||
+ | |||
+ | ===L' | ||
+ | |||
+ | L' | ||
+ | |||
+ | Avantage: | ||
+ | * Aucune configuration de clef asymétrique n'est nécessaire. | ||
+ | |||
+ | Inconvénients: | ||
+ | * L' | ||
+ | * Moins sécurisé qu'un système par clef asymétrique. | ||
+ | |||
+ | ===L' | ||
+ | |||
+ | * Le **client** envoie au serveur une requête d' | ||
+ | * Le **serveur** recherche une correspondance pour ce module dans le fichier des clés autorisés **~/ | ||
+ | * 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' | ||
+ | * 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' | ||
+ | |||
+ | ===Installation=== | ||
+ | |||
+ | Pour installer/ | ||
+ | |||
+ | < | ||
+ | [root@centos7 ~]# yum install openssh-server | ||
+ | Loaded plugins: fastestmirror, | ||
+ | Loading mirror speeds from cached hostfile | ||
+ | * base: centos.mirror.fr.planethoster.net | ||
+ | * extras: ftp.ciril.fr | ||
+ | * updates: centos.mirrors.ovh.net | ||
+ | Package openssh-server-6.6.1p1-25.el7_2.x86_64 already installed and latest version | ||
+ | Nothing to do | ||
+ | </ | ||
+ | |||
+ | <WRAP center round important> | ||
+ | **Important** - Pour les stations de travail, installez le client : **openssh-clients**. | ||
+ | </ | ||
+ | |||
+ | ==Options de la commande== | ||
+ | |||
+ | Les options de la commande sont : | ||
< | < | ||
- | Section " | + | SYNOPSIS |
- | Identifier " | + | 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] |
- | Device | + | |
- | Monitor | + | |
- | DefaultDepth | + | |
- | SubSection " | + | |
- | Depth | + | |
- | Modes | + | |
- | EndSubSection | + | |
- | SubSection " | + | |
- | Depth | + | |
- | Modes | + | |
- | EndSubSection | + | |
- | EndSection | + | |
</ | </ | ||
- | Les directives les plus courantes dans cette section sont : | + | ===Configuration=== |
- | ^ Directive | + | <WRAP center round important> |
- | | " | + | **Important** - La configuration doit s' |
- | | " | + | </ |
- | | " | + | |
- | | " | + | |
- | | " | + | |
- | | " | + | |
- | ====La Commande xwininfo==== | + | ==Serveur== |
- | La commande xwininfo permet d'obtenir de l' | + | La configuration du serveur s'effectue dans le fichier **/ |
< | < | ||
- | [root@centos7 ~]# xwininfo | + | [root@centos7 ~]# cat / |
+ | # $OpenBSD: sshd_config, | ||
- | xwininfo: Please select | + | # This is the sshd server system-wide configuration file. See |
- | would like information | + | # sshd_config(5) for more information. |
- | mouse in that window. | + | |
- | xwininfo: Window id: 0x2800025 " | + | # This sshd was compiled with PATH=/ |
- | Absolute upper-left X: 0 | + | # 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. |
- | | + | # default value. |
- | Width: 1366 | + | |
- | | + | # 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 # |
- | | + | # |
- | | + | #Port 22 |
- | | + | # |
- | | + | # |
- | Bit Gravity State: NorthWestGravity | + | # |
- | | + | |
- | | + | # The default requires explicit activation of protocol 1 |
- | Save Under State: | + | #Protocol 2 |
- | Map State: IsViewable | + | |
- | | + | # HostKey for protocol version 1 |
- | | + | #HostKey / |
- | -geometry 1366x574+0+28 | + | # HostKeys for protocol version 2 |
+ | HostKey / | ||
+ | #HostKey / | ||
+ | HostKey / | ||
+ | HostKey / | ||
+ | |||
+ | # Lifetime and size of ephemeral version 1 server key | ||
+ | # | ||
+ | # | ||
+ | |||
+ | # Ciphers and keying | ||
+ | #RekeyLimit default none | ||
+ | |||
+ | # Logging | ||
+ | # obsoletes QuietMode and FascistLogging | ||
+ | # | ||
+ | SyslogFacility AUTHPRIV | ||
+ | #LogLevel INFO | ||
+ | |||
+ | # Authentication: | ||
+ | |||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | |||
+ | # | ||
+ | # | ||
+ | |||
+ | # The default is to check both .ssh/ | ||
+ | # but this is overridden so installations will only check .ssh/ | ||
+ | AuthorizedKeysFile .ssh/ | ||
+ | |||
+ | # | ||
+ | |||
+ | # | ||
+ | # | ||
+ | |||
+ | # For this to work you will also need host keys in / | ||
+ | # | ||
+ | # similar for protocol version 2 | ||
+ | # | ||
+ | # Change to yes if you don't trust ~/ | ||
+ | # RhostsRSAAuthentication and HostbasedAuthentication | ||
+ | # | ||
+ | # Don't read the user's ~/.rhosts and ~/.shosts files | ||
+ | # | ||
+ | |||
+ | # To disable tunneled clear text passwords, change to no here! | ||
+ | # | ||
+ | # | ||
+ | PasswordAuthentication yes | ||
+ | |||
+ | # Change to no to disable s/key passwords | ||
+ | # | ||
+ | ChallengeResponseAuthentication no | ||
+ | |||
+ | # Kerberos options | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | |||
+ | # GSSAPI options | ||
+ | GSSAPIAuthentication yes | ||
+ | GSSAPICleanupCredentials no | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | |||
+ | # Set this to ' | ||
+ | # and session processing. If this is enabled, PAM authentication will | ||
+ | # be allowed through the ChallengeResponseAuthentication and | ||
+ | # PasswordAuthentication. | ||
+ | # PAM authentication via ChallengeResponseAuthentication may bypass | ||
+ | # the setting of " | ||
+ | # If you just want the PAM account and session checks to run without | ||
+ | # PAM authentication, | ||
+ | # and ChallengeResponseAuthentication to ' | ||
+ | # WARNING: ' | ||
+ | # problems. | ||
+ | UsePAM yes | ||
+ | |||
+ | # | ||
+ | # | ||
+ | # | ||
+ | X11Forwarding yes | ||
+ | # | ||
+ | # | ||
+ | #PermitTTY yes | ||
+ | #PrintMotd yes | ||
+ | # | ||
+ | # | ||
+ | #UseLogin no | ||
+ | UsePrivilegeSeparation sandbox # Default for new installations. | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | #UseDNS yes | ||
+ | #PidFile / | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | |||
+ | # 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 / | ||
+ | |||
+ | # Example of overriding settings on a per-user basis | ||
+ | #Match User anoncvs | ||
+ | # | ||
+ | # | ||
+ | # PermitTTY no | ||
+ | # | ||
</ | </ | ||
- | Les options | + | Pour ôter les lignes |
< | < | ||
- | [root@centos7 ~]# xwininfo | + | [root@centos7 ~]# cd /tmp ; grep -E -v ' |
- | usage: | + | [root@centos7 tmp]# cat sshd_config |
+ | HostKey / | ||
+ | HostKey / | ||
+ | HostKey / | ||
+ | SyslogFacility AUTHPRIV | ||
+ | AuthorizedKeysFile .ssh/ | ||
+ | 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 / | ||
+ | </ | ||
- | where options include: | + | Pour sécuriser le serveur ssh, ajoutez ou modifiez les directives suivantes |
- | | + | |
- | -display host:dpy X server | + | < |
- | -root use the root window | + | AllowGroups adm |
- | -id windowid | + | Banner / |
- | -name windowname | + | HostbasedAuthentication no |
- | | + | IgnoreRhosts yes |
- | | + | LoginGraceTime 60 |
- | | + | LogLevel INFO |
- | -stats print window geometry | + | PermitEmptyPasswords no |
- | | + | PermitRootLogin no |
- | | + | PrintLastLog yes |
- | | + | Protocol 2 |
- | | + | StrictModes yes |
- | | + | X11Forwarding no |
- | -frame | + | </ |
- | | + | |
- | | + | Votre fichier ressemblera à celui-ci : |
- | | + | |
+ | < | ||
+ | AllowGroups adm | ||
+ | Banner / | ||
+ | HostbasedAuthentication no | ||
+ | IgnoreRhosts yes | ||
+ | LoginGraceTime 60 | ||
+ | LogLevel INFO | ||
+ | PermitEmptyPasswords no | ||
+ | PermitRootLogin no | ||
+ | PrintLastLog yes | ||
+ | Protocol 2 | ||
+ | StrictModes yes | ||
+ | X11Forwarding no | ||
+ | HostKey / | ||
+ | HostKey / | ||
+ | HostKey / | ||
+ | SyslogFacility AUTHPRIV | ||
+ | AuthorizedKeysFile .ssh/ | ||
+ | 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 / | ||
+ | </ | ||
+ | |||
+ | <WRAP center round todo> | ||
+ | **A Faire** | ||
+ | </ | ||
+ | |||
+ | Pour générer les clefs sur le serveur saisissez la commande suivante en tant que **root**: | ||
+ | |||
+ | Lors de la génération des clefs, la passphrase doit être **vide**. | ||
+ | |||
+ | < | ||
+ | [root@centos7 ~]# ssh-keygen -t dsa | ||
+ | Generating public/ | ||
+ | Enter file in which to save the key (/ | ||
+ | Enter passphrase (empty for no passphrase): | ||
+ | Enter same passphrase again: | ||
+ | Your identification has been saved in / | ||
+ | Your public key has been saved in / | ||
+ | The key fingerprint is: | ||
+ | d5: | ||
+ | The key's randomart image is: | ||
+ | +--[ DSA 1024]----+ | ||
+ | | +oBB.| | ||
+ | | o *.o*| | ||
+ | | . o +.o| | ||
+ | | | ||
+ | | S .=..| | ||
+ | | .o.| | ||
+ | | o| | ||
+ | | E| | ||
+ | | | | ||
+ | +-----------------+ | ||
</ | </ | ||
- | ====La Commande xdpyinfo==== | + | <WRAP center round important> |
+ | Le chemin à indiquer pour le fichier est **/ | ||
+ | </ | ||
- | Xdpyinfo est un utilitaire utilisé pour afficher des informations concernant le serveur X : | + | Les clefs publiques générées possèdent l' |
< | < | ||
- | [root@centos7 ~]# xdpyinfo | + | [root@centos7 ~]# ls /etc/ssh |
- | name of display: | + | moduli |
- | version number: | + | ssh_config |
- | vendor string: | + | </ |
- | vendor release number: | + | |
- | X.Org version: 1.15.0 | + | |
- | maximum request size: 16777212 bytes | + | |
- | motion buffer size: 256 | + | |
- | bitmap unit, bit order, padding: | + | |
- | image byte order: | + | |
- | number of supported pixmap formats: | + | |
- | supported pixmap formats: | + | |
- | depth 1, bits_per_pixel 1, scanline_pad 32 | + | |
- | depth 4, bits_per_pixel 8, scanline_pad 32 | + | |
- | depth 8, bits_per_pixel 8, scanline_pad 32 | + | |
- | depth 15, bits_per_pixel 16, scanline_pad 32 | + | |
- | depth 16, bits_per_pixel 16, scanline_pad 32 | + | |
- | depth 24, bits_per_pixel 32, scanline_pad 32 | + | |
- | depth 32, bits_per_pixel 32, scanline_pad 32 | + | |
- | keycode range: | + | |
- | focus: | + | |
- | number of extensions: | + | |
- | BIG-REQUESTS | + | |
- | Composite | + | |
- | DAMAGE | + | |
- | DOUBLE-BUFFER | + | |
- | DPMS | + | |
- | DRI2 | + | |
- | GLX | + | |
- | Generic Event Extension | + | |
- | MIT-SCREEN-SAVER | + | |
- | MIT-SHM | + | |
- | Present | + | |
- | RANDR | + | |
- | RECORD | + | |
- | RENDER | + | |
- | SGI-GLX | + | |
- | SHAPE | + | |
- | SYNC | + | |
- | X-Resource | + | |
- | XC-MISC | + | |
- | XFIXES | + | |
- | XFree86-DGA | + | |
- | XFree86-VidModeExtension | + | |
- | XINERAMA | + | |
- | XInputExtension | + | |
- | XKEYBOARD | + | |
- | XTEST | + | |
- | XVideo | + | |
- | default screen number: | + | |
- | number of screens: | + | |
- | screen #0: | + | Re-démarrez ensuite le service sshd : |
- | | + | |
- | | + | < |
- | | + | [root@centos7 ~]# systemctl restart sshd.service |
- | | + | |
- | depth of root window: | + | |
- | number of colormaps: | + | |
- | default colormap: | + | |
- | default number of colormap cells: | + | |
- | preallocated pixels: | + | |
- | options: | + | |
- | largest cursor: | + | |
- | current input event mask: 0xda0003 | + | |
- | KeyPressMask | + | |
- | SubstructureNotifyMask | + | |
- | ColormapChangeMask | + | |
- | number of visuals: | + | |
- | default visual id: 0x21 | + | |
- | visual: | + | |
- | visual id: 0x21 | + | |
- | class: | + | |
- | depth: | + | |
- | available colormap entries: | + | |
- | red, green, blue masks: | + | |
- | significant bits in color specification: | + | |
- | visual: | + | |
- | visual id: 0xf9 | + | |
- | class: | + | |
- | depth: | + | |
- | available colormap entries: | + | |
- | red, green, blue masks: | + | |
- | significant bits in color specification: | + | |
- | ... | + | |
</ | </ | ||
- | Les options | + | Saisissez maintenant les commandes suivantes en tant que **trainee** : |
+ | |||
+ | <WRAP center round important> | ||
+ | Lors de la génération des clefs, la passphrase doit être **vide**. | ||
+ | </ | ||
< | < | ||
- | [root@centos7 ~]# xdpyinfo | + | [trainee@centos7 ~]$ ssh-keygen |
- | usage: | + | Generating public/ |
- | -display displayname server | + | Enter file in which to save the key (/ |
- | -version print program version and exit | + | Created directory '/ |
- | -queryExtensions print info returned by XQueryExtension | + | Enter passphrase (empty for no passphrase): |
- | -ext all print detailed info for all supported extensions | + | Enter same passphrase again: |
- | -ext extension-name print detailed info for extension-name if one of: | + | Your identification has been saved in / |
- | MIT-SHM XKEYBOARD Multi-Buffering SHAPE SYNC XFree86-DGA | + | Your public key has been saved in / |
- | XFree86-VidModeExtension XFree86-Misc XTEST DOUBLE-BUFFER RECORD | + | The key fingerprint is: |
- | XInputExtension RENDER XINERAMA DMX | + | 97: |
+ | The key's randomart image is: | ||
+ | +--[ DSA 1024]----+ | ||
+ | | .. ..=| | ||
+ | | | ||
+ | | ... | ||
+ | | o.. ..E.| | ||
+ | | S.o..oo .| | ||
+ | | .oo o.+. | | ||
+ | | . . =. | | ||
+ | | . | | ||
+ | | | | ||
+ | +-----------------+ | ||
+ | [trainee@centos7 ~]$ ssh-keygen -t rsa | ||
+ | Generating public/ | ||
+ | Enter file in which to save the key (/ | ||
+ | Enter passphrase (empty for no passphrase): | ||
+ | Enter same passphrase again: | ||
+ | Your identification has been saved in / | ||
+ | Your public key has been saved in / | ||
+ | The key fingerprint is: | ||
+ | 80: | ||
+ | The key's randomart image is: | ||
+ | +--[ RSA 2048]----+ | ||
+ | | +o=o.. | ||
+ | | * Xo+o. | | ||
+ | | . B.Bo. | | ||
+ | | | ||
+ | | o.S | | ||
+ | | | ||
+ | | | | ||
+ | | | | ||
+ | | | | ||
+ | +-----------------+ | ||
+ | [trainee@centos7 ~]$ ssh-keygen -t ecdsa | ||
+ | Generating public/ | ||
+ | Enter file in which to save the key (/ | ||
+ | Enter passphrase (empty | ||
+ | Enter same passphrase again: | ||
+ | Your identification has been saved in / | ||
+ | Your public key has been saved in / | ||
+ | The key fingerprint is: | ||
+ | 41: | ||
+ | The key's randomart image is: | ||
+ | +--[ECDSA | ||
+ | | ..... .. o+ | | ||
+ | | ... . .. o . | | ||
+ | |. .. . | ||
+ | | o E . = . | | ||
+ | | . | ||
+ | | . | ||
+ | | o . o . | | ||
+ | | . o . . | | ||
+ | | ..... . | | ||
+ | +-----------------+ | ||
+ | [trainee@centos7 ~]$ ssh-keygen | ||
+ | Generating public/ | ||
+ | Enter file in which to save the key (/ | ||
+ | Enter passphrase (empty for no passphrase): | ||
+ | Enter same passphrase again: | ||
+ | Your identification has been saved in / | ||
+ | Your public key has been saved in / | ||
+ | The key fingerprint is: | ||
+ | 66: | ||
+ | The key's randomart image is: | ||
+ | +--[ED25519 | ||
+ | | . . +..oo. | ||
+ | | o +..o. . | | ||
+ | | | ||
+ | | . . o . . | | ||
+ | | . . S + E | | ||
+ | | o = o + | | ||
+ | | . + | ||
+ | | | ||
+ | | | | ||
+ | +-----------------+ | ||
</ | </ | ||
- | =====L' | + | <WRAP center round important> |
+ | Les clés générées seront placées dans le répertoire **~/ | ||
+ | </ | ||
- | L' | + | ==Utilisation== |
- | ====Le Clavier et la Souris==== | + | La commande ssh prend la forme suivante: |
- | Historiquement, | + | ssh -l nom_de_compte numero_ip (nom_de_machine) |
- | ^ Paramètre ^ Description ^ | + | En saisissant cette commande sur votre propre machine, vous obtiendrez |
- | | Sticky Keys | Permet de maintenir les touches < | + | |
- | | Mouse Keys | Permet d' | + | |
- | | Bounce Keys | Permet de réduire l' | + | |
- | | Slow Keys | Necéssite qu'une touche soit enfoncée pour une durée plus longue avant que le système réagisse | | + | |
- | ====Claviers Visuels==== | + | < |
+ | [trainee@centos7 ~]$ su - | ||
+ | Mot de passe : | ||
+ | Dernière connexion : lundi 9 mai 2016 à 22:47:48 CEST sur pts/0 | ||
- | Un clavier visuel ou //Onscreen Keyboard// est un clavier qui est afficher à l'écran. Les touches sont activées en utilisant la souris. | + | [root@centos7 ~]# ssh -l trainee localhost |
+ | The authenticity of host 'localhost (127.0.0.1)' can't be established. | ||
+ | ECDSA key fingerprint is 19: | ||
+ | Are you sure you want to continue connecting (yes/no)? yes | ||
+ | Warning: Permanently added ' | ||
+ | trainee@localhost' | ||
+ | Last login: Mon May 9 23:25:15 2016 from localhost.localdomain | ||
+ | </ | ||
- | Un exemple connu du clavier visuel est **[[http:// | + | ===Tunnels SSH=== |
- | ====L' | + | 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é. |
- | En ce qui concerne | + | La commande pour créer un tunnel ssh prend la forme suivante : |
- | Il existe aussi des loupes telles **Kmag**. | + | ssh -N -f compte@hôte -Lport-local: |
- | ====Autres Technologies==== | + | Dans votre cas, vous allez créer un tunnel dans votre propre vm entre le port 15023 et le port 23 : |
- | Il existe aussi des logiciels | + | < |
+ | [root@centos7 ~]# ssh -N -f trainee@localhost -L15023: | ||
+ | trainee@localhost' | ||
+ | </ | ||
+ | |||
+ | Installez maintenant le client et le serveur telnet : | ||
+ | |||
+ | < | ||
+ | [root@centos7 ~]# yum install telnet telnet-server | ||
+ | </ | ||
+ | |||
+ | Telnet n'est ni démarré ni activé. | ||
+ | |||
+ | < | ||
+ | [root@centos7 ~]# systemctl status telnet.socket | ||
+ | ● telnet.socket - Telnet Server Activation Socket | ||
+ | | ||
+ | | ||
+ | Docs: man: | ||
+ | | ||
+ | | ||
+ | |||
+ | [root@centos7 ~]# systemctl start telnet.socket | ||
+ | |||
+ | [root@centos7 ~]# systemctl status telnet.socket | ||
+ | ● telnet.socket - Telnet Server Activation Socket | ||
+ | | ||
+ | | ||
+ | Docs: man: | ||
+ | | ||
+ | | ||
+ | |||
+ | 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/ | ||
+ | [root@centos7 ~]# systemctl status telnet.socket | ||
+ | ● telnet.socket - Telnet Server Activation Socket | ||
+ | | ||
+ | | ||
+ | Docs: man: | ||
+ | | ||
+ | | ||
+ | |||
+ | 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. | ||
+ | </ | ||
+ | |||
+ | Connectez-vous ensuite via telnet sur le port 15023, vous constaterez que votre connexion n' | ||
+ | |||
+ | < | ||
+ | [root@centos7 ~]# telnet localhost 15023 | ||
+ | Trying 127.0.0.1... | ||
+ | Connected to localhost. | ||
+ | Escape character is ' | ||
+ | |||
+ | Kernel 3.10.0-327.13.1.el7.x86_64 on an x86_64 | ||
+ | centos7 login: trainee | ||
+ | Password: | ||
+ | Last login: Mon May 9 23:26:32 from localhost.localdomain | ||
+ | [trainee@centos7 ~]$ | ||
+ | |||
+ | </ | ||
+ | |||
+ | <WRAP center round important> | ||
+ | Notez bien que votre communication telnet passe par le tunnel SSH. | ||
+ | </ | ||
+ | |||
+ | ====SCP==== | ||
+ | |||
+ | ===Introduction=== | ||
+ | |||
+ | La commande **scp** est le successeur | ||
+ | |||
+ | $ scp compte@numero_ip(nom_de_machine):/ | ||
+ | |||
+ | ou vers une machine distante : | ||
+ | |||
+ | $ scp / | ||
+ | |||
+ | ===Utilisation=== | ||
+ | |||
+ | Nous allons maintenant utiliser **scp** pour chercher un fichier sur le << | ||
+ | |||
+ | Créez le fichier **/ | ||
+ | |||
+ | < | ||
+ | [trainee@centos7 ~]$ pwd | ||
+ | / | ||
+ | [trainee@centos7 ~]$ touch scp_test | ||
+ | </ | ||
+ | |||
+ | Récupérez le fichier **scp_test** en utilisant scp : | ||
+ | |||
+ | < | ||
+ | [trainee@centos7 ~]$ touch /home/trainee/ | ||
+ | [trainee@centos7 ~]$ scp trainee@127.0.0.1:/ | ||
+ | The authenticity of host ' | ||
+ | ECDSA key fingerprint is 19: | ||
+ | Are you sure you want to continue connecting (yes/no)? yes | ||
+ | Warning: Permanently added ' | ||
+ | trainee@127.0.0.1' | ||
+ | scp_test | ||
+ | [trainee@centos7 ~]$ ls / | ||
+ | / | ||
+ | </ | ||
+ | |||
+ | ==Mise en place des clefs== | ||
+ | |||
+ | Il convient maintenant de se connecter sur le << | ||
+ | |||
+ | En saisissant cette commande, vous obtiendrez une fenêtre similaire à celle-ci : | ||
+ | |||
+ | < | ||
+ | [trainee@centos7 ~]$ ssh -l trainee 127.0.0.1 | ||
+ | trainee@127.0.0.1' | ||
+ | Last login: Mon May 9 23:42:46 2016 from localhost.localdomain | ||
+ | [trainee@centos7 ~]$ ls -la | grep .ssh | ||
+ | drwx------. | ||
+ | [trainee@centos7 ~]$ exit | ||
+ | logout | ||
+ | Connection to 127.0.0.1 closed. | ||
+ | </ | ||
+ | |||
+ | <WRAP center round important> | ||
+ | Si le dossier distant .ssh n' | ||
+ | </ | ||
+ | |||
+ | Ensuite, il convient de transférer le fichier local **.ssh/ | ||
+ | |||
+ | < | ||
+ | [trainee@centos7 ~]$ scp .ssh/ | ||
+ | trainee@127.0.0.1' | ||
+ | id_ecdsa.pub | ||
+ | </code> | ||
+ | |||
+ | Connectez-vous via telnet et insérer les clefs publiques restantes dans le fichier .ssh/ | ||
+ | |||
+ | < | ||
+ | root@centos7 ~]# ssh -l trainee localhost | ||
+ | trainee@localhost' | ||
+ | Last login: Tue May 10 01:39:33 2016 from localhost.localdomain | ||
+ | [trainee@centos7 ~]$ cat .ssh/ | ||
+ | [trainee@centos7 ~]$ cat .ssh/ | ||
+ | [trainee@centos7 ~]$ cat .ssh/ | ||
+ | [trainee@centos7 ~]$ cat .ssh/ | ||
+ | ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBG5BtOMFLrUbxD// | ||
+ | ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC9KOuEH5+kyihhm99Na8UTA4Gi5AfiOVeJyS3UzH7ta73ewmv7JZqaXzar1NlHcpEMkCUs2yKxHyO/ | ||
+ | ssh-dss AAAAB3NzaC1kc3MAAACBAK9/ | ||
+ | ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIENas3A3hmXFj1cb+lrn2NAt6g95Pla6qUFQHd1wg2y1 trainee@centos7.fenestros.loc | ||
+ | ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBG5BtOMFLrUbxD// | ||
+ | </ | ||
+ | |||
+ | Lors de la connexion suivante au serveur, l' | ||
+ | |||
+ | < | ||
+ | [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. | ||
+ | </ | ||
+ | |||
+ | <WRAP center round important> | ||
+ | Le fichier | ||
+ | </ | ||
----- | ----- | ||
- | < | + | |
- | <div align=" | + | Copyright © 2023 Hugh Norris. |
- | Copyright © 2020 Hugh Norris. | + | |
- | </ | + |