Différences
Ci-dessous, les différences entre deux révisions de la page.
Prochaine révision | Révision précédente | ||
elearning:workbooks:redhat:rh124:l111 [2024/09/25 08:05] – created admin | elearning:workbooks:redhat:rh124:l111 [2024/09/26 13:19] (Version actuelle) – admin | ||
---|---|---|---|
Ligne 5: | Ligne 5: | ||
Dernière mise-à-jour : ~~LASTMOD~~ | Dernière mise-à-jour : ~~LASTMOD~~ | ||
- | ======LCF513 | + | ======RH12412 |
=====Contenu du Module===== | =====Contenu du Module===== | ||
- | * **LCF513 | + | * **RH12412 |
* Contenu du Module | * Contenu du Module | ||
- | * Présentation | + | * Systemd |
- | * La Commande | + | * LAB #1 - La Commande |
- | * LAB #1 - Configuration | + | * LAB #2 - Fichiers de Configuration |
- | * 1.1 - Connections et Profils | + | * 2.1 - Fichiers de Configuration par Défaut |
- | * 1.2 - Résolution | + | * 2.2 - Surchargement |
- | * 1.3 - Ajouter une Deuxième Adresse IP à un Profil | + | * LAB #3 - La Commande |
- | * 1.4 - La Commande | + | * LAB #4 - Les Cibles Systemd |
- | * 1.5 - La Commande ip | + | * 4.1 - Contrôler les dépendances d'une Cible |
- | | + | * 4.2 - La Cible par Défaut |
- | * 1.7 - Routage Statique | + | * LAB #5 - Gestion des Services |
- | * La commande ip | + | * 5.1 - Gestion des Instances Uniques |
- | * Activer/ | + | * 5.2 - Gestion d' |
- | | + | * 5.3 - Interdire la Modification |
- | * 2.1 - ping | + | |
- | * 2.2 - netstat -i | + | |
- | | + | |
- | | + | |
- | * 3.1 - Telnet | + | |
- | * 3.2 - wget | + | |
- | * 3.3 - ftp | + | |
- | * 3.4 - SSH | + | |
- | * Présentation | + | |
- | * SSH-1 | + | |
- | * SSH-2 | + | |
- | * Authentification par mot de passe | + | |
- | * Authentification par clef asymétrique | + | |
- | * Configuration | + | |
- | * Configuration du Client | + | |
- | * Tunnels SSH | + | |
- | * 3.5 - SCP | + | |
- | * Présentation | + | |
- | * Utilisation | + | |
- | * 3.6 - Mise en Place des Clefs Asymétriques | + | |
- | =====Présentation===== | + | =====Systemd===== |
- | RHEL/CentOS 8 utilise | + | Les systèmes de démarrage antérieurs à Systemd, |
- | | + | **Systemd** essaie, par contre, de démarrer autant de services en parallèle que possible. Ceci est rendu possible car la majorité d' |
- | | + | |
- | <WRAP center round important 60%> | + | Au lieu de parler de scripts de démarrage et de niveaux d' |
- | **Important** : Notez qu' | + | |
- | </WRAP> | + | |
- | Le service | + | * **.automount** - active la fonctionalité d' |
+ | * **.device** - expose une périphérique dans systemd. | ||
+ | * **.mount** - contrôle quand et comment les systèmes de fichiers sont montés. | ||
+ | * **.path** - active un service | ||
+ | * **.service** - démarre, arrête, redémarre ou recharge un service. | ||
+ | * **.scope** - gère des services. | ||
+ | * **.slice** - regroupe des Unités dans une arborescence afin de limiter des ressources en utilisant des CGroups. | ||
+ | * **.snapshot** - un état sauvegardé du gestionnaire Systemd. | ||
+ | * **.socket** - permet aux Unités d' | ||
+ | * **.swap** - encapsule une périphérique ou un fichier swap. | ||
+ | * **.timer** - déclenche l' | ||
+ | * **.target** - regroupe des Unités multiples afin qu' | ||
- | < | + | Une Cible est en quelque sorte une **grande étape** dans le démarrage du système |
- | [root@centos8 ~]# systemctl status NetworkManager.service | + | |
- | ● NetworkManager.service - Network Manager | + | |
- | | + | |
- | | + | |
- | Docs: man: | + | |
- | Main PID: 1002 (NetworkManager) | + | |
- | Tasks: 3 (limit: 23535) | + | |
- | | + | |
- | | + | |
- | | + | |
- | Warning: Journal has been rotated since unit was started. Log output is incomplete or> | + | * **halt.target** - arrête le système. |
- | lines 1-11/11 (END) | + | * **poweroff.target** |
- | [^q] | + | * **shutdown.target** - arrête le système. |
- | </ | + | * **rescue.target** - démarre le système en mode single-user |
+ | * **emergency.target** - démarre le système en mode single-user (seul root peut s'y connecter). Uniquement le système de fichiers racine est monté en mode lecture seule. Le réseau n'est pas démarré. | ||
+ | * **multi-user.target** - démarre le système en mode multi-utilisateur avec tous les systèmes de fichiers montés et le service network démarré. | ||
+ | * **graphical.target** - démarre le système en multi-user.target puis démarre l' | ||
+ | * **hibernate.target** - sauvegarde l' | ||
+ | * **reboot.target** - redémarre le système. | ||
- | ===La Commande nmcli=== | + | **Systemd** utilise des Cibles d'une manière similaire à ce que **SysVinit** utilise des niveaux d' |
- | + | ||
- | La commande | + | |
- | + | ||
- | Les options et les sous-commandes peuvent être consultées en utilisant les commandes suivantes | + | |
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | Usage: nmcli [OPTIONS] OBJECT { COMMAND | help } | + | lrwxrwxrwx. 1 root root 15 Jul 18 13:00 / |
+ | lrwxrwxrwx. 1 root root 13 Jul 18 13:00 / | ||
+ | lrwxrwxrwx. 1 root root 17 Jul 18 13:00 / | ||
+ | lrwxrwxrwx. 1 root root 17 Jul 18 13:00 / | ||
+ | lrwxrwxrwx. 1 root root 17 Jul 18 13:00 / | ||
+ | lrwxrwxrwx. 1 root root 16 Jul 18 13:00 / | ||
+ | lrwxrwxrwx. 1 root root 13 Jul 18 13:00 / | ||
- | OPTIONS | + | / |
- | -a, --ask ask for missing parameters | + | total 0 |
- | -c, --colors auto|yes|no | + | |
- | -e, --escape yes|no | + | |
- | -f, --fields <field,...> | + | |
- | -g, --get-values < | + | |
- | -h, --help | + | |
- | -m, --mode tabular|multiline | + | |
- | -o, --overview | + | |
- | -p, --pretty | + | |
- | -s, --show-secrets | + | |
- | -t, --terse | + | |
- | -v, --version | + | |
- | -w, --wait < | + | |
- | OBJECT | + | / |
- | | + | total 0 |
- | n[etworking] | + | |
- | r[adio] | + | |
- | c[onnection] | + | |
- | d[evice] | + | |
- | a[gent] | + | |
- | m[onitor] | + | |
- | </ | + | |
- | =====LAB #1 - Configuration du Réseau===== | + | / |
+ | total 0 | ||
- | ====1.1 - Connections et Profils==== | + | / |
+ | total 0 | ||
- | NetworkManager inclus la notion de **connections** ou **profils** permettant des configurations différentes en fonction de la localisation. Pour voir les connections actuelles, utilisez la commande **nmcli c** avec la sous-commande **show** | + | / |
- | + | total 0 | |
- | < | + | |
- | [root@centos8 ~]# nmcli c show | + | |
- | NAME UUID TYPE DEVICE | + | |
- | ens18 | + | |
- | virbr0 | + | |
</ | </ | ||
- | Créez donc un profil IP fixe rattaché au périphérique **ens18** : | + | ====LAB #1 - La Commande systemctl==== |
- | < | + | Pour visualiser la liste des Unités, il convient d'utiliser la commande **systemctl** avec l'option **list-units** |
- | [root@centos8 ~]# nmcli connection add con-name ip_fixe ifname ens18 type ethernet ip4 10.0.2.46/ | + | |
- | Connection | + | |
- | </ | + | |
- | + | ||
- | Constatez sa présence | + | |
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | NAME | + | |
- | ens18 | + | proc-sys-fs-binfmt_misc.automount |
- | virbr0 | + | sys-devices-pci0000: |
- | ip_fixe | + | sys-devices-pci0000: |
+ | sys-devices-pci0000: | ||
+ | sys-devices-pci0000: | ||
+ | | ||
+ | sys-devices-platform-serial8250-tty-ttyS0.device | ||
+ | sys-devices-platform-serial8250-tty-ttyS1.device | ||
+ | sys-devices-platform-serial8250-tty-ttyS2.device | ||
+ | sys-devices-platform-serial8250-tty-ttyS3.device | ||
+ | sys-devices-virtual-block-dm\x2d0.device | ||
+ | sys-devices-virtual-block-dm\x2d1.device | ||
+ | sys-devices-virtual-misc-rfkill.device | ||
+ | sys-module-configfs.device | ||
+ | sys-module-fuse.device | ||
+ | sys-subsystem-net-devices-ens18.device | ||
+ | -.mount | ||
+ | | ||
+ | dev-hugepages.mount | ||
+ | dev-mqueue.mount | ||
+ | proc-sys-fs-binfmt_misc.mount | ||
+ | run-credentials-systemd\x2dsysctl.service.mount | ||
+ | | ||
+ | run-credentials-systemd\x2dtmpfiles\x2dsetup\x2ddev.service.mount | ||
+ | run-user-1000.mount | ||
+ | run-user-42.mount | ||
+ | sys-fs-fuse-connections.mount | ||
+ | sys-kernel-config.mount | ||
+ | sys-kernel-debug-tracing.mount | ||
+ | sys-kernel-debug.mount | ||
+ | sys-kernel-tracing.mount | ||
+ | cups.path | ||
+ | systemd-ask-password-plymouth.path | ||
+ | systemd-ask-password-wall.path | ||
+ | init.scope | ||
+ | session-4.scope | ||
+ | lines 1-37...skipping... | ||
+ | UNIT | ||
+ | proc-sys-fs-binfmt_misc.automount | ||
+ | sys-devices-pci0000: | ||
+ | sys-devices-pci0000: | ||
+ | sys-devices-pci0000: | ||
+ | sys-devices-pci0000: | ||
+ | sys-devices-pci0000: | ||
+ | sys-devices-platform-serial8250-tty-ttyS0.device | ||
+ | sys-devices-platform-serial8250-tty-ttyS1.device | ||
+ | sys-devices-platform-serial8250-tty-ttyS2.device | ||
+ | sys-devices-platform-serial8250-tty-ttyS3.device | ||
+ | sys-devices-virtual-block-dm\x2d0.device | ||
+ | sys-devices-virtual-block-dm\x2d1.device | ||
+ | sys-devices-virtual-misc-rfkill.device | ||
+ | sys-module-configfs.device | ||
+ | sys-module-fuse.device | ||
+ | sys-subsystem-net-devices-ens18.device | ||
+ | -.mount | ||
+ | boot.mount | ||
+ | dev-hugepages.mount | ||
+ | dev-mqueue.mount | ||
+ | proc-sys-fs-binfmt_misc.mount | ||
+ | run-credentials-systemd\x2dsysctl.service.mount | ||
+ | run-credentials-systemd\x2dtmpfiles\x2dsetup.service.mount | ||
+ | run-credentials-systemd\x2dtmpfiles\x2dsetup\x2ddev.service.mount | ||
+ | run-user-1000.mount | ||
+ | run-user-42.mount | ||
+ | sys-fs-fuse-connections.mount | ||
+ | sys-kernel-config.mount | ||
+ | sys-kernel-debug-tracing.mount | ||
+ | sys-kernel-debug.mount | ||
+ | sys-kernel-tracing.mount | ||
+ | cups.path | ||
+ | systemd-ask-password-plymouth.path | ||
+ | systemd-ask-password-wall.path | ||
+ | init.scope | ||
+ | session-4.scope | ||
+ | session-c1.scope | ||
+ | accounts-daemon.service | ||
+ | atd.service | ||
+ | auditd.service | ||
+ | avahi-daemon.service | ||
+ | colord.service | ||
+ | crond.service | ||
+ | cups.service | ||
+ | dbus-broker.service | ||
+ | dracut-shutdown.service | ||
+ | firewalld.service | ||
+ | gdm.service | ||
+ | irqbalance.service | ||
+ | iscsi.service | ||
+ | kdump.service | ||
+ | kmod-static-nodes.service | ||
+ | libstoragemgmt.service | ||
+ | lvm2-monitor.service | ||
+ | lines 1-55 | ||
</ | </ | ||
- | Notez que la sortie n' | + | Pour consulter |
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | GENERAL.DEVICE: | + | ● boot.automount |
- | GENERAL.TYPE: | + | ● home.mount |
- | GENERAL.HWADDR: | + | ● sysroot.mount not-found inactive dead sysroot.mount |
- | GENERAL.MTU: 1500 | + | tmp.mount loaded |
- | GENERAL.STATE: | + | ● var.mount not-found inactive dead var.mount |
- | GENERAL.CONNECTION: | + | |
- | GENERAL.CON-PATH: / | + | |
- | WIRED-PROPERTIES.CARRIER: | + | |
- | IP4.ADDRESS[1]: | + | ● auto-cpufreq.service |
- | IP4.GATEWAY: | + | ● autofs.service |
- | IP4.ROUTE[1]: | + | |
- | IP4.ROUTE[2]: | + | |
- | IP4.DNS[1]: | + | |
- | IP6.ADDRESS[1]: | + | dnf-makecache.service |
- | IP6.GATEWAY: | + | |
- | IP6.ROUTE[1]: | + | |
- | IP6.ROUTE[2]: | + | |
- | + | | |
- | GENERAL.DEVICE: | + | |
- | GENERAL.TYPE: | + | |
- | GENERAL.HWADDR: | + | |
- | GENERAL.MTU: 1500 | + | |
- | GENERAL.STATE: | + | ● ebtables.service |
- | GENERAL.CONNECTION: | + | |
- | GENERAL.CON-PATH: / | + | ● fcoe.service |
- | IP4.ADDRESS[1]: | + | getty@tty1.service |
- | IP4.GATEWAY: | + | |
- | IP4.ROUTE[1]: | + | initrd-parse-etc.service |
- | IP6.GATEWAY: | + | |
- | + | initrd-udevadm-cleanup-db.service | |
- | GENERAL.DEVICE: | + | insights-client-boot.service |
- | GENERAL.TYPE: | + | ● ip6tables.service |
- | GENERAL.HWADDR: | + | ● ipset.service |
- | GENERAL.MTU: 65536 | + | ● iptables.service |
- | GENERAL.STATE: | + | |
- | GENERAL.CONNECTION: | + | |
- | GENERAL.CON-PATH: | + | |
- | IP4.ADDRESS[1]: | + | |
- | IP4.GATEWAY: | + | |
- | IP6.ADDRESS[1]: | + | |
- | IP6.GATEWAY: | + | |
- | IP6.ROUTE[1]: | + | logrotate.service |
- | + | low-memory-monitor.service | |
- | GENERAL.DEVICE: | + | ● lvm2-activation-early.service |
- | GENERAL.TYPE: tun | + | |
- | GENERAL.HWADDR: | + | |
- | GENERAL.MTU: 1500 | + | |
- | GENERAL.STATE: | + | mlocate-updatedb.service |
- | GENERAL.CONNECTION: | + | |
- | GENERAL.CON-PATH: -- | + | |
- | lines 28-50/50 (END) | + | |
+ | | ||
+ | ● network.service | ||
+ | | ||
+ | ● nslcd.service | ||
+ | --More-- | ||
[q] | [q] | ||
</ | </ | ||
- | Pour activer | + | Les points noirs au début de certaines lignes dans la sortie ci-dessus sont en réalité des points blancs à l' |
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
+ | Unit network.service could not be found. | ||
</ | </ | ||
- | Notez que votre terminal est bloqué à cause du changement de l' | + | Pour consulter |
- | + | ||
- | <WRAP center round todo 60%> | + | |
- | **A faire** - Revenez à l' | + | |
- | </ | + | |
- | + | ||
- | Le profil ip_fixe est maintenant activé tandis que le profil enp0s3 a été désactivé | + | |
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | NAME | + | UNIT FILE STATE |
- | ip_fixe | + | proc-sys-fs-binfmt_misc.automount |
- | virbr0 | + | -.mount |
- | ens18 fc4a4d23-b15e-47a7-bcfa-b2e08f49553e | + | boot.mount |
- | | + | dev-hugepages.mount |
- | [root@centos8 ~]# nmcli d show | + | dev-mqueue.mount |
- | GENERAL.DEVICE: | + | proc-sys-fs-binfmt_misc.mount |
- | GENERAL.TYPE: | + | run-vmblock\x2dfuse.mount |
- | GENERAL.HWADDR: | + | sys-fs-fuse-connections.mount |
- | GENERAL.MTU: 1500 | + | sys-kernel-config.mount |
- | GENERAL.STATE: | + | sys-kernel-debug.mount |
- | GENERAL.CONNECTION: | + | sys-kernel-tracing.mount |
- | GENERAL.CON-PATH: / | + | tmp.mount disabled |
- | WIRED-PROPERTIES.CARRIER: | + | cups.path enabled |
- | IP4.ADDRESS[1]: | + | insights-client-results.path |
- | IP4.GATEWAY: | + | ostree-finalize-staged.path disabled |
- | IP4.ROUTE[1]: | + | systemd-ask-password-console.path static |
- | IP4.ROUTE[2]: | + | systemd-ask-password-plymouth.path |
- | IP6.ADDRESS[1]: | + | systemd-ask-password-wall.path |
- | IP6.GATEWAY: | + | session-4.scope transient |
- | IP6.ROUTE[1]: | + | session-c1.scope |
- | IP6.ROUTE[2]: | + | accounts-daemon.service |
- | + | alsa-restore.service | |
- | GENERAL.DEVICE: | + | alsa-state.service |
- | GENERAL.TYPE: | + | arp-ethers.service |
- | GENERAL.HWADDR: | + | atd.service |
- | GENERAL.MTU: 1500 | + | auditd.service |
- | GENERAL.STATE: | + | autovt@.service |
- | GENERAL.CONNECTION: | + | avahi-daemon.service |
- | GENERAL.CON-PATH: / | + | blk-availability.service |
- | IP4.ADDRESS[1]: | + | bluetooth.service |
- | IP4.GATEWAY: | + | bolt.service |
- | IP4.ROUTE[1]: | + | brltty.service |
- | IP6.GATEWAY: | + | canberra-system-bootup.service |
- | + | canberra-system-shutdown-reboot.service | |
- | GENERAL.DEVICE: | + | canberra-system-shutdown.service |
- | GENERAL.TYPE: | + | chrony-wait.service |
- | GENERAL.HWADDR: | + | chronyd-restricted.service |
- | GENERAL.MTU: 65536 | + | chronyd.service |
- | GENERAL.STATE: | + | cni-dhcp.service |
- | GENERAL.CONNECTION: | + | cockpit-motd.service |
- | GENERAL.CON-PATH: -- | + | cockpit-wsinstance-http.service |
- | IP4.ADDRESS[1]: | + | cockpit-wsinstance-https-factory@.service |
- | IP4.GATEWAY: | + | cockpit-wsinstance-https@.service |
- | IP6.ADDRESS[1]: | + | cockpit.service |
- | IP6.GATEWAY: | + | colord.service |
- | IP6.ROUTE[1]: | + | configure-printer@.service |
- | + | console-getty.service | |
- | GENERAL.DEVICE: | + | container-getty@.service |
- | GENERAL.TYPE: | + | cpupower.service |
- | GENERAL.HWADDR: | + | crond.service |
- | GENERAL.MTU: 1500 | + | cups-browsed.service |
- | GENERAL.STATE: | + | cups.service |
- | GENERAL.CONNECTION: | + | dbus-broker.service |
- | GENERAL.CON-PATH: -- | + | dbus-daemon.service |
- | lines 27-49/49 (END) | + | --More-- |
[q] | [q] | ||
</ | </ | ||
- | Pour consulter | + | Pour visualiser |
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | =============================================================================== | + | UNIT FILE |
- | Connection profile details (ens18) | + | -.mount |
- | =============================================================================== | + | boot.mount generated |
- | connection.id: | + | dev-hugepages.mount |
- | connection.uuid: | + | dev-mqueue.mount static |
- | connection.stable-id: | + | proc-sys-fs-binfmt_misc.mount disabled |
- | connection.type: | + | run-vmblock\x2dfuse.mount |
- | connection.interface-name: | + | sys-fs-fuse-connections.mount static |
- | connection.autoconnect: | + | sys-kernel-config.mount |
- | connection.autoconnect-priority: | + | sys-kernel-debug.mount static |
- | connection.autoconnect-retries: | + | sys-kernel-tracing.mount static |
- | connection.multi-connect: | + | tmp.mount disabled |
- | connection.auth-retries: | + | |
- | connection.timestamp: | + | 11 unit files listed. |
- | connection.read-only: | + | |
- | connection.permissions: | + | |
- | connection.zone: | + | |
- | connection.master: | + | |
- | connection.slave-type: | + | |
- | connection.autoconnect-slaves: | + | |
- | connection.secondaries: | + | |
- | connection.gateway-ping-timeout: | + | |
- | connection.metered: | + | |
- | connection.lldp: | + | |
- | connection.mdns: | + | |
- | connection.llmnr: | + | |
- | connection.wait-device-timeout: | + | |
- | ------------------------------------------------------------------------------- | + | |
- | 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.generate-mac-address-mask: | + | |
- | 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.dns-options: | + | |
- | ipv4.dns-priority: | + | |
- | ipv4.addresses: | + | |
- | ipv4.gateway: | + | |
- | ipv4.routes: | + | |
- | ipv4.route-metric: | + | |
- | ipv4.route-table: | + | |
- | ipv4.routing-rules: | + | |
- | ipv4.ignore-auto-routes: | + | |
- | ipv4.ignore-auto-dns: | + | |
- | ipv4.dhcp-client-id: | + | |
- | ipv4.dhcp-iaid: | + | |
- | ipv4.dhcp-timeout: | + | |
- | ipv4.dhcp-send-hostname: | + | |
- | ipv4.dhcp-hostname: | + | |
- | ipv4.dhcp-fqdn: | + | |
- | ipv4.dhcp-hostname-flags: | + | |
- | ipv4.never-default: | + | |
- | ipv4.may-fail: | + | |
- | ipv4.dad-timeout: | + | |
- | ipv4.dhcp-vendor-class-identifier: | + | |
- | ipv4.dhcp-reject-servers: | + | |
- | ------------------------------------------------------------------------------- | + | |
- | ipv6.method: | + | |
- | ipv6.dns: | + | |
- | ipv6.dns-search: | + | |
- | ipv6.dns-options: | + | |
- | ipv6.dns-priority: | + | |
- | ipv6.addresses: | + | |
- | ipv6.gateway: | + | |
- | ipv6.routes: | + | |
- | ipv6.route-metric: | + | |
- | ipv6.route-table: | + | |
- | ipv6.routing-rules: | + | |
- | ipv6.ignore-auto-routes: | + | |
- | ipv6.ignore-auto-dns: | + | |
- | ipv6.never-default: | + | |
- | ipv6.may-fail: | + | |
- | ipv6.ip6-privacy: | + | |
- | ipv6.addr-gen-mode: | + | |
- | ipv6.ra-timeout: | + | |
- | ipv6.dhcp-duid: | + | |
- | ipv6.dhcp-iaid: | + | |
- | ipv6.dhcp-timeout: | + | |
- | ipv6.dhcp-send-hostname: | + | |
- | ipv6.dhcp-hostname: | + | |
- | ipv6.dhcp-hostname-flags: | + | |
- | ipv6.token: | + | |
- | ------------------------------------------------------------------------------- | + | |
- | proxy.method: | + | |
- | proxy.browser-only: | + | |
- | proxy.pac-url: | + | |
- | proxy.pac-script: | + | |
- | ------------------------------------------------------------------------------- | + | |
- | lines 56-100/100 (END) | + | |
- | [q] | + | |
</ | </ | ||
- | De même, pour consulter | + | Dans la colonne STATE on voit les mots **static** et **generated**. |
- | < | + | |
- | [root@centos8 ~]# nmcli -p connection show ip_fixe | + | * Ceci implique que l' |
- | =============================================================================== | + | |
- | | + | |
- | =============================================================================== | + | |
- | connection.id: | + | |
- | connection.uuid: | + | |
- | connection.stable-id: | + | |
- | connection.type: | + | |
- | connection.interface-name: | + | |
- | connection.autoconnect: | + | |
- | connection.autoconnect-priority: | + | |
- | connection.autoconnect-retries: | + | |
- | connection.multi-connect: | + | |
- | connection.auth-retries: | + | |
- | 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: | + | |
- | connection.lldp: | + | |
- | connection.mdns: | + | |
- | connection.llmnr: | + | |
- | connection.wait-device-timeout: | + | |
- | ------------------------------------------------------------------------------- | + | |
- | 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.generate-mac-address-mask: | + | |
- | 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.dns-options: | + | |
- | ipv4.dns-priority: | + | |
- | ipv4.addresses: | + | |
- | ipv4.gateway: | + | |
- | ipv4.routes: | + | |
- | ipv4.route-metric: | + | |
- | ipv4.route-table: | + | |
- | ipv4.routing-rules: | + | |
- | ipv4.ignore-auto-routes: | + | |
- | ipv4.ignore-auto-dns: | + | |
- | ipv4.dhcp-client-id: | + | |
- | ipv4.dhcp-iaid: | + | |
- | ipv4.dhcp-timeout: | + | |
- | ipv4.dhcp-send-hostname: | + | |
- | ipv4.dhcp-hostname: | + | |
- | ipv4.dhcp-fqdn: | + | |
- | ipv4.dhcp-hostname-flags: | + | |
- | ipv4.never-default: | + | |
- | ipv4.may-fail: | + | |
- | ipv4.dad-timeout: | + | |
- | ipv4.dhcp-vendor-class-identifier: | + | |
- | ipv4.dhcp-reject-servers: | + | |
- | ------------------------------------------------------------------------------- | + | |
- | ipv6.method: | + | |
- | ipv6.dns: | + | |
- | ipv6.dns-search: | + | |
- | ipv6.dns-options: | + | |
- | ipv6.dns-priority: | + | |
- | ipv6.addresses: | + | |
- | ipv6.gateway: | + | |
- | ipv6.routes: | + | |
- | ipv6.route-metric: | + | |
- | ipv6.route-table: | + | |
- | ipv6.routing-rules: | + | |
- | ipv6.ignore-auto-routes: | + | |
- | ipv6.ignore-auto-dns: | + | |
- | ipv6.never-default: | + | |
- | ipv6.may-fail: | + | |
- | ipv6.ip6-privacy: | + | |
- | ipv6.addr-gen-mode: | + | |
- | ipv6.ra-timeout: | + | |
- | ipv6.dhcp-duid: | + | |
- | ipv6.dhcp-iaid: | + | |
- | ipv6.dhcp-timeout: | + | |
- | ipv6.dhcp-send-hostname: | + | |
- | ipv6.dhcp-hostname: | + | |
- | ipv6.dhcp-hostname-flags: | + | |
- | ipv6.token: | + | |
- | ------------------------------------------------------------------------------- | + | |
- | proxy.method: | + | |
- | proxy.browser-only: | + | |
- | proxy.pac-url: | + | |
- | proxy.pac-script: | + | |
- | ------------------------------------------------------------------------------- | + | |
- | =============================================================================== | + | |
- | Activate connection details (0f48c74d-5d16-4c37-8220-24644507b589) | + | |
- | =============================================================================== | + | |
- | GENERAL.NAME: | + | |
- | GENERAL.UUID: | + | |
- | GENERAL.DEVICES: | + | |
- | GENERAL.IP-IFACE: | + | |
- | GENERAL.STATE: activated | + | |
- | GENERAL.DEFAULT: | + | |
- | GENERAL.DEFAULT6: | + | |
- | GENERAL.SPEC-OBJECT: | + | |
- | GENERAL.VPN: | + | |
- | GENERAL.DBUS-PATH: | + | |
- | GENERAL.CON-PATH: | + | |
- | GENERAL.ZONE: | + | |
- | GENERAL.MASTER-PATH: | + | |
- | ------------------------------------------------------------------------------- | + | |
- | IP4.ADDRESS[1]: | + | |
- | IP4.GATEWAY: | + | |
- | IP4.ROUTE[1]: | + | |
- | IP4.ROUTE[2]: | + | |
- | ------------------------------------------------------------------------------- | + | |
- | IP6.ADDRESS[1]: | + | |
- | IP6.GATEWAY: | + | |
- | IP6.ROUTE[1]: | + | |
- | IP6.ROUTE[2]: | + | |
- | ------------------------------------------------------------------------------- | + | |
- | lines 83-127/127 (END) | + | |
- | [q] | + | |
- | </ | + | |
- | Pour consulter la liste profils associés à un périphérique, utilisez | + | * STATE = generated |
+ | * Ceci implique que le fichier a été généré automatiquement en utilisant les informations dans le fichier **/ | ||
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | CONNECTIONS.AVAILABLE-CONNECTION-PATHS: | + | -rwxr-xr-x. 1 root root 57696 Jul 18 13:01 / |
- | CONNECTIONS.AVAILABLE-CONNECTIONS[1]: | + | |
- | CONNECTIONS.AVAILABLE-CONNECTIONS[2]: 0f48c74d-5d16-4c37-8220-24644507b589 | ip_fixe | + | |
</ | </ | ||
- | Les fichiers | + | Il existe aussi d' |
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | -rw-r--r--. 1 root root 417 Jun 16 06:39 ifcfg-ens18 | + | total 396 |
- | -rw-r--r--. 1 root root 326 Aug 29 03:58 ifcfg-ip_fixe | + | -rwxr-xr-x. 1 root root 541 Jul 24 06:08 kdump-dep-generator.sh |
+ | -rwxr-xr-x. 1 root root 15832 May 17 18:27 ostree-system-generator | ||
+ | lrwxrwxrwx. 1 root root 31 Aug 8 10:54 podman-system-generator -> ../ | ||
+ | -rwxr-xr-x. 1 root root 1005 Feb 19 2024 selinux-autorelabel-generator.sh | ||
+ | -rwxr-xr-x. 1 root root 15624 Jul 18 13:01 systemd-bless-boot-generator | ||
+ | -rwxr-xr-x. 1 root root 40920 Jul 18 13:01 systemd-cryptsetup-generator | ||
+ | -rwxr-xr-x. 1 root root 24312 Jul 18 13:01 systemd-debug-generator | ||
+ | -rwxr-xr-x. 1 root root 57696 Jul 18 13:01 systemd-fstab-generator | ||
+ | -rwxr-xr-x. 1 root root 24096 Jul 18 13:01 systemd-getty-generator | ||
+ | -rwxr-xr-x. 1 root root 36496 Jul 18 13:01 systemd-gpt-auto-generator | ||
+ | -rwxr-xr-x. 1 root root 16096 Jul 18 13:01 systemd-hibernate-resume-generator | ||
+ | -rwxr-xr-x. 1 root root 24240 Jul 18 13:01 systemd-integritysetup-generator | ||
+ | -rwxr-xr-x. 1 root root 15632 Jul 18 13:01 systemd-rc-local-generator | ||
+ | -rwxr-xr-x. 1 root root 24296 Jul 18 13:01 systemd-run-generator | ||
+ | -rwxr-xr-x. 1 root root 15824 Jul 18 13:01 systemd-system-update-generator | ||
+ | -rwxr-xr-x. 1 root root 36424 Jul 18 13:01 systemd-sysv-generator | ||
+ | -rwxr-xr-x. 1 root root 36872 Jul 18 13:01 systemd-veritysetup-generator | ||
</ | </ | ||
- | ====1.2 - Résolution des Noms==== | + | Les options de la commande |
- | + | ||
- | L' | + | |
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | TYPE=Ethernet | + | systemctl [OPTIONS...] COMMAND |
- | PROXY_METHOD=none | + | |
- | BROWSER_ONLY=no | + | |
- | BOOTPROTO=none | + | |
- | IPADDR=10.0.2.46 | + | |
- | PREFIX=24 | + | |
- | GATEWAY=10.0.2.1 | + | |
- | DEFROUTE=yes | + | |
- | IPV4_FAILURE_FATAL=no | + | |
- | IPV6INIT=yes | + | |
- | IPV6_AUTOCONF=yes | + | |
- | IPV6_DEFROUTE=yes | + | |
- | IPV6_FAILURE_FATAL=no | + | |
- | IPV6_ADDR_GEN_MODE=stable-privacy | + | |
- | NAME=ip_fixe | + | |
- | UUID=0f48c74d-5d16-4c37-8220-24644507b589 | + | |
- | DEVICE=ens18 | + | |
- | ONBOOT=yes | + | |
- | </ | + | |
- | La résolution des noms est donc inactive : | + | Query or send control commands to the system manager. |
- | < | + | Unit Commands: |
- | [root@centos8 ~]# ping www.free.fr | + | |
- | ping: www.free.fr: Name or service | + | list-automounts [PATTERN...] List automount units currently in memory, |
+ | | ||
+ | list-sockets [PATTERN...] List socket units currently in memory, | ||
+ | ordered by address | ||
+ | list-timers [PATTERN...] | ||
+ | ordered by next elapse | ||
+ | is-active PATTERN... | ||
+ | is-failed PATTERN... | ||
+ | status [PATTERN...|PID...] | ||
+ | show [PATTERN...|JOB...] | ||
+ | units/jobs or the manager | ||
+ | cat PATTERN... | ||
+ | help PATTERN...|PID... | ||
+ | list-dependencies [UNIT...] | ||
+ | or wanted by the units or by which those | ||
+ | units are required or wanted | ||
+ | start UNIT... | ||
+ | stop UNIT... | ||
+ | reload UNIT... | ||
+ | restart UNIT... | ||
+ | try-restart UNIT... | ||
+ | reload-or-restart UNIT... | ||
+ | otherwise start or restart | ||
+ | try-reload-or-restart UNIT... | ||
+ | if supported, otherwise restart | ||
+ | isolate UNIT Start one unit and stop all others | ||
+ | kill UNIT... | ||
+ | clean UNIT... | ||
+ | configuration of unit | ||
+ | freeze PATTERN... | ||
+ | thaw PATTERN... | ||
+ | set-property UNIT PROPERTY=VALUE... Sets one or more properties of a unit | ||
+ | bind UNIT PATH [PATH] | ||
+ | unit's namespace | ||
+ | mount-image UNIT PATH [PATH [OPTS]] Mount an image from the host into a | ||
+ | unit's namespace | ||
+ | | ||
+ | service-log-target SERVICE [TARGET] Get/set logging target for service | ||
+ | reset-failed [PATTERN...] | ||
+ | units | ||
+ | Unit File Commands: | ||
+ | list-unit-files [PATTERN...] | ||
+ | enable [UNIT...|PATH...] | ||
+ | disable UNIT... | ||
+ | reenable UNIT... | ||
+ | preset UNIT... | ||
+ | based on preset configuration | ||
+ | preset-all | ||
+ | preset configuration | ||
+ | lines 1-55 | ||
</ | </ | ||
- | Modifiez donc la configuration du profil **ip_fixe** : | + | ====LAB #2 - Fichiers de Configuration==== |
- | < | + | ===2.1 - Fichiers de Configuration par Défaut=== |
- | [root@centos8 ~]# nmcli connection mod ip_fixe ipv4.dns 8.8.8.8 | + | |
- | </ | + | |
- | L' | + | Les fichiers de configuration des Cibles et fichiers de configuration des Unités installés par des paquets se trouvent dans le répertoire |
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | TYPE=Ethernet | + | / |
- | PROXY_METHOD=none | + | |
- | BROWSER_ONLY=no | + | |
- | BOOTPROTO=none | + | |
- | IPADDR=10.0.2.46 | + | |
- | PREFIX=24 | + | |
- | GATEWAY=10.0.2.1 | + | |
- | DEFROUTE=yes | + | |
- | IPV4_FAILURE_FATAL=no | + | |
- | IPV6INIT=yes | + | |
- | IPV6_AUTOCONF=yes | + | |
- | IPV6_DEFROUTE=yes | + | |
- | IPV6_FAILURE_FATAL=no | + | |
- | IPV6_ADDR_GEN_MODE=stable-privacy | + | |
- | NAME=ip_fixe | + | |
- | UUID=0f48c74d-5d16-4c37-8220-24644507b589 | + | |
- | DEVICE=ens18 | + | |
- | ONBOOT=yes | + | |
- | DNS1=8.8.8.8 | + | |
</ | </ | ||
- | |||
- | Afin que la modification du serveur DNS soit prise en compte, re-démarrez le service NetworkManager : | ||
< | < | ||
- | root@centos8 | + | [root@redhat9 |
- | [root@centos8 ~]# systemctl status NetworkManager.service | + | total 1584 |
- | ● NetworkManager.service - Network Manager | + | -rw-r--r--. 1 root root 729 Feb 24 2022 accounts-daemon.service |
- | Loaded: loaded (/ | + | -rw-r--r--. 1 root root 480 Jan 16 2024 alsa-restore.service |
- | Active: active (running) since Sun 2021-08-29 04:15:11 EDT; 8s ago | + | -rw-r--r--. 1 root root 465 Jan 16 2024 alsa-state.service |
- | Docs: man: | + | -rw-r--r--. 1 root root 275 Aug 10 2021 arp-ethers.service |
- | Main PID: 973390 (NetworkManager) | + | -rw-r--r--. 1 root root 274 Apr 4 2022 atd.service |
- | | + | -rw-r--r--. 1 root root 1771 Nov 8 2023 auditd.service |
- | Memory: 4.6M | + | lrwxrwxrwx. 1 root root |
- | CGroup: /system.slice/ | + | -rw-r--r--. 1 root root 1044 Nov 8 2023 avahi-daemon.service |
- | └─973390 / | + | -rw-r--r--. 1 root root 870 Nov |
- | + | -rw-r--r--. 1 root root 964 Jul 18 13:00 basic.target | |
- | Aug 29 04:15:12 centos8.ittraining.loc NetworkManager[973390]: | + | drwxr-xr-x. 2 root root 6 Jul 18 13:00 basic.target.wants |
- | Aug 29 04:15:12 centos8.ittraining.loc NetworkManager[973390]: | + | -r--r--r--. 1 root root 384 Feb 3 2024 blk-availability.service |
- | Aug 29 04:15:12 centos8.ittraining.loc NetworkManager[973390]: < | + | -rw-r--r--. 1 root root 449 Oct 31 2022 blockdev@.target |
- | Aug 29 04:15:12 centos8.ittraining.loc NetworkManager[973390]: < | + | -rw-r--r--. 1 root root 707 Jun 14 2022 bluetooth.service |
- | Aug 29 04:15:12 centos8.ittraining.loc NetworkManager[973390]: < | + | -rw-r--r--. 1 root root 435 Oct 31 2022 bluetooth.target |
- | Aug 29 04:15:12 centos8.ittraining.loc NetworkManager[973390]: | + | -rw-r--r--. 1 root root 642 Jan 16 2023 bolt.service |
- | Aug 29 04:15:12 centos8.ittraining.loc NetworkManager[973390]: < | + | -rw-r--r--. 1 root root 463 Oct 31 2022 boot-complete.target |
- | Aug 29 04:15:12 centos8.ittraining.loc NetworkManager[973390]: <info> | + | -rw-r--r--. 1 root root 217 Aug |
- | Aug 29 04:15:12 centos8.ittraining.loc NetworkManager[973390]: < | + | -rw-r--r--. 1 root root 491 Jul 13 2023 canberra-system-bootup.service |
- | Aug 29 04:15:12 centos8.ittraining.loc NetworkManager[973390]: <info> | + | -rw-r--r--. 1 root root 509 Jul 13 2023 canberra-system-shutdown-reboot.service |
- | lines 1-20/20 (END) | + | -rw-r--r--. 1 root root 466 Jul 13 2023 canberra-system-shutdown.service |
+ | -rw-r--r--. 1 root root 1811 Jan 23 2024 chronyd-restricted.service | ||
+ | -rw-r--r--. 1 root root 1468 Jan 23 2024 chronyd.service | ||
+ | -rw-r--r--. 1 root root 1082 Jan 23 2024 chrony-wait.service | ||
+ | -rw-r--r--. 1 root root 277 Jul 23 09:37 cni-dhcp.service | ||
+ | -rw-r--r--. 1 root root 302 Dec 4 2023 cni-dhcp.socket | ||
+ | -rw-r--r--. 1 root root 222 Apr 2 05:45 cockpit-motd.service | ||
+ | -rw-r--r--. 1 root root 720 Apr 2 05:45 cockpit.service | ||
+ | -rw-r--r--. 1 root root 349 Apr 2 05:45 cockpit.socket | ||
+ | -rw-r--r--. 1 root root 221 Apr 2 05:45 cockpit-wsinstance-http.service | ||
+ | -rw-r--r--. 1 root root 165 Apr 2 05:45 cockpit-wsinstance-https-factory@.service | ||
+ | -rw-r--r--. 1 root root 244 Apr 2 05:45 cockpit-wsinstance-https-factory.socket | ||
+ | -rw-r--r--. 1 root root 215 Apr 2 05:45 cockpit-wsinstance-http.socket | ||
+ | -rw-r--r--. 1 root root 264 Apr 2 05:45 cockpit-wsinstance-https@.service | ||
+ | -rw-r--r--. 1 root root 478 Apr 2 05:45 cockpit-wsinstance-https@.socket | ||
+ | -rw-r--r--. 1 root root 295 Aug | ||
+ | -rw-r--r--. 1 root root 154 Aug 11 2021 configure-printer@.service | ||
+ | -rw-r--r--. 1 root root 1102 Jul 18 13:00 console-getty.service | ||
+ | -rw-r--r--. 1 root root 1254 Jul 18 13:00 container-getty@.service | ||
+ | -rw-r--r--. 1 root root 294 Sep 13 18:49 cpupower.service | ||
+ | -rw-r--r--. 1 root root 371 Nov 30 2023 crond.service | ||
+ | -rw-r--r--. 1 root root 473 Oct 31 2022 cryptsetup-pre.target | ||
+ | -rw-r--r--. 1 root root 420 Oct 31 2022 cryptsetup.target | ||
+ | lrwxrwxrwx. 1 root root 13 Jul 18 13:00 ctrl-alt-del.target -> reboot.target | ||
+ | -rw-r--r--. 1 root root 234 Jan 7 2021 cups-browsed.service | ||
+ | -rw-r--r--. 1 root root 142 Jun 19 11:00 cups.path | ||
+ | -rw-r--r--. 1 root root 298 Jun 19 11:00 cups.service | ||
+ | drwxr-xr-x. 2 root root 25 Sep 25 12:03 cups.service.d | ||
+ | -rw-r--r--. 1 root root 148 Jun 19 11:00 cups.socket | ||
+ | -rw-r--r--. 1 root root 529 Aug 23 2022 dbus-broker.service | ||
+ | -rw-r--r--. 1 root root 560 Jun 12 2023 dbus-daemon.service | ||
+ | lrwxrwxrwx. 1 root root 25 Jul 18 13:00 dbus-org.freedesktop.hostname1.service -> systemd-hostnamed.service | ||
+ | lrwxrwxrwx. 1 root root 23 Jul 18 13:00 dbus-org.freedesktop.locale1.service -> systemd-localed.service | ||
+ | lrwxrwxrwx. | ||
+ | --More-- | ||
[q] | [q] | ||
</ | </ | ||
- | Vérifiez que le fichier | + | Certains fichiers de configuration sont créés à la volée dans le répertoire |
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | # Generated by NetworkManager | + | total 0 |
- | search ittraining.loc | + | |
- | nameserver 8.8.8.8 | + | |
</ | </ | ||
- | Dernièrement vérifiez la resolution | + | Les fichiers de configuration |
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | PING www.free.fr (212.27.48.10) 56(84) bytes of data. | + | /usr/lib/systemd/user |
- | 64 bytes from www.free.fr (212.27.48.10): | + | |
- | 64 bytes from www.free.fr (212.27.48.10): | + | |
- | 64 bytes from www.free.fr (212.27.48.10): | + | |
- | 64 bytes from www.free.fr (212.27.48.10): | + | |
- | ^C | + | |
- | --- www.free.fr ping statistics | + | |
- | 4 packets transmitted, | + | |
- | rtt min/avg/ | + | |
</ | </ | ||
<WRAP center round important 60%> | <WRAP center round important 60%> | ||
- | **Important** : Notez qu'il existe un front-end graphique en mode texte, | + | **Important** : De cette façon les fichiers dans **/ |
</ | </ | ||
- | ====1.3 - Ajouter une Deuxième Adresse IP à un Profil==== | + | Prenons le cas du service **sshd** qui est configuré par le fichier **/usr/ |
- | + | ||
- | Pour ajouter une deuxième adresse IP à un profil sous RHEL/CentOS 8, il convient d' | + | |
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | </ | + | [Unit] |
+ | Description=OpenSSH server daemon | ||
+ | Documentation=man: | ||
+ | After=network.target sshd-keygen.target | ||
+ | Wants=sshd-keygen.target | ||
- | Rechargez la configuration du profil : | + | [Service] |
+ | Type=notify | ||
+ | EnvironmentFile=-/ | ||
+ | ExecStart=/ | ||
+ | ExecReload=/ | ||
+ | KillMode=process | ||
+ | Restart=on-failure | ||
+ | RestartSec=42s | ||
- | < | + | [Install] |
- | [root@centos8 ~]# nmcli con up ip_fixe | + | WantedBy=multi-user.target |
</ | </ | ||
- | Saisissez ensuite | + | Dans le fichier on peut noter la présence des lignes suivantes dans la section **[Unit]** |
- | < | + | |
- | [root@centos8 ~]# nmcli connection show ip_fixe | + | |
- | connection.id: | + | * **Documentation=man:sshd(8) man:sshd_config(5)**, |
- | connection.uuid: | + | * Cette directive stipule les chapitres des manuels et les URLs contenant de l' |
- | connection.stable-id: | + | * **After=network.target sshd-keygen.target**, |
- | connection.type: | + | * Cette directive indique les cibles qui devraient être atteintes et les Unités qui devraient être démarrées avant l' |
- | connection.interface-name: | + | * **Wants=sshd-keygen.target**, |
- | connection.autoconnect: | + | * Cette directive stipule une dépendance douce. Autrement dit, Systemd essayera de démarrer l' |
- | connection.autoconnect-priority: | + | |
- | connection.autoconnect-retries: | + | |
- | connection.multi-connect: | + | |
- | connection.auth-retries: | + | |
- | 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: | + | |
- | connection.lldp: | + | |
- | connection.mdns: | + | |
- | connection.llmnr: | + | |
- | connection.wait-device-timeout: | + | |
- | 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.generate-mac-address-mask: | + | |
- | 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.dns-options: | + | |
- | ipv4.dns-priority: | + | |
- | ipv4.addresses: | + | |
- | ipv4.gateway: 10.0.2.1 | + | |
- | ipv4.routes: | + | |
- | ipv4.route-metric: | + | |
- | ipv4.route-table: | + | |
- | ipv4.routing-rules: -- | + | |
- | ipv4.ignore-auto-routes: | + | |
- | ipv4.ignore-auto-dns: | + | |
- | ipv4.dhcp-client-id: | + | |
- | ipv4.dhcp-iaid: | + | |
- | ipv4.dhcp-timeout: | + | |
- | ipv4.dhcp-send-hostname: | + | |
- | ipv4.dhcp-hostname: | + | |
- | ipv4.dhcp-fqdn: | + | |
- | ipv4.dhcp-hostname-flags: | + | |
- | ipv4.never-default: | + | |
- | ipv4.may-fail: | + | |
- | ipv4.dad-timeout: | + | |
- | ipv4.dhcp-vendor-class-identifier: | + | |
- | ipv4.dhcp-reject-servers: | + | |
- | ipv6.method: | + | |
- | ipv6.dns: | + | |
- | ipv6.dns-search: | + | |
- | ipv6.dns-options: | + | |
- | ipv6.dns-priority: | + | |
- | ipv6.addresses: | + | |
- | ipv6.gateway: | + | |
- | ipv6.routes: | + | |
- | ipv6.route-metric: | + | |
- | ipv6.route-table: | + | |
- | ipv6.routing-rules: | + | |
- | ipv6.ignore-auto-routes: | + | |
- | ipv6.ignore-auto-dns: | + | |
- | ipv6.never-default: | + | |
- | ipv6.may-fail: | + | |
- | ipv6.ip6-privacy: | + | |
- | ipv6.addr-gen-mode: | + | |
- | ipv6.ra-timeout: | + | |
- | ipv6.dhcp-duid: | + | |
- | ipv6.dhcp-iaid: | + | |
- | ipv6.dhcp-timeout: | + | |
- | ipv6.dhcp-send-hostname: | + | |
- | ipv6.dhcp-hostname: | + | |
- | ipv6.dhcp-hostname-flags: | + | |
- | ipv6.token: | + | |
- | proxy.method: | + | |
- | proxy.browser-only: | + | |
- | proxy.pac-url: | + | |
- | proxy.pac-script: | + | |
- | GENERAL.NAME: | + | |
- | GENERAL.UUID: | + | |
- | GENERAL.DEVICES: | + | |
- | GENERAL.IP-IFACE: | + | |
- | GENERAL.STATE: | + | |
- | GENERAL.DEFAULT: | + | |
- | GENERAL.DEFAULT6: | + | |
- | GENERAL.SPEC-OBJECT: | + | |
- | GENERAL.VPN: | + | |
- | GENERAL.DBUS-PATH: | + | |
- | GENERAL.CON-PATH: | + | |
- | GENERAL.ZONE: | + | |
- | GENERAL.MASTER-PATH: | + | |
- | IP4.ADDRESS[1]: | + | |
- | IP4.ADDRESS[2]: | + | |
- | IP4.GATEWAY: | + | |
- | IP4.ROUTE[1]: | + | |
- | IP4.ROUTE[2]: | + | |
- | IP4.ROUTE[3]: | + | |
- | IP4.DNS[1]: | + | |
- | IP6.ADDRESS[1]: | + | |
- | IP6.GATEWAY: | + | |
- | IP6.ROUTE[1]: | + | |
- | IP6.ROUTE[2]: | + | |
- | lines 72-116/116 (END) | + | |
- | [q] | + | |
- | </ | + | |
- | <WRAP center round important 60%> | + | Dans le fichier on peut aussi noter la présence des lignes suivantes dans la section |
- | **Important** : Notez l' | + | |
- | </ | + | |
- | Consultez maintenant | + | * **Type=notify**, |
+ | * Cette directive indique que le service informera Systemd quand son démarrage a terminé, | ||
+ | | ||
+ | * Cette directive définit l' | ||
+ | * **ExecReload=/bin/ | ||
+ | * Cette directive indique la commande necéssaire pour redémarrer le service, | ||
+ | * **KillMode=process**, | ||
+ | * Cette directive indique comment les processus du service doivent être arrêtés. La valeur de **process** implique l' | ||
+ | * **Restart=on-failure**, | ||
+ | * Cette ligne indique que le service doit être re-démarré en cas d' | ||
+ | * **RestartSec=42s**, | ||
+ | * Cette directive stipule le temps d' | ||
- | < | + | Dernièrement on note la présence de la ligne suivante dans la section **[Install]** : |
- | [root@centos8 ~]# cat / | + | |
- | TYPE=Ethernet | + | |
- | PROXY_METHOD=none | + | |
- | BROWSER_ONLY=no | + | |
- | BOOTPROTO=none | + | |
- | IPADDR=10.0.2.46 | + | |
- | PREFIX=24 | + | |
- | GATEWAY=10.0.2.1 | + | |
- | DEFROUTE=yes | + | |
- | IPV4_FAILURE_FATAL=no | + | |
- | IPV6INIT=yes | + | |
- | IPV6_AUTOCONF=yes | + | |
- | IPV6_DEFROUTE=yes | + | |
- | IPV6_FAILURE_FATAL=no | + | |
- | IPV6_ADDR_GEN_MODE=stable-privacy | + | |
- | NAME=ip_fixe | + | |
- | UUID=0f48c74d-5d16-4c37-8220-24644507b589 | + | |
- | DEVICE=ens18 | + | |
- | ONBOOT=yes | + | |
- | DNS1=8.8.8.8 | + | |
- | IPADDR1=192.168.1.2 | + | |
- | PREFIX1=24 | + | |
- | </ | + | |
- | <WRAP center round important 60%> | + | |
- | **Important** : Notez l' | + | * Cette directive indique |
- | </ | + | |
- | ====1.4 - La Commande hostname==== | + | Pour consulter **l' |
- | + | ||
- | La procédure | + | |
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | centos8.ittraining.loc | + | Type=notify |
- | + | ExitType=main | |
- | [root@centos8 ~]# nmcli general hostname centos.ittraining.loc | + | Restart=on-failure |
- | + | NotifyAccess=main | |
- | [root@centos8 ~]# cat /etc/hostname | + | RestartUSec=42s |
- | centos.ittraining.loc | + | TimeoutStartUSec=1min 30s |
- | + | TimeoutStopUSec=1min 30s | |
- | [root@centos8 ~]# hostname | + | TimeoutAbortUSec=1min 30s |
- | centos.ittraining.loc | + | TimeoutStartFailureMode=terminate |
- | + | TimeoutStopFailureMode=terminate | |
- | [root@centos8 ~]# nmcli general hostname centos8.ittraining.loc | + | RuntimeMaxUSec=infinity |
- | + | RuntimeRandomizedExtraUSec=0 | |
- | [root@centos8 ~]# cat / | + | WatchdogUSec=0 |
- | centos8.ittraining.loc | + | WatchdogTimestampMonotonic=0 |
- | + | RootDirectoryStartOnly=no | |
- | [root@centos8 ~]# hostname | + | RemainAfterExit=no |
- | centos8.ittraining.loc | + | GuessMainPID=yes |
+ | MainPID=875 | ||
+ | ControlPID=0 | ||
+ | FileDescriptorStoreMax=0 | ||
+ | NFileDescriptorStore=0 | ||
+ | StatusErrno=0 | ||
+ | Result=success | ||
+ | ReloadResult=success | ||
+ | CleanResult=success | ||
+ | UID=[not set] | ||
+ | GID=[not set] | ||
+ | NRestarts=0 | ||
+ | OOMPolicy=stop | ||
+ | ReloadSignal=1 | ||
+ | ExecMainStartTimestamp=Wed 2024-09-25 12:44:53 CEST | ||
+ | ExecMainStartTimestampMonotonic=18089127 | ||
+ | ExecMainExitTimestampMonotonic=0 | ||
+ | ExecMainPID=875 | ||
+ | ExecMainCode=0 | ||
+ | ExecMainStatus=0 | ||
+ | ExecStart={ path=/ | ||
+ | ExecStartEx={ path=/ | ||
+ | ExecReload={ path=/ | ||
+ | ExecReloadEx={ path=/ | ||
+ | Slice=system.slice | ||
+ | ControlGroup=/ | ||
+ | ControlGroupId=3690 | ||
+ | MemoryCurrent=5275648 | ||
+ | MemoryAvailable=infinity | ||
+ | CPUUsageNSec=122370000 | ||
+ | TasksCurrent=1 | ||
+ | IPIngressBytes=[no data] | ||
+ | IPIngressPackets=[no data] | ||
+ | IPEgressBytes=[no data] | ||
+ | IPEgressPackets=[no data] | ||
+ | IOReadBytes=18446744073709551615 | ||
+ | IOReadOperations=18446744073709551615 | ||
+ | IOWriteBytes=18446744073709551615 | ||
+ | IOWriteOperations=18446744073709551615 | ||
+ | lines 1-55 | ||
</ | </ | ||
- | ====1.5 - La Commande ip==== | + | Pour consulter |
- | + | ||
- | Sous RHEL/CentOS 8 la commande | + | |
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | 1: lo: < | + | sshd.service |
- | | + | ● ├─system.slice |
- | inet 127.0.0.1/8 scope host lo | + | ● ├─sshd-keygen.target |
- | valid_lft forever preferred_lft forever | + | ○ │ ├─sshd-keygen@ecdsa.service |
- | inet6 ::1/128 scope host | + | ○ │ ├─sshd-keygen@ed25519.service |
- | valid_lft forever preferred_lft forever | + | ○ │ └─sshd-keygen@rsa.service |
- | 2: ens18: < | + | ● └─sysinit.target |
- | | + | ● |
- | inet 10.0.2.46/24 brd 10.0.2.255 scope global noprefixroute ens18 | + | ● |
- | valid_lft forever preferred_lft forever | + | ● |
- | inet 192.168.1.2/24 brd 192.168.1.255 scope global noprefixroute ens18 | + | ○ |
- | valid_lft forever preferred_lft forever | + | ○ |
- | inet6 fe80:: | + | ● |
- | valid_lft forever preferred_lft forever | + | ○ |
- | 3: virbr0: <NO-CARRIER, | + | ● |
- | | + | ● |
- | inet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0 | + | ○ |
- | valid_lft forever preferred_lft forever | + | ● |
- | 4: virbr0-nic: < | + | ● |
- | | + | ● |
+ | ● | ||
+ | ○ | ||
+ | ● | ||
+ | ● | ||
+ | ● | ||
+ | ● | ||
+ | ○ | ||
+ | ○ | ||
+ | ○ | ||
+ | ● | ||
+ | ○ | ||
+ | ○ | ||
+ | ○ | ||
+ | ● | ||
+ | ● | ||
+ | ○ | ||
+ | ● | ||
+ | ● | ||
+ | ○ | ||
+ | ○ | ||
+ | ○ | ||
+ | ● | ||
+ | ○ | ||
+ | ● | ||
+ | ○ | ||
+ | ● | ||
+ | ● | ||
+ | ● | ||
+ | ● | ||
+ | ○ | ||
+ | ● | ||
+ | ● | ||
+ | ● | ||
+ | ● | ||
+ | ● │ ├─-.mount | ||
+ | lines 1-55 | ||
</ | </ | ||
- | ===Options | + | ===2.2 - Surchargement des Fichiers |
- | Les options | + | Les fichiers |
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | Usage: ip [ OPTIONS ] OBJECT { COMMAND | help } | + | / |
- | ip [ -force ] -batch filename | + | |
- | where OBJECT := { link | address | addrlabel | route | rule | neigh | ntable | | + | |
- | tunnel | tuntap | maddress | mroute | mrule | monitor | xfrm | | + | |
- | netns | l2tp | fou | macsec | tcp_metrics | token | netconf | ila | | + | |
- | vrf | sr | nexthop | mptcp } | + | |
- | | + | |
- | -h[uman-readable] | -iec | -j[son] | -p[retty] | | + | |
- | -f[amily] { inet | inet6 | mpls | bridge | link } | | + | |
- | -4 | -6 | -I | -D | -M | -B | -0 | | + | |
- | -l[oops] { maximum-addr-flush-attempts } | -br[ief] | | + | |
- | -o[neline] | -t[imestamp] | -ts[hort] | -b[atch] [filename] | | + | |
- | -rc[vbuf] [size] | -n[etns] name | -N[umeric] | -a[ll] | | + | |
- | -c[olor]} | + | |
</ | </ | ||
- | |||
- | ====1.6 - Activer/ | ||
- | |||
- | Deux commandes existent pour désactiver et activer manuellement une interface réseau : | ||
< | < | ||
- | # nmcli device disconnect enp0s3 | + | [root@redhat9 ~]# ls -l / |
- | # nmcli device | + | total 8 |
+ | drwxr-xr-x. 2 root root 65 Oct 19 2023 basic.target.wants | ||
+ | drwxr-xr-x. 2 root root 31 Oct 19 2023 bluetooth.target.wants | ||
+ | lrwxrwxrwx. 1 root root 37 Oct 19 2023 ctrl-alt-del.target -> / | ||
+ | lrwxrwxrwx. 1 root root 41 Oct 19 2023 dbus-org.bluez.service -> / | ||
+ | lrwxrwxrwx. 1 root root 41 Oct 19 2023 dbus-org.fedoraproject.FirewallD1.service -> / | ||
+ | lrwxrwxrwx. 1 root root 44 Oct 19 2023 dbus-org.freedesktop.Avahi.service -> / | ||
+ | lrwxrwxrwx. 1 root root 44 Oct 19 2023 dbus-org.freedesktop.ModemManager1.service -> / | ||
+ | lrwxrwxrwx. 1 root root 57 Oct 19 2023 dbus-org.freedesktop.nm-dispatcher.service -> / | ||
+ | lrwxrwxrwx. 1 root root 43 Oct 19 2023 dbus.service -> / | ||
+ | lrwxrwxrwx. 1 root root 40 Oct 19 2023 default.target -> / | ||
+ | drwxr-xr-x. 2 root root 45 Oct 19 2023 default.target.wants | ||
+ | drwxr-xr-x. 2 root root 38 Oct 19 2023 ' | ||
+ | lrwxrwxrwx. 1 root root 35 Oct 19 2023 display-manager.service -> / | ||
+ | drwxr-xr-x. 2 root root 32 Oct 19 2023 getty.target.wants | ||
+ | drwxr-xr-x. 2 root root 181 Oct 19 2023 graphical.target.wants | ||
+ | drwxr-xr-x. 2 root root 36 Oct 19 2023 local-fs.target.wants | ||
+ | drwxr-xr-x. 2 root root 4096 Oct 19 2023 multi-user.target.wants | ||
+ | drwxr-xr-x. 2 root root 48 Oct 19 2023 network-online.target.wants | ||
+ | drwxr-xr-x. 2 root root 26 Oct 19 2023 printer.target.wants | ||
+ | drwxr-xr-x. 2 root root 27 Oct 19 2023 remote-fs.target.wants | ||
+ | drwxr-xr-x. 2 root root 186 Oct 19 2023 sockets.target.wants | ||
+ | drwxr-xr-x. 2 root root 4096 Sep 25 12:08 sysinit.target.wants | ||
+ | drwxr-xr-x. 2 root root 86 Oct 19 2023 timers.target.wants | ||
+ | drwxr-xr-x. 2 root root 29 Oct 19 2023 vmtoolsd.service.requires | ||
</ | </ | ||
- | <WRAP center round important 60%> | + | ====LAB #3 - La Commande systemd-analyze==== |
- | **Important** : Veuillez ne **PAS** exécuter ces deux commandes. | + | |
- | </ | + | |
- | ====1.7 - Routage Statique==== | + | Pour avoir une évaluation du temps de démarrage, il convient d' |
- | + | ||
- | ===La commande ip=== | + | |
- | + | ||
- | Sous RHEL/CentOS 8, pour supprimer la route vers le réseau 192.168.1.0 | + | |
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | default via 10.0.2.1 dev ens18 proto static metric 100 | + | Startup finished in 1.309s (kernel) + 4.384s (initrd) + 29.375s (userspace) = 35.069s |
- | 10.0.2.0/24 dev ens18 proto kernel | + | graphical.target reached after 29.358s in userspace. |
- | 192.168.1.0/24 dev ens18 proto kernel scope link src 192.168.1.2 metric 100 | + | |
- | 192.168.122.0/ | + | |
- | + | ||
- | root@centos8 ~]# ip route del 192.168.1.0/ | + | |
- | [root@centos8 ~]# ip route | + | |
- | default via 10.0.2.1 dev ens18 proto static metric 100 | + | |
- | 10.0.2.0/24 dev ens18 proto kernel scope link src 10.0.2.46 metric 100 | + | |
- | 192.168.122.0/ | + | |
</ | </ | ||
- | Pour ajouter | + | L' |
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | [root@centos8 ~]# ip route | + | 15.289s plymouth-quit-wait.service |
- | default via 10.0.2.1 dev ens18 proto static metric 100 | + | |
- | 10.0.2.0/24 dev ens18 proto kernel scope link src 10.0.2.46 metric 100 | + | |
- | 192.168.1.0/24 via 10.0.2.1 | + | |
- | 192.168.122.0/24 dev virbr0 proto kernel scope link src 192.168.122.1 linkdown | + | 8.760s dev-disk-by\x2dpath-pci\x2d0000: |
+ | 8.760s dev-sda2.device | ||
+ | 8.662s sys-devices-pci0000: | ||
+ | | ||
+ | 8.662s dev-sda1.device | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | 8.629s dev-disk-by\x2did-scsi\x2d0QEMU_QEMU_HARDDISK_drive\x2dscsi0.device | ||
+ | 8.629s sys-devices-pci0000: | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | 2.468s firewalld.service | ||
+ | | ||
+ | 1.944s systemd-udev-settle.service | ||
+ | 1.548s dnf-makecache.service | ||
+ | 1.454s NetworkManager-wait-online.service | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | 953ms ModemManager.service | ||
+ | 900ms user@42.service | ||
+ | 888ms dracut-initqueue.service | ||
+ | 671ms dbus-broker.service | ||
+ | 661ms systemd-tmpfiles-setup-dev.service | ||
+ | 658ms systemd-udevd.service | ||
+ | 561ms lvm2-monitor.service | ||
+ | 547ms boot.mount | ||
+ | 506ms cups.service | ||
+ | 464ms sshd.service | ||
+ | 446ms logrotate.service | ||
+ | 382ms systemd-random-seed.service | ||
+ | 376ms auditd.service | ||
+ | 371ms systemd-tmpfiles-setup.service | ||
+ | 324ms systemd-sysctl.service | ||
+ | lines 1-55 | ||
</ | </ | ||
- | <WRAP center round important 60%> | + | L' |
- | **Important** - La commande utilisée pour ajouter une passerelle par défaut prend la forme suivante | + | |
- | </ | + | |
- | ===Désactiver/ | + | < |
+ | [root@redhat9 ~]# systemd-analyze critical-chain sshd.service | ||
+ | The time when unit became active or started is printed after the " | ||
+ | The time the unit took to start is printed after the " | ||
- | Pour désactiver le routage sur le serveur, il convient de désactiver la retransmission des paquets. | + | sshd.service +464ms |
- | + | └─network.target @12.377s | |
- | Pour IPv4 : | + | |
- | + | | |
- | < | + | |
- | [root@centos8 ~]# cat / | + | |
- | 1 | + | |
- | [root@centos8 ~]# echo 0 > / | + | |
- | [root@centos8 ~]# cat / | + | |
- | 0 | + | |
+ | └─local-fs.target @5.939s | ||
+ | └─run-user-42.mount @14.616s | ||
+ | └─local-fs-pre.target @5.379s | ||
+ | └─systemd-tmpfiles-setup-dev.service @3.398s +661ms | ||
+ | └─kmod-static-nodes.service @3.243s +49ms | ||
+ | └─systemd-journald.socket | ||
+ | └─system.slice | ||
+ | └─-.slice | ||
</ | </ | ||
- | Pour activer le routage sur le serveur, il convient d' | + | Les options de la commande **systemd-analyze** sont : |
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | [root@centos8 ~]# cat / | + | systemd-analyze |
- | 1 | + | |
- | </ | + | |
- | Pour IPv6 : | + | Profile systemd, show unit dependencies, |
- | < | + | Commands: |
- | [root@centos8 ~]# cat / | + | [time] Print time required to boot the machine |
- | 1 | + | |
- | [root@centos8 ~]# echo " | + | time to init |
- | [root@centos8 ~]# cat / | + | critical-chain |
- | 0 | + | of units |
- | </ | + | plot |
+ | | ||
+ | dot [UNIT...] | ||
+ | dump [PATTERN...] | ||
+ | | ||
+ | | ||
+ | | ||
+ | unit-paths | ||
+ | exit-status [STATUS...] | ||
+ | capability [CAP...] | ||
+ | syscall-filter [NAME...] | ||
+ | filesystems [NAME...] | ||
+ | condition CONDITION... | ||
+ | compare-versions VERSION1 [OP] VERSION2 | ||
+ | | ||
+ | verify FILE... | ||
+ | calendar SPEC... | ||
+ | | ||
+ | timestamp TIMESTAMP... | ||
+ | timespan SPAN... | ||
+ | security [UNIT...] | ||
+ | | ||
- | Pour activer le routage sur le serveur, il convient d'activer la retransmission des paquets: | + | Options: |
- | + | | |
- | < | + | |
- | [root@centos8 ~]# echo " | + | |
- | [root@centos8 ~]# cat / | + | |
- | 1 | + | |
+ | of built-in one | ||
+ | | ||
+ | | ||
+ | --no-pager | ||
+ | --no-legend | ||
+ | with either --table or --json= | ||
+ | --system | ||
+ | | ||
+ | | ||
+ | -H --host=[USER@]HOST Operate on remote host | ||
+ | -M --machine=CONTAINER | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | lines 1-55 | ||
</ | </ | ||
- | =====LAB #2 - Diagnostique du Réseau===== | + | ====LAB #4 - Les Cibles Systemd==== |
- | ====2.1 - ping==== | + | Chaque Cible est décrite par un fichier de configuration |
- | + | ||
- | Pour tester l' | + | |
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | PING 10.0.2.1 (10.0.2.1) 56(84) bytes of data. | + | # SPDX-License-Identifier: |
- | 64 bytes from 10.0.2.1: icmp_seq=1 ttl=64 time=0.104 ms | + | # |
- | 64 bytes from 10.0.2.1: icmp_seq=2 ttl=64 time=0.325 ms | + | # This file is part of systemd. |
- | 64 bytes from 10.0.2.1: icmp_seq=3 ttl=64 time=0.250 ms | + | # |
- | 64 bytes from 10.0.2.1: icmp_seq=4 ttl=64 time=0.123 ms | + | # systemd is free software; you can redistribute it and/or modify it |
+ | # under the terms of the GNU Lesser General Public License as published by | ||
+ | # the Free Software Foundation; either version | ||
+ | # (at your option) any later version. | ||
- | --- 10.0.2.1 ping statistics --- | + | [Unit] |
- | 4 packets transmitted, | + | Description=Graphical Interface |
- | rtt min/ | + | Documentation=man: |
+ | Requires=multi-user.target | ||
+ | Wants=display-manager.service | ||
+ | Conflicts=rescue.service rescue.target | ||
+ | After=multi-user.target rescue.service rescue.target display-manager.service | ||
+ | AllowIsolate=yes | ||
</ | </ | ||
- | ===Options de la commande ping=== | + | Dans ce fichier on peut noter la présence des lignes suivantes : |
- | Les options de cette commande sont : | + | * **Requires=multi-user.target**, |
+ | * Cette ligne indique que le **graphical.target** ne peut pas être atteint si le **multi-user.target** n'a pas été atteint au préalable, | ||
+ | * **After=multi-user.target rescue.service rescue.target display-manager.service**, | ||
+ | * Cette ligne indique le **multi-user.target** et **rescue.target** doivent d' | ||
+ | * **Conflicts=rescue.service rescue.target**, | ||
+ | * Cette ligne indique la Cible et le service en conflits avec le **graphical.target**, | ||
+ | * **Wants=display-manager.service**, | ||
+ | * Cette ligne indique quel service doit être démarré. | ||
- | < | + | ===4.1 |
- | [root@centos8 ~]# ping --help | + | |
- | ping: invalid option -- '-' | + | |
- | Usage: ping [-aAbBdDfhLnOqrRUvV64] [-c count] [-i interval] [-I interface] | + | |
- | [-m mark] [-M pmtudisc_option] [-l preload] [-p pattern] [-Q tos] | + | |
- | [-s packetsize] [-S sndbuf] [-t ttl] [-T timestamp_option] | + | |
- | [-w deadline] [-W timeout] [hop1 ...] destination | + | |
- | Usage: ping -6 [-aAbBdDfhLnOqrRUvV] [-c count] [-i interval] [-I interface] | + | |
- | [-l preload] [-m mark] [-M pmtudisc_option] | + | |
- | [-N nodeinfo_option] [-p pattern] [-Q tclass] [-s packetsize] | + | |
- | [-S sndbuf] [-t ttl] [-T timestamp_option] [-w deadline] | + | |
- | [-W timeout] destination | + | |
- | </ | + | |
- | ====2.2 - netstat -i==== | + | Les dépendances d'une Cible peuvent être consultées en utilisant |
- | + | ||
- | Pour visualiser les statistiques réseaux, vous disposez de la commande **netstat** : | + | |
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | Kernel Interface table | + | multi-user.target |
- | Iface | + | ● ├─atd.service |
- | ens18 1500 | + | ● ├─auditd.service |
- | lo 65536 10936 0 0 0 | + | ● ├─avahi-daemon.service |
- | virbr0 | + | ● ├─crond.service |
+ | ● ├─cups.path | ||
+ | ● ├─cups.service | ||
+ | ● ├─firewalld.service | ||
+ | ○ ├─insights-client-boot.service | ||
+ | ● ├─irqbalance.service | ||
+ | ● ├─kdump.service | ||
+ | ● ├─libstoragemgmt.service | ||
+ | ● ├─mcelog.service | ||
+ | ○ ├─mdmonitor.service | ||
+ | ● ├─ModemManager.service | ||
+ | ● ├─NetworkManager.service | ||
+ | ○ ├─ostree-readonly-sysroot-migration.service | ||
+ | ● ├─plymouth-quit-wait.service | ||
+ | ○ ├─plymouth-quit.service | ||
+ | ● ├─rhsmcertd.service | ||
+ | ● ├─rsyslog.service | ||
+ | ○ ├─smartd.service | ||
+ | ● ├─sshd.service | ||
+ | ○ ├─sssd.service | ||
+ | ● ├─systemd-ask-password-wall.path | ||
+ | ● ├─systemd-logind.service | ||
+ | ○ ├─systemd-update-utmp-runlevel.service | ||
+ | ● ├─systemd-user-sessions.service | ||
+ | ○ ├─tuned.service | ||
+ | ○ ├─vmtoolsd.service | ||
+ | ● ├─basic.target | ||
+ | ● │ ├─-.mount | ||
+ | ○ │ ├─low-memory-monitor.service | ||
+ | ○ │ ├─microcode.service | ||
+ | ● │ ├─paths.target | ||
+ | ● │ ├─slices.target | ||
+ | ● │ │ ├─-.slice | ||
+ | ● │ │ └─system.slice | ||
+ | ● │ ├─sockets.target | ||
+ | ● │ │ ├─avahi-daemon.socket | ||
+ | ● │ │ ├─cups.socket | ||
+ | ● │ │ ├─dbus.socket | ||
+ | ● │ │ ├─dm-event.socket | ||
+ | ● │ │ ├─iscsid.socket | ||
+ | ● │ │ ├─iscsiuio.socket | ||
+ | ○ │ │ ├─multipathd.socket | ||
+ | ● │ │ ├─sssd-kcm.socket | ||
+ | ● │ │ ├─systemd-coredump.socket | ||
+ | ● │ │ ├─systemd-initctl.socket | ||
+ | ● │ │ ├─systemd-journald-dev-log.socket | ||
+ | ● │ │ ├─systemd-journald.socket | ||
+ | ● │ │ ├─systemd-udevd-control.socket | ||
+ | ● │ │ └─systemd-udevd-kernel.socket | ||
+ | ● │ ├─sysinit.target | ||
+ | ● │ │ ├─dev-hugepages.mount | ||
+ | lines 1-55 | ||
</ | </ | ||
- | ===Options | + | Les points noirs au début |
- | Les options de cette commande sont : | + | * **Vert** implique que le service, la cible ou l' |
+ | * **Blanc** implique le service, la cible ou l' | ||
+ | * **Rouge** implique que le service, la cible ou l' | ||
- | < | + | Pour visualiser les Unités en état d'erreur fatale, utilisez |
- | [root@centos8 ~]# 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) | + | |
- | </ | + | |
- | + | ||
- | ====2.3 - 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@centos8 | + | [root@redhat9 |
- | bash: traceroute: command not found... | + | |
- | Install package ' | + | 0 loaded units listed. |
- | + | ||
- | + | ||
- | * Waiting in queue... | + | |
- | The following packages have to be installed: | + | |
- | | + | |
- | Proceed with changes? [N/y] y | + | |
- | + | ||
- | + | ||
- | * Waiting in queue... | + | |
- | * Waiting for authentication... | + | |
- | * Waiting in queue... | + | |
- | * Downloading packages... | + | |
- | * Requesting data... | + | |
- | * Testing changes... | + | |
- | * Installing packages... | + | |
- | traceroute to www.ittraining.network (109.228.56.52), | + | |
- | | + | |
- | 2 79.137.68.252 (79.137.68.252) | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | 10 ae-14.bb-b.fr7.fra.de.oneandone.net (212.227.120.149) | + | |
- | 11 port-channel-3.gw-ngcs-1.dc1.con.glo.gb.oneandone.net (88.208.255.131) | + | |
- | 12 109.228.63.209 (109.228.63.209) | + | |
- | 13 * 109.228.63.209 (109.228.63.209) | + | |
- | 14 * * * | + | |
- | 15 * * * | + | |
- | 16 * * * | + | |
- | 17 * * * | + | |
- | 18 * * * | + | |
- | 19 * * * | + | |
- | 20 * * * | + | |
- | 21 * * * | + | |
- | 22 * * * | + | |
- | 23 * * * | + | |
- | 24 * * * | + | |
- | 25 * * * | + | |
- | 26 * * * | + | |
- | 27 * * * | + | |
- | 28 * * * | + | |
- | 29 * * *^C | + | |
</ | </ | ||
- | ===Options de la commande traceroute=== | + | Les dépendances sont créés sous la forme de liens symboliques dans les répertoires **/ |
- | + | ||
- | Les options | + | |
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | Usage: | + | total 0 |
- | traceroute [ -46dFITnreAUDV ] [ -f first_ttl ] [ -g gate,... ] [ -i device ] [ -m max_ttl ] [ -N squeries ] [ -p port ] [ -t tos ] [ -l flow_label ] [ -w MAX, | + | lrwxrwxrwx. 1 root root 35 Oct 19 2023 atd.service |
- | Options: | + | lrwxrwxrwx. 1 root root 38 Oct 19 2023 auditd.service |
- | -4 Use IPv4 | + | lrwxrwxrwx. 1 root root 44 Oct 19 2023 avahi-daemon.service |
- | -6 Use IPv6 | + | lrwxrwxrwx. 1 root root 37 Oct 19 2023 crond.service |
- | -d | + | lrwxrwxrwx. 1 root root 33 Oct 19 2023 cups.path |
- | -F --dont-fragment | + | lrwxrwxrwx. |
- | -f first_ttl | + | lrwxrwxrwx. 1 root root 41 Oct 19 2023 firewalld.service |
- | Start from the first_ttl hop (instead from 1) | + | lrwxrwxrwx. 1 root root 52 Oct 19 2023 insights-client-boot.service |
- | -g gate,... --gateway=gate, | + | lrwxrwxrwx. 1 root root 42 Oct 19 2023 irqbalance.service |
- | Route packets through the specified gateway | + | lrwxrwxrwx. 1 root root 37 Oct 19 2023 kdump.service |
- | (maximum 8 for IPv4 and 127 for IPv6) | + | lrwxrwxrwx. 1 root root 46 Oct 19 2023 libstoragemgmt.service |
- | -I | + | lrwxrwxrwx. 1 root root 38 Oct 19 2023 mcelog.service |
- | | + | lrwxrwxrwx. 1 root root 41 Oct 19 2023 mdmonitor.service |
- | -i device | + | lrwxrwxrwx. 1 root root 44 Oct 19 2023 ModemManager.service |
- | Specify a network interface to operate with | + | lrwxrwxrwx. 1 root root 46 Oct 19 2023 NetworkManager.service |
- | -m max_ttl | + | lrwxrwxrwx. 1 root root 40 Oct 19 2023 remote-fs.target |
- | Set the max number of hops (max TTL to be | + | lrwxrwxrwx. 1 root root 41 Oct 19 2023 rhsmcertd.service |
- | reached). Default is 30 | + | lrwxrwxrwx. 1 root root 39 Oct 19 2023 rsyslog.service |
- | -N squeries | + | lrwxrwxrwx. 1 root root 38 Oct 19 2023 smartd.service |
- | Set the number of probes to be tried | + | lrwxrwxrwx. 1 root root 36 Oct 19 2023 sshd.service |
- | simultaneously (default is 16) | + | lrwxrwxrwx. 1 root root 36 Oct 19 2023 sssd.service |
- | -n Do not resolve IP addresses to their domain names | + | lrwxrwxrwx. |
- | -p port --port=port | + | lrwxrwxrwx. 1 root root 40 Oct 19 2023 vmtoolsd.service |
- | initial udp port value for " | + | |
- | | + | |
- | 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 MAX, | + | |
- | Wait for a probe no more than HERE (default 3) | + | |
- | times longer than a response from the same hop, | + | |
- | or no more than NEAR (default 10) times than some | + | |
- | next hop, or MAX (default 5.0) seconds (float | + | |
- | point values allowed too) | + | |
- | -q nqueries | + | |
- | 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, | + | |
- | | + | |
- | about available options | + | |
- | --sport=num | + | |
- | | + | |
- | --fwmark=num | + | |
- | | + | |
- | (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 Guess the number of hops in the backward path and | + | |
- | print if it differs | + | |
- | -V --version | + | |
- | --help | + | |
- | Arguments: | + | [root@redhat9 ~]# ls -l / |
- | + | + | total 0 |
- | | + | lrwxrwxrwx. 1 root root 15 Jul 18 13:00 getty.target -> ../ |
- | | + | lrwxrwxrwx. 1 root root 44 May 17 18:27 ostree-readonly-sysroot-migration.service -> ../ |
- | | + | lrwxrwxrwx. 1 root root 24 Jul 14 2023 plymouth-quit.service -> ../ |
+ | lrwxrwxrwx. 1 root root 29 Jul 14 2023 plymouth-quit-wait.service -> ../ | ||
+ | lrwxrwxrwx. 1 root root 33 Jul 18 13:00 systemd-ask-password-wall.path -> ../ | ||
+ | lrwxrwxrwx. 1 root root 25 Jul 18 13:00 systemd-logind.service -> ../ | ||
+ | lrwxrwxrwx. 1 root root 39 Jul 18 13:00 systemd-update-utmp-runlevel.service -> ../ | ||
+ | lrwxrwxrwx. 1 root root 32 Jul 18 13:00 systemd-user-sessions.service -> ../ | ||
</ | </ | ||
- | =====LAB #3 - Connexions à Distance===== | + | ===4.2 - La Cible par Défaut=== |
- | ==== 3.1 - Telnet ==== | + | ==Consulter la Cible par Défaut== |
- | <WRAP center round important> | + | Pour consulter |
- | **Important** - Si la commande **telnet** n'est pas installée sous CentOS 8, installez-le à l'aide de la commande **dnf install telnet** en tant que root. | + | |
- | </ | + | |
- | + | ||
- | La commande **telnet** est utilisée pour établir une connexion à distance avec un serveur telnet : | + | |
- | + | ||
- | < | + | |
- | # telnet numero_ip | + | |
- | </ | + | |
- | + | ||
- | <WRAP center round important 60%> | + | |
- | **Important** - Le service telnet revient à une redirection des canaux standards d' | + | |
- | </ | + | |
- | + | ||
- | ===Options de la commande telnet=== | + | |
- | + | ||
- | Les options de cette commande sont : | + | |
< | < | ||
- | [[root@centos8 | + | [root@redhat9 |
- | telnet: invalid option -- ' | + | graphical.target |
- | Usage: telnet [-4] [-6] [-8] [-E] [-L] [-S tos] [-a] [-c] [-d] [-e char] [-l user] | + | |
- | [-n tracefile] [-b hostalias ] [-r] | + | |
- | | + | |
</ | </ | ||
- | ==== 3.2 - wget ==== | + | La Cible par défaut est représentée par le lien symbolique |
- | + | ||
- | La commande | + | |
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | ... | + | lrwxrwxrwx. 1 root root 40 Oct 19 2023 / |
- | + | ||
- | [root@centos8 ~]# cat wget_file.txt | + | |
- | This is a file retrieved by the wget command. | + | |
</ | </ | ||
- | ===Options de la commande wget=== | + | ==Modifier |
- | Les options de cette commande | + | Pour modifier la Cible par défaut avec une prise en compte lors du **prochain** démarrage, il convient d' |
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | GNU Wget 1.19.5, a non-interactive network retriever. | + | Removed "/ |
- | Usage: wget [OPTION]... [URL]... | + | Created symlink / |
- | Mandatory arguments to long options are mandatory for short options too. | + | [root@redhat9 ~]# ls -l / |
+ | lrwxrwxrwx. 1 root root 41 Sep 26 14:50 / | ||
- | Startup: | + | [root@redhat9 ~]# systemctl set-default graphical.target |
- | | + | Removed "/ |
- | | + | Created symlink / |
- | | + | |
- | -e, --execute=COMMAND | + | |
- | Logging and input file: | + | [root@redhat9 ~]# ls -l / |
- | | + | lrwxrwxrwx. 1 root root 40 Sep 26 14:51 / |
- | | + | </ |
- | -d, --debug | + | |
- | -q, --quiet | + | |
- | -v, --verbose | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | -F, --force-html | + | |
- | -B, --base=URL | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | Download: | + | ==Modifier la Cible en Cours== |
- | -t, --tries=NUMBER | + | |
- | | + | |
- | | + | |
- | -O, --output-document=FILE write documents to FILE | + | |
- | -nc, --no-clobber | + | |
- | | + | |
- | | + | |
- | -c, --continue | + | |
- | | + | |
- | | + | |
- | | + | |
- | -N, --timestamping | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | the one on the server | + | |
- | -S, --server-response | + | |
- | | + | |
- | -T, --timeout=SECONDS | + | |
- | | + | |
- | | + | |
- | | + | |
- | -w, --wait=SECONDS | + | |
- | | + | |
- | | + | |
- | | + | |
- | -Q, --quota=NUMBER | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | -4, --inet4-only | + | |
- | -6, --inet6-only | + | |
- | | + | |
- | one of IPv6, IPv4, or none | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | Directories: | + | Il est possible de modifier la cible actuellement en cours en utilisant la commande **systemctl isolate** |
- | -nd, --no-directories | + | |
- | -x, --force-directories | + | |
- | -nH, --no-host-directories | + | |
- | | + | |
- | -P, --directory-prefix=PREFIX | + | |
- | | + | |
- | HTTP options: | + | < |
- | --http-user=USER | + | [root@redhat9 ~]# systemctl isolate rescue |
- | | + | |
- | | + | |
- | | + | |
- | this is ' | + | |
- | -E, --adjust-extension | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | -U, --user-agent=AGENT | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | HTTPS (SSL/TLS) options: | + | [root@redhat9 ~]# systemctl list-units --type |
- | --secure-protocol=PR | + | |
- | | + | |
- | | + | [root@redhat9 ~]# runlevel |
- | | + | 5 1 |
- | | + | |
- | | + | |
- | --private-key=FILE | + | |
- | --private-key-type=TYPE | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | of base64 encoded sha256 hashes preceded by | + | |
- | ' | + | |
- | peer against | + | |
- | --ciphers=STR | + | [root@redhat9 ~]# who -r |
- | Use with care. This option overrides --secure-protocol. | + | run-level |
- | The format and syntax of this string depend on the specific SSL/TLS engine. | + | |
- | HSTS options: | + | |
- | | + | |
- | | + | |
- | + | ||
- | FTP options: | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | + | ||
- | FTPS options: | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | WARC options: | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | WARC writer | + | |
- | + | ||
- | Recursive download: | + | |
- | -r, --recursive | + | |
- | -l, --level=NUMBER | + | |
- | | + | |
- | -k, | + | |
- | local files | + | |
- | | + | |
- | | + | |
- | -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 | + | |
- | | + | |
- | | + | |
- | -X, --exclude-directories=LIST | + | |
- | -np, --no-parent | + | |
- | + | ||
- | Email bug reports, questions, discussions to < | + | |
- | and/or open issues at https:// | + | |
</ | </ | ||
- | |||
- | ==== 3.3 - ftp ==== | ||
- | |||
- | <WRAP center round important 60%> | ||
- | **Important** - Si la commande **ftp** n'est pas installée sous CentOS 8, installez-le à l'aide de la commande **dnf install ftp** en tant que root. | ||
- | </ | ||
- | |||
- | La commande **ftp** est utilisée pour le transfert de fichiers. Une fois connecté, il convient d' | ||
< | < | ||
- | ftp> help | + | [root@redhat9 ~]# systemctl isolate graphical |
- | Commands may be abbreviated. | + | |
- | ! debug mdir sendport site | + | [root@redhat9 ~]# systemctl list-units --type target | egrep " |
- | $ 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' | + | [root@redhat9 ~]# runlevel |
+ | 1 5 | ||
- | < | + | [root@redhat9 ~]# who -r |
- | ftp> !pwd | + | run-level 5 2024-09-26 14:55 |
- | /root | + | |
</ | </ | ||
- | Pour transférer un fichier vers le serveur, il convient d' | + | ====LAB #5 - Gestion des Services==== |
- | < | + | ===5.1 - Gestion des Instances Uniques=== |
- | ftp> put nom_fichier_local nom_fichier_distant | + | |
- | </ | + | |
- | Vous pouvez également transférer plusieurs fichiers à la fois grâce à la commande | + | Commencez par installer le paquet |
- | <file> | + | <code> |
- | ftp> mput nom*.* | + | [root@redhat9 ~]# dnf install httpd |
- | </ | + | Updating Subscription Management repositories. |
+ | Last metadata expiration check: 1:59:56 ago on Thu 26 Sep 2024 12:57:02 PM CEST. | ||
+ | Dependencies resolved. | ||
+ | ================================================================================================================================================================================================================== | ||
+ | | ||
+ | ================================================================================================================================================================================================================== | ||
+ | Installing: | ||
+ | | ||
+ | Installing dependencies: | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | Installing weak dependencies: | ||
+ | | ||
+ | | ||
+ | | ||
- | Pour transférer un fichier du serveur, il convient d' | + | Transaction Summary |
+ | ================================================================================================================================================================================================================== | ||
+ | Install | ||
- | < | + | Total download size: 2.2 M |
- | ftp> get nom_fichier | + | Installed size: 6.0 M |
- | </file> | + | Is this ok [y/N]: y |
+ | Downloading Packages: | ||
+ | (1/11): apr-util-bdb-1.6.1-23.el9.x86_64.rpm | ||
+ | (2/11): apr-util-openssl-1.6.1-23.el9.x86_64.rpm | ||
+ | (3/11): apr-util-1.6.1-23.el9.x86_64.rpm | ||
+ | (4/11): redhat-logos-httpd-90.4-2.el9.noarch.rpm | ||
+ | (5/11): apr-1.7.0-12.el9_3.x86_64.rpm | ||
+ | (6/11): mod_http2-2.0.26-2.el9_4.x86_64.rpm | ||
+ | (7/11): httpd-core-2.4.57-11.el9_4.1.x86_64.rpm | ||
+ | (8/11): httpd-filesystem-2.4.57-11.el9_4.1.noarch.rpm | ||
+ | (9/11): httpd-2.4.57-11.el9_4.1.x86_64.rpm | ||
+ | (10/11): httpd-tools-2.4.57-11.el9_4.1.x86_64.rpm | ||
+ | (11/11): mod_lua-2.4.57-11.el9_4.1.x86_64.rpm | ||
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ||
+ | Total 1.2 MB/s | 2.2 MB | ||
+ | Running transaction check | ||
+ | Transaction check succeeded. | ||
+ | Running transaction test | ||
+ | Transaction test succeeded. | ||
+ | Running transaction | ||
+ | Preparing | ||
+ | Installing | ||
+ | Installing | ||
+ | Installing | ||
+ | Installing | ||
+ | Installing | ||
+ | Running scriptlet: httpd-filesystem-2.4.57-11.el9_4.1.noarch | ||
+ | Installing | ||
+ | Installing | ||
+ | Installing | ||
+ | Installing | ||
+ | Installing | ||
+ | Installing | ||
+ | Running scriptlet: httpd-2.4.57-11.el9_4.1.x86_64 | ||
+ | Verifying | ||
+ | Verifying | ||
+ | Verifying | ||
+ | Verifying | ||
+ | Verifying | ||
+ | Verifying | ||
+ | Verifying | ||
+ | Verifying | ||
+ | Verifying | ||
+ | Verifying | ||
+ | Verifying | ||
+ | Installed products updated. | ||
- | Vous pouvez également transférer plusieurs fichiers à la fois grâce à la commande **mget** ( voir la commande **mput** ci-dessus ). | + | Installed: |
+ | apr-1.7.0-12.el9_3.x86_64 | ||
+ | httpd-core-2.4.57-11.el9_4.1.x86_64 | ||
+ | redhat-logos-httpd-90.4-2.el9.noarch | ||
- | Pour supprimer un fichier sur le serveur, il convient d' | + | Complete! |
+ | </ | ||
- | < | + | Pour obtenir le détail sur un service donné, il convient d' |
- | ftp> del nom_fichier | + | |
- | </ | + | |
- | + | ||
- | Pour fermer la session, il convient d' | + | |
< | < | ||
- | ftp> quit | + | [root@redhat9 |
- | [root@centos7 | + | ○ httpd.service - The Apache HTTP Server |
+ | | ||
+ | | ||
+ | Docs: man: | ||
</ | </ | ||
- | ====3.4 - SSH==== | + | Dans le cas du service httpd ci-dessus, on peut constater que le statut |
- | + | ||
- | ===Présentation=== | + | |
- | + | ||
- | 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 | + | |
- | | + | |
- | + | ||
- | 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, | + | |
- | * 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== | + | * **disabled** - le service ne démarrera pas lors du prochain démarrage du système. |
+ | * **enabled** - le service démarrera lors du prochain démarrage du système. | ||
- | Les options | + | Il est possible |
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | unknown option -- - | + | disabled |
- | usage: ssh [-46AaCfGgKkMNnqsTtVvXxYy] [-B bind_interface] | + | |
- | [-b bind_address] [-c cipher_spec] [-D [bind_address: | + | |
- | [-E log_file] [-e escape_char] [-F configfile] [-I pkcs11] | + | |
- | [-i identity_file] [-J [user@]host[: | + | |
- | [-l login_name] [-m mac_spec] [-O ctl_cmd] [-o option] [-p port] | + | |
- | [-Q query_option] [-R address] [-S ctl_path] [-W host: | + | |
- | [-w local_tun[: | + | |
</ | </ | ||
- | ===Authentification par mot de passe=== | + | Pour rendre |
- | + | ||
- | L' | + | |
- | + | ||
- | Avantage: | + | |
- | | + | |
- | + | ||
- | Inconvénients: | + | |
- | | + | |
- | | + | |
- | + | ||
- | ===Authentification par clef asymétrique=== | + | |
- | + | ||
- | | + | |
- | * 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' | + | |
- | + | ||
- | ===Configuration du Serveur=== | + | |
- | + | ||
- | La configuration du serveur s' | + | |
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | # | + | Created symlink |
- | # This is the sshd server system-wide configuration file. See | + | [root@redhat9 ~]# systemctl |
- | # sshd_config(5) for more information. | + | enabled |
- | # This sshd was compiled with PATH=/ | + | [root@redhat9 ~]# systemctl status httpd.service |
+ | ○ httpd.service - The Apache HTTP Server | ||
+ | | ||
+ | | ||
+ | Docs: man: | ||
+ | </code> | ||
- | # The strategy used for options in the default sshd_config shipped with | + | Dans le cas du service httpd ci-dessus, on peut maintenant constater que l' |
- | # OpenSSH is to specify options with their default value where | + | |
- | # possible, but leave them commented. | + | |
- | # default value. | + | |
- | # If you want to change the port on a SELinux system, you have to tell | + | * **inactive (dead)** |
- | # SELinux about this change. | + | * **active(running** |
- | # semanage port -a -t ssh_port_t -p tcp # | + | * **active(exited)** - le service a terminé une configuration unique. |
- | # | + | * **active(waiting)** - le service est démarré mais en attente d'un évènement. |
- | #Port 22 | + | |
- | # | + | * **deactivating** |
- | # | + | * **failed** |
- | # | + | |
- | + | ||
- | HostKey / | + | |
- | HostKey / | + | |
- | HostKey / | + | |
- | + | ||
- | # Ciphers and keying | + | |
- | #RekeyLimit default none | + | |
- | + | ||
- | # This system is following system-wide crypto policy. The changes to | + | |
- | # crypto properties | + | |
- | # They will be overridden by command-line options passed to the server | + | |
- | # on command line. | + | |
- | # Please, check manual pages for update-crypto-policies(8) and sshd_config(5). | + | |
- | + | ||
- | # Logging | + | |
- | # | + | |
- | SyslogFacility AUTHPRIV | + | |
- | #LogLevel INFO | + | |
- | + | ||
- | # Authentication: | + | |
- | + | ||
- | # | + | |
- | PermitRootLogin yes | + | |
- | # | + | |
- | # | + | |
- | # | + | |
- | + | ||
- | # | + | |
- | + | ||
- | # The default is to check both .ssh/ | + | |
- | # but this is overridden so installations will only check .ssh/ | + | |
- | AuthorizedKeysFile | + | |
- | + | ||
- | # | + | |
- | + | ||
- | # | + | |
- | # | + | |
- | + | ||
- | # For this to work you will also need host keys in / | + | |
- | # | + | |
- | # Change to yes if you don't trust ~/.ssh/ | + | |
- | # 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 'no'. | + | |
- | # WARNING: ' | + | |
- | # problems. | + | |
- | UsePAM yes | + | |
- | + | ||
- | # | + | |
- | # | + | |
- | # | + | |
- | X11Forwarding yes | + | |
- | # | + | |
- | # | + | |
- | #PermitTTY yes | + | |
- | + | ||
- | # It is recommended to use pam_motd in / | + | |
- | # as it is more configurable and versatile than the built-in version. | + | |
- | PrintMotd no | + | |
- | + | ||
- | # | + | |
- | # | + | |
- | # | + | |
- | # | + | |
- | # | + | |
- | # | + | |
- | #UseDNS no | + | |
- | #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 | + | |
- | + | ||
- | # Example of overriding settings on a per-user basis | + | |
- | #Match User anoncvs | + | |
- | # | + | |
- | # | + | |
- | # | + | |
- | # | + | |
- | </ | + | |
- | Pour ôter les lignes | + | Il est possible |
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | [root@centos8 tmp]# cat sshd_config | + | inactive |
- | HostKey / | + | |
- | HostKey / | + | |
- | HostKey / | + | |
- | SyslogFacility AUTHPRIV | + | |
- | PermitRootLogin yes | + | |
- | AuthorizedKeysFile | + | |
- | PasswordAuthentication yes | + | |
- | ChallengeResponseAuthentication no | + | |
- | GSSAPIAuthentication yes | + | |
- | GSSAPICleanupCredentials no | + | |
- | UsePAM yes | + | |
- | X11Forwarding yes | + | |
- | PrintMotd no | + | |
- | AcceptEnv LANG LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES | + | |
- | AcceptEnv LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT | + | |
- | AcceptEnv LC_IDENTIFICATION LC_ALL LANGUAGE | + | |
- | AcceptEnv XMODIFIERS | + | |
- | Subsystem | + | |
</ | </ | ||
- | Pour sécuriser le serveur ssh, ajoutez ou modifiez les directives suivantes : | + | Pour rendre l' |
- | + | ||
- | < | + | |
- | AllowGroups adm | + | |
- | Banner / | + | |
- | HostbasedAuthentication no | + | |
- | IgnoreRhosts yes | + | |
- | LoginGraceTime 60 | + | |
- | LogLevel INFO | + | |
- | PermitEmptyPasswords no | + | |
- | PermitRootLogin no | + | |
- | PrintLastLog yes | + | |
- | Protocol 2 | + | |
- | StrictModes yes | + | |
- | X11Forwarding no | + | |
- | </ | + | |
- | + | ||
- | Votre fichier ressemblera à celui-ci | + | |
< | < | ||
- | [root@centos8 tmp]# vi sshd_config | + | [root@redhat9 ~]# systemctl start httpd.service |
- | [root@centos8 tmp]# cat sshd_config | + | |
- | 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 | + | |
- | PasswordAuthentication yes | + | |
- | ChallengeResponseAuthentication no | + | |
- | GSSAPIAuthentication yes | + | |
- | GSSAPICleanupCredentials no | + | |
- | UsePAM yes | + | |
- | PrintMotd no | + | |
- | AcceptEnv LANG LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES | + | |
- | AcceptEnv LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT | + | |
- | AcceptEnv LC_IDENTIFICATION LC_ALL LANGUAGE | + | |
- | AcceptEnv XMODIFIERS | + | |
- | Subsystem | + | |
</ | </ | ||
- | Renommez le fichier **/ | + | Vérifiez ensuite l' |
< | < | ||
- | [root@centos8 tmp]# cp / | + | [root@redhat9 ~]# systemctl is-active httpd.service |
- | </ | + | active |
- | Copiez le fichier **/tmp/sshd_config** vers **/etc/ssh/** : | + | [root@redhat9 ~]# systemctl status httpd.service |
+ | ● httpd.service - The Apache HTTP Server | ||
+ | | ||
+ | | ||
+ | Docs: man: | ||
+ | Main PID: 7187 (httpd) | ||
+ | | ||
+ | Tasks: 177 (limit: 48800) | ||
+ | | ||
+ | CPU: 128ms | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
- | < | + | Sep 26 15:01:28 redhat9.ittraining.loc systemd[1]: Starting The Apache HTTP Server... |
- | [root@centos8 tmp]# cp / | + | Sep 26 15:01:28 redhat9.ittraining.loc httpd[7187]: Server configured, listening on: port 80 |
- | cp: overwrite '/ | + | Sep 26 15:01:28 redhat9.ittraining.loc systemd[1]: Started The Apache HTTP Server. |
</ | </ | ||
- | Redémarrez le service | + | Pour arrêter une Unité de service, utilisez la commande suivante |
< | < | ||
- | [root@centos8 tmp]# systemctl | + | [root@redhat9 ~]# systemctl |
- | [root@centos8 tmp]# systemctl status sshd | + | |
- | ● sshd.service | + | |
- | | + | |
- | | + | |
- | Docs: man: | + | |
- | | + | |
- | Main PID: 1042039 (sshd) | + | |
- | Tasks: 1 (limit: 23535) | + | |
- | | + | |
- | | + | |
- | | + | |
- | Aug 30 02:17:00 centos8.ittraining.loc systemd[1]: Starting OpenSSH server daemon... | + | [root@redhat9 ~]# systemctl status httpd.service |
- | Aug 30 02:17:00 centos8.ittraining.loc sshd[1042039]: Server listening on 0.0.0.0 port 22. | + | ○ httpd.service - The Apache HTTP Server |
- | Aug 30 02:17:00 centos8.ittraining.loc sshd[1042039]: Server listening on :: port 22. | + | Loaded: loaded (/ |
- | Aug 30 02:17:00 centos8.ittraining.loc systemd[1]: Started OpenSSH server daemon. | + | Active: inactive (dead) since Thu 2024-09-26 15:02:55 CEST; 2s ago |
- | [q] | + | |
- | </code> | + | Docs: man:httpd.service(8) |
+ | Process: 7187 ExecStart=/ | ||
+ | Main PID: 7187 (code=exited, | ||
+ | Status: "Total requests: 0; Idle/Busy workers 100/ | ||
+ | CPU: 178ms | ||
- | Mettez l' | + | Sep 26 15:01:28 redhat9.ittraining.loc systemd[1]: Starting The Apache HTTP Server... |
- | + | Sep 26 15:01:28 redhat9.ittraining.loc httpd[7187]: Server configured, listening on: port 80 | |
- | < | + | Sep 26 15:01:28 redhat9.ittraining.loc systemd[1]: Started The Apache HTTP Server. |
- | [root@centos8 tmp]# groups trainee | + | Sep 26 15:02:54 redhat9.ittraining.loc systemd[1]: Stopping The Apache HTTP Server... |
- | trainee | + | Sep 26 15:02:55 redhat9.ittraining.loc systemd[1]: httpd.service: |
- | [root@centos8 tmp]# usermod -aG adm trainee | + | Sep 26 15:02:55 redhat9.ittraining.loc systemd[1]: Stopped The Apache HTTP Server. |
- | [root@centos8 tmp]# groups trainee | + | |
- | trainee | + | |
</ | </ | ||
- | Pour générer les clefs du serveur, saisissez la commande suivante en tant que **root**. Notez que la passphrase doit être **vide**. | + | Pour désactiver un service au prochain démarrage |
< | < | ||
- | [root@centos8 tmp]# ssh-keygen -t dsa | + | [root@redhat9 ~]# systemctl disable httpd.service |
- | Generating public/ | + | Removed "/etc/systemd/system/multi-user.target.wants/httpd.service" |
- | Enter file in which to save the key (/ | + | |
- | Enter passphrase (empty for no passphrase): | + | |
- | Enter same passphrase again: | + | |
- | Your identification has been saved in /etc/ | + | |
- | Your public key has been saved in / | + | |
- | The key fingerprint is: | + | |
- | SHA256: | + | |
- | The key's randomart image is: | + | |
- | +---[DSA 1024]----+ | + | |
- | | | | + | |
- | | | + | |
- | |.o . o.+ | | + | |
- | |E. o.*.. . | | + | |
- | |+ooo.o +S o o | | + | |
- | |X==++ o o o | | + | |
- | |B/=+oo | | + | |
- | |Ooo++ | + | |
- | |. .o | | + | |
- | +----[SHA256]-----+ | + | |
- | </ | + | |
- | De la même façon, il est possible de générer les clefs au format **[[https://fr.wikipedia.org/ | + | [root@redhat9 ~]# systemctl status httpd.service |
+ | ○ httpd.service - The Apache HTTP Server | ||
+ | | ||
+ | | ||
+ | Docs: man:httpd.service(8) | ||
- | < | + | Sep 26 15:01:28 redhat9.ittraining.loc |
- | [root@centos8 tmp]# ssh-keygen -t rsa | + | Sep 26 15:01:28 redhat9.ittraining.loc httpd[7187]: Server configured, listening on: port 80 |
- | Generating public/ | + | Sep 26 15:01:28 redhat9.ittraining.loc systemd[1]: Started The Apache HTTP Server. |
- | Enter file in which to save the key (/ | + | Sep 26 15:02:54 redhat9.ittraining.loc |
- | Enter passphrase (empty for no passphrase): | + | Sep 26 15:02:55 redhat9.ittraining.loc systemd[1]: httpd.service: Deactivated successfully. |
- | Enter same passphrase again: | + | Sep 26 15:02:55 redhat9.ittraining.loc |
- | Your identification has been saved in / | + | |
- | Your public key has been saved in / | + | |
- | The key fingerprint is: | + | |
- | SHA256: | + | |
- | The key's randomart image is: | + | |
- | +---[RSA 3072]----+ | + | |
- | | . .==o. | | + | |
- | | o oo o=+ . | | + | |
- | |.. oo=+=o . + | | + | |
- | |oo .+E++.+ = * | | + | |
- | |o.. +.S B * . | | + | |
- | |. B + = | | + | |
- | | = | | + | |
- | | | + | |
- | | . | | + | |
- | +----[SHA256]-----+ | + | |
- | [root@centos8 tmp]# ssh-keygen -t ecdsa | + | |
- | Generating public/ | + | |
- | 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: | + | |
- | SHA256:AMqFUJKGqnUEPh/ | + | |
- | The key's randomart image is: | + | |
- | +---[ECDSA 256]---+ | + | |
- | |++*=+ | + | |
- | |oX.=o+ o o | | + | |
- | |o %.B + + | | + | |
- | |...O.= o | + | |
- | |..E.o . S o | | + | |
- | |. . o = | | + | |
- | | . * . | | + | |
- | | . ... o | | + | |
- | | ..ooo.. | + | |
- | +----[SHA256]-----+ | + | |
- | [root@centos8 tmp]# ssh-keygen -t ed25519 | + | |
- | Generating public/ | + | |
- | 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: | + | |
- | SHA256:CtbcN9iXv00PfbHFGf2bEW7iRibOFwRctyqM5hmlhwE root@centos8.ittraining.loc | + | |
- | The key's randomart image is: | + | |
- | +--[ED25519 256]--+ | + | |
- | | | + | |
- | | . .. . o| | + | |
- | | . . . +.| | + | |
- | | o . oB ..o.=| | + | |
- | | o o S*+=o* *+| | + | |
- | | . . .o.*o*.+.B| | + | |
- | | . o o +o++| | + | |
- | | o =o| | + | |
- | | . o| | + | |
- | +----[SHA256]-----+ | + | |
</ | </ | ||
- | Les clefs publiques générées possèdent l' | + | ===5.2 - Gestion |
- | < | + | Systemd permet l' |
- | [root@centos8 tmp]# ls /etc/ssh | + | |
- | moduli | + | |
- | ssh_config | + | |
- | </ | + | |
- | + | ||
- | Re-démarrez ensuite | + | |
< | < | ||
- | [root@centos8 tmp]# systemctl restart sshd.service | + | [root@redhat9 ~]# cat / |
- | [root@centos8 tmp]# systemctl status sshd.service | + | # This is a template for httpd instances. |
- | ● sshd.service - OpenSSH server daemon | + | # See httpd@.service(8) for more information. |
- | | + | |
- | Active: active (running) since Mon 2021-08-30 02:24:57 EDT; 9s ago | + | |
- | Docs: man:sshd(8) | + | |
- | | + | |
- | Main PID: 1042204 (sshd) | + | |
- | Tasks: 1 (limit: 23535) | + | |
- | | + | |
- | | + | |
- | | + | |
- | Aug 30 02:24:57 centos8.ittraining.loc systemd[1]: Starting OpenSSH server daemon... | + | [Unit] |
- | Aug 30 02:24:57 centos8.ittraining.loc sshd[1042204]: | + | Description=The Apache HTTP Server |
- | Aug 30 02:24:57 centos8.ittraining.loc sshd[1042204]: | + | After=network.target remote-fs.target nss-lookup.target |
- | Aug 30 02:24:57 centos8.ittraining.loc systemd[1]: Started OpenSSH server daemon. | + | Documentation=man:httpd@.service(8) |
- | [q] | + | |
- | </ | + | |
- | ===Configuration du Client=== | + | [Service] |
- | + | Type=notify | |
- | Saisissez maintenant les commandes suivantes en tant que **trainee** : | + | Environment=LANG=C |
- | + | Environment=HTTPD_INSTANCE=%i | |
- | <WRAP center round important 60%> | + | ExecStartPre=/ |
- | **Important** | + | ExecStartPre=/bin/ |
- | </WRAP> | + | ExecStartPre=/ |
- | + | ExecStartPre=/bin/chown apache.apache | |
- | < | + | ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND -f conf/%i.conf |
- | [root@centos8 tmp]# exit | + | ExecReload=/usr/sbin/httpd $OPTIONS -k graceful -f conf/%i.conf |
- | logout | + | # Send SIGWINCH for graceful stop |
- | [trainee@centos8 ~]$ ssh-keygen | + | KillSignal=SIGWINCH |
- | Generating public/private dsa key pair. | + | KillMode=mixed |
- | Enter file in which to save the key (/home/ | + | PrivateTmp=true |
- | Created directory '/home/trainee/.ssh'. | + | OOMPolicy=continue |
- | Enter passphrase (empty for no passphrase): | + | |
- | Enter same passphrase again: | + | |
- | Your identification has been saved in /home/trainee/.ssh/id_dsa. | + | |
- | Your public key has been saved in /home/trainee/.ssh/id_dsa.pub. | + | |
- | The key fingerprint is: | + | |
- | SHA256: | + | |
- | The key's randomart image is: | + | |
- | +---[DSA 1024]----+ | + | |
- | | | + | |
- | | o +o=o oo=| | + | |
- | | . +.+oB+ | | + | |
- | | o o.& | + | |
- | | S o o.*.o| | + | |
- | | o o o.| | + | |
- | | . + + | | + | |
- | | + . o | | + | |
- | | E .| | + | |
- | +----[SHA256]-----+ | + | |
- | [trainee@centos8 ~]$ ssh-keygen -t rsa | + | |
- | Generating public/ | + | |
- | Enter file in which to save the key (/ | + | [Install] |
- | Enter same passphrase again: | + | WantedBy=multi-user.target |
- | Your identification has been saved in / | + | |
- | Your public key has been saved in / | + | |
- | The key fingerprint is: | + | |
- | SHA256: | + | |
- | The key's randomart image is: | + | |
- | +---[RSA 3072]----+ | + | |
- | |o+o++oo | + | |
- | |=+o.oo . .=B . | | + | |
- | |=. ..o o+... | | + | |
- | |. =.o o.. . | | + | |
- | | oS= = o | | + | |
- | | .. = = | | + | |
- | | | + | |
- | | +...E | | + | |
- | | . o+... | | + | |
- | +----[SHA256]-----+ | + | |
- | [trainee@centos8 ~]$ ssh-keygen -t ecdsa | + | |
- | 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: | + | |
- | SHA256: | + | |
- | The key's randomart image is: | + | |
- | +---[ECDSA 256]---+ | + | |
- | |o.. | | + | |
- | |.oo | | + | |
- | |.*o . . | | + | |
- | |+.++ B | | + | |
- | |+o =B + S | | + | |
- | |=*oo.* = | | + | |
- | |B.* o O . | | + | |
- | |.= = = o.. | | + | |
- | |. E o oo+. | | + | |
- | +----[SHA256]-----+ | + | |
- | [trainee@centos8 ~]$ ssh-keygen -t ed25519 | + | |
- | Generating public/ | + | |
- | 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: | + | |
- | SHA256: | + | |
- | The key's randomart image is: | + | |
- | +--[ED25519 256]--+ | + | |
- | | | + | |
- | | o==O+Boo | | + | |
- | | o ooE.O. | | + | |
- | | | + | |
- | | S + ...| | + | |
- | | | + | |
- | | . + o.o| | + | |
- | | + +.oo| | + | |
- | | o..o.| | + | |
- | +----[SHA256]-----+ | + | |
</ | </ | ||
- | Les clés générées seront placées dans le répertoire **~/ | + | Une instance créée à partir de ce gabarit devrait avoir un nom sous la forme suivante |
< | < | ||
- | [trainee@centos8 ~]$ ls .ssh | + | httpd@< |
- | id_dsa | + | |
</ | </ | ||
- | ===Tunnels SSH=== | + | Dans ce fichier on peut constater 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 | + | * %n : est remplacé par le nom complet échappé de l' |
+ | * %N : est remplacé par le nom complet non-échappé de l' | ||
+ | * %p : est remplacé par le préfixe échappé de l' | ||
+ | * %P : est remplacé par le préfixe non-échappé de l' | ||
+ | * %i : est remplacé par le nom de l' | ||
+ | * %I : est remplacé par le nom de l' | ||
+ | * %f : est remplacé par le préfixe non-échappé ou le nom de l' | ||
+ | * %c : est remplacé par le CGroup de l' | ||
+ | * %u : est remplacé par le nom de l' | ||
+ | * %U : est remplacé par l'UID de l' | ||
+ | * %H : est remplacé par le nom d' | ||
+ | * %% : est remplacé" | ||
- | La commande pour créer un tunnel ssh prend la forme suivante : | + | Créez maintenant deux copies du fichier **/ |
- | + | ||
- | ssh -N -f compte@hôte -Lport-local: | + | |
- | + | ||
- | Dans votre cas, vous allez créer un tunnel dans votre propre vm entre le port 15023 et le port 23 : | + | |
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | \S | + | |
- | Kernel \r on an \m | + | |
- | trainee@localhost' | + | |
- | </code> | + | |
- | Installez maintenant le serveur telnet : | + | [root@redhat9 |
- | + | ||
- | < | + | |
- | [root@centos8 | + | |
</ | </ | ||
- | Telnet n'est ni démarré ni activé. Il convient donc de le démarrer et de l' | + | Créez deux copies du fichier **/ |
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | ● telnet.socket - Telnet Server Activation Socket | + | |
- | | + | |
- | | + | |
- | Docs: man: | + | |
- | | + | |
- | | + | |
- | + | ||
- | [root@centos8 ~]# systemctl start telnet.socket | + | |
- | [root@centos8 | + | [root@redhat9 |
- | ● telnet.socket - Telnet Server Activation Socket | + | |
- | | + | |
- | | + | |
- | Docs: man: | + | |
- | | + | |
- | | + | |
- | | + | |
- | + | ||
- | Aug 30 02:44:01 centos8.ittraining.loc systemd[1]: Listening on Telnet Server Activation Socket. | + | |
- | + | ||
- | [root@centos8 ~]# systemctl enable telnet.socket | + | |
- | Created symlink | + | |
</ | </ | ||
- | Connectez-vous ensuite via telnet sur le port 15023, vous constaterez que votre connexion n' | + | Editez la directive **Listen** du fichier **/ |
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | Trying ::1... | + | |
- | Connected to localhost. | + | |
- | Escape character is ' | + | |
- | Kernel | + | [root@redhat9 ~]# more / |
- | centos8 login: trainee | + | # |
- | Password: | + | # This is the main Apache HTTP server configuration file. It contains the |
- | Last login: Mon Aug 30 02:37:00 from ::1 | + | # configuration directives that give the server its instructions. |
- | [trainee@centos8 ~]$ whoami | + | # See < |
- | trainee | + | # In particular, see |
- | [trainee@centos8 ~]$ pwd | + | # < |
- | /home/trainee | + | # for a discussion of each configuration directive. |
- | </code> | + | # |
+ | # See the httpd.conf(5) man page for more information | ||
+ | # and httpd.service(8) on using and configuring the httpd service. | ||
+ | # | ||
+ | # Do NOT simply read the instructions in here without understanding | ||
+ | # what they do. They' | ||
+ | # consult the online docs. You have been warned. | ||
+ | # | ||
+ | # Configuration and logfile names: If the filenames you specify for many | ||
+ | # of the server' | ||
+ | # server will use that explicit path. If the filenames do *not* begin | ||
+ | # with "/", | ||
+ | # with ServerRoot set to '/ | ||
+ | # server as '/www/log/ | ||
+ | # interpreted as '/log/ | ||
- | <WRAP center round important 60%> | + | # |
- | **Important** | + | # ServerRoot: The top of the directory tree under which the server' |
- | </WRAP> | + | # configuration, |
+ | # | ||
+ | # Do not add a slash at the end of the directory path. If you point | ||
+ | # ServerRoot at a non-local disk, be sure to specify a local disk on the | ||
+ | # Mutex directive, if file-based mutexes are used. If you wish to share the | ||
+ | # same ServerRoot for multiple httpd daemons, you will need to change at | ||
+ | # least PidFile. | ||
+ | # | ||
+ | ServerRoot "/etc/httpd" | ||
- | ====3.5 - SCP==== | + | # |
+ | # Listen: Allows you to bind Apache to specific IP addresses and/or | ||
+ | # ports, instead of the default. See also the < | ||
+ | # directive. | ||
+ | # | ||
+ | # Change this to Listen on a specific IP address, but note that if | ||
+ | # httpd.service is enabled to run at boot time, the address may not be | ||
+ | # available when the service starts. | ||
+ | # page for more information. | ||
+ | # | ||
+ | #Listen 12.34.56.78: | ||
+ | Listen 8008 | ||
+ | PidFile / | ||
+ | # | ||
+ | # Dynamic Shared Object (DSO) Support | ||
+ | # | ||
+ | # To be able to use the functionality of a module which was built as a DSO you | ||
+ | # have to place corresponding `LoadModule' | ||
+ | # directives contained in it are actually available _before_ they are used. | ||
+ | --More--(19%) | ||
+ | [q] | ||
+ | </ | ||
- | ===Présentation=== | + | Editez la directive **Listen** du fichier **/ |
- | La commande **scp** est le successeur et la remplaçante de la commande **rcp** de la famille des commandes **remote**. Il permet de faire des transferts sécurisés à partir d'une machine distante : | + | < |
+ | [root@redhat9 ~]# vi / | ||
- | $ scp compte@numero_ip(nom_de_machine):/chemin_distant/fichier_distant | + | [root@redhat9 ~]# more / |
+ | # | ||
+ | # This is the main Apache HTTP server configuration file. It contains the | ||
+ | # configuration directives that give the server its instructions. | ||
+ | # See < | ||
+ | # In particular, see | ||
+ | # < | ||
+ | # for a discussion of each configuration directive. | ||
+ | # | ||
+ | # See the httpd.conf(5) man page for more information on this configuration, | ||
+ | # and httpd.service(8) on using and configuring the httpd service. | ||
+ | # | ||
+ | # Do NOT simply read the instructions in here without understanding | ||
+ | # what they do. They' | ||
+ | # consult the online docs. You have been warned. | ||
+ | # | ||
+ | # Configuration and logfile names: If the filenames you specify for many | ||
+ | # of the server' | ||
+ | # server will use that explicit path. If the filenames do *not* begin | ||
+ | # with "/", | ||
+ | # with ServerRoot set to '/ | ||
+ | # server as '/ | ||
+ | # interpreted as '/log/access_log' | ||
- | ou vers une machine distante | + | # |
+ | # ServerRoot: The top of the directory tree under which the server' | ||
+ | # configuration, | ||
+ | # | ||
+ | # Do not add a slash at the end of the directory path. If you point | ||
+ | # ServerRoot at a non-local disk, be sure to specify a local disk on the | ||
+ | # Mutex directive, if file-based mutexes are used. If you wish to share the | ||
+ | # same ServerRoot for multiple httpd daemons, you will need to change at | ||
+ | # least PidFile. | ||
+ | # | ||
+ | ServerRoot "/ | ||
- | $ scp / | + | # |
- | + | # Listen: Allows you to bind Apache to specific IP addresses and/or | |
- | ===Utilisation=== | + | # ports, instead of the default. See also the < |
- | + | # directive. | |
- | Nous allons maintenant utiliser **scp** pour chercher un fichier sur le << | + | # |
+ | # Change this to Listen on a specific IP address, but note that if | ||
+ | # httpd.service is enabled to run at boot time, the address may not be | ||
+ | # available when the service starts. | ||
+ | # page for more information. | ||
+ | # | ||
+ | #Listen 12.34.56.78:80 | ||
+ | Listen 8009 | ||
+ | PidFile / | ||
- | Créez le fichier **/ | + | # |
- | + | # Dynamic Shared Object (DSO) Support | |
- | < | + | # |
- | [trainee@centos8 ~]$ touch scp-test | + | # To be able to use the functionality of a module which was built as a DSO you |
- | [trainee@centos8 ~]$ exit | + | # have to place corresponding `LoadModule' |
- | logout | + | # directives contained in it are actually available _before_ they are used. |
- | Connection closed by foreign host. | + | --More--(19%) |
- | [root@centos8 ~]# | + | [q] |
</ | </ | ||
- | Récupérez le fichier **scp_test** en utilisant scp : | + | Démarrez les deux services |
< | < | ||
- | [root@centos8 | + | [root@redhat9 |
- | The authenticity of host ' | + | |
- | ECDSA key fingerprint is SHA256: | + | |
- | Are you sure you want to continue connecting (yes/ | + | |
- | Warning: Permanently added ' | + | |
- | \S | + | |
- | Kernel \r on an \m | + | |
- | trainee@127.0.0.1' | + | |
- | scp-test | + | |
- | [root@centos8 | + | [root@redhat9 |
- | total 32 | + | ● httpd@instance01.service |
- | -rw-------. 1 root root 1358 Jun 16 06:40 anaconda-ks.cfg | + | Loaded: loaded (/ |
- | drwxr-xr-x. 3 root root 21 Jun 16 06:39 home | + | Active: active (running) since Thu 2024-09-26 15:14:25 CEST; 9s ago |
- | -rw-r--r--. 1 root root 1749 Aug 24 11:20 I2TCH.asc | + | Docs: man:httpd@.service(8) |
- | -rw-r--r--. 1 root root 1853 Jun 16 06:54 initial-setup-ks.cfg | + | |
- | -rw-r--r--. 1 root root | + | Process: 7425 ExecStartPre=/ |
- | -rw-r--r--. 1 root root 561 Aug 24 11:32 message.txt.asc | + | |
- | -rw-r--r--. 1 root root 367 Aug 24 11:30 message.txt.gpg | + | Process: 7427 ExecStartPre=/ |
- | -rw-r--r--. 1 root root 329 Aug 24 11:23 message.txt.sig | + | |
- | -rw-r--r--. 1 root root 0 Aug 30 03:55 scp-test | + | Status: "Total requests: 0; Idle/Busy workers 100/ |
- | -rw-r--r--. 1 root root 46 Aug 29 06:22 wget_file.txt | + | Tasks: 177 (limit: 48800) |
- | </code> | + | |
+ | CPU: 122ms | ||
+ | | ||
+ | ├─7429 / | ||
+ | ├─7430 / | ||
+ | ├─7431 / | ||
+ | ├─7432 / | ||
+ | └─7433 | ||
- | ====3.6 - Mise en Place des Clefs Asymétriques==== | + | Sep 26 15:14:24 redhat9.ittraining.loc systemd[1]: Starting The Apache HTTP Server... |
+ | Sep 26 15:14:25 redhat9.ittraining.loc httpd[7429]: | ||
+ | Sep 26 15:14:25 redhat9.ittraining.loc systemd[1]: Started The Apache HTTP Server. | ||
- | Il convient maintenant de se connecter sur le << | + | [root@redhat9 |
- | < | + | [root@redhat9 |
- | [root@centos8 | + | ● httpd@instance02.service - The Apache HTTP Server |
- | \S | + | |
- | Kernel \r on an \m | + | Active: active (running) since Thu 2024-09-26 15:14:43 CEST; 7s ago |
- | trainee@127.0.0.1's password: trainee | + | Docs: man: |
- | Activate the web console with: systemctl enable | + | Process: 7614 ExecStartPre=/ |
+ | | ||
+ | Process: 7616 ExecStartPre=/ | ||
+ | Process: 7617 ExecStartPre=/ | ||
+ | Main PID: 7618 (httpd) | ||
+ | | ||
+ | Tasks: 177 (limit: 48800) | ||
+ | | ||
+ | CPU: 113ms | ||
+ | CGroup: / | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
- | [trainee@centos8 ~]$ ls -la | grep .ssh | + | Sep 26 15:14:43 redhat9.ittraining.loc systemd[1]: Starting The Apache HTTP Server... |
- | drwx------. 2 trainee trainee | + | Sep 26 15:14:43 redhat9.ittraining.loc httpd[7618]: Server configured, listening on: port 8009 |
+ | Sep 26 15:14:43 redhat9.ittraining.loc systemd[1]: Started The Apache HTTP Server. | ||
</ | </ | ||
- | <WRAP center round important 60%> | + | ===5.3 |
- | **Important** | + | |
- | </ | + | |
- | Ensuite, il convient de transférer le fichier local **.ssh/ | + | Il est possible d' |
< | < | ||
- | [trainee@centos8 | + | [root@redhat9 |
- | logout | + | ○ httpd.service - The Apache HTTP Server |
- | Connection to 127.0.0.1 closed. | + | Loaded: loaded (/ |
+ | | ||
+ | Docs: man:httpd.service(8) | ||
- | [root@centos8 ~]# exit | + | Sep 26 15:01:28 redhat9.ittraining.loc systemd[1]: Starting The Apache HTTP Server... |
- | logout | + | Sep 26 15:01:28 redhat9.ittraining.loc httpd[7187]: |
+ | Sep 26 15:01:28 redhat9.ittraining.loc systemd[1]: Started The Apache HTTP Server. | ||
+ | Sep 26 15:02:54 redhat9.ittraining.loc systemd[1]: Stopping The Apache HTTP Server... | ||
+ | Sep 26 15:02:55 redhat9.ittraining.loc systemd[1]: httpd.service: | ||
+ | Sep 26 15:02:55 redhat9.ittraining.loc systemd[1]: Stopped The Apache HTTP Server. | ||
- | [trainee@centos8 | + | [root@redhat9 |
- | The authenticity of host ' | + | Created symlink |
- | ECDSA key fingerprint is SHA256:Q7T/CP0SLiMbMAIgVzTuEHegYS/ | + | |
- | Are you sure you want to continue connecting (yes/ | + | |
- | Warning: Permanently added ' | + | |
- | \S | + | |
- | Kernel \r on an \m | + | |
- | trainee@127.0.0.1' | + | |
- | id_ecdsa.pub | + | |
- | </ | + | |
- | Connectez-vous via telnet | + | [root@redhat9 ~]# systemctl enable httpd.service |
+ | Failed to enable unit: Unit file / | ||
- | < | + | [root@redhat9 |
- | [trainee@centos8 | + | Failed |
- | The authenticity of host ' | + | |
- | ECDSA key fingerprint is SHA256: | + | |
- | Are you sure you want to continue connecting (yes/ | + | |
- | Warning: Permanently added ' | + | |
- | \S | + | |
- | Kernel \r on an \m | + | |
- | Activate the web console with: systemctl enable --now cockpit.socket | + | |
- | + | ||
- | Last login: Mon Aug 30 03:57:14 2021 from 127.0.0.1 | + | |
- | [trainee@centos8 ~]$ | + | |
</ | </ | ||
- | <WRAP center round important 60%> | + | Pour autoriser de nouveau les modifications, |
- | **Important** - Lors de la connexion au serveur, l' | + | |
- | </ | + | |
- | + | ||
- | Insérez maintenant les clefs publiques restantes dans le fichier .ssh/ | + | |
< | < | ||
- | [trainee@centos8 | + | [root@redhat9 |
- | [trainee@centos8 .ssh]$ ls | + | Removed "/ |
- | authorized_keys | + | |
- | [trainee@centos8 .ssh]$ cat authorized_keys | + | [root@redhat9 ~]# systemctl enable httpd.service |
- | ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBHDrzSXP+Ecxf/ | + | Created symlink / |
+ | |||
+ | [root@redhat9 ~]# systemctl start httpd.service | ||
- | [trainee@centos8 .ssh]$ cat id_rsa.pub >> authorized_keys | + | [root@redhat9 ~]# systemctl status httpd.service |
- | [trainee@centos8 | + | ● httpd.service - The Apache HTTP Server |
- | [trainee@centos8 | + | |
+ | Active: active (running) since Thu 2024-09-26 15:17:38 CEST; 18s ago | ||
+ | Docs: man:httpd.service(8) | ||
+ | Main PID: 7896 (httpd) | ||
+ | | ||
+ | Tasks: 177 (limit: 48800) | ||
+ | | ||
+ | CPU: 99ms | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
- | [trainee@centos8 .ssh]$ cat authorized_keys | + | Sep 26 15:17:38 redhat9.ittraining.loc |
- | ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBHDrzSXP+Ecxf/ | + | Sep 26 15:17:38 redhat9.ittraining.loc |
- | ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQD3ZSMn/ | + | Sep 26 15:17:38 redhat9.ittraining.loc |
- | ssh-dss AAAAB3NzaC1kc3MAAACBALIdwEEqHrMWSUdzARm9ldsZK9ebbtZShtmwgdjphOk77fxymK0y6wV7QEmLL25LOcLb12uZ1F0LtRt/ | + | |
- | ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOfFQULLU8IZyKiSU63D2Zz6yGLqyHcBHnCRdSR9JSmc trainee@centos8.ittraining.loc | + | |
</ | </ | ||
----- | ----- | ||
Copyright © 2024 Hugh Norris. | Copyright © 2024 Hugh Norris. |