Différences

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

Lien vers cette vue comparative

Les deux révisions précédentesRévision précédente
Prochaine révision
Révision précédente
elearning:workbooks:centos:8:junior:l114 [2021/06/03 16:43] adminelearning:workbooks:centos:8:junior:l114 [2024/09/12 09:15] (Version actuelle) admin
Ligne 1: Ligne 1:
 ~~PDF:LANDSCAPE~~ ~~PDF:LANDSCAPE~~
  
-Version : **2021.01**+Version : **2024.01**
  
 Dernière mise-à-jour : ~~LASTMOD~~ Dernière mise-à-jour : ~~LASTMOD~~
  
-======LCF208 - Gestion de la Journalisation======+======LCF508 - Gestion de la Journalisation======
  
 =====Contenu du Module===== =====Contenu du Module=====
  
-  * **LCF208 - Gestion de la Journalisation** +  * **LCF508 - Gestion de la Journalisation**
-    * Contenu du Module+
     * Présentation     * Présentation
     * La Commande dmesg     * La Commande dmesg
-    * Surveillance Sécuritaire +    * LAB #1 - Surveillance Sécuritaire 
-      * La Commande last +      * 1.1 - La Commande last 
-      * La Commande lastlog +      * 1.2 - La Commande lastlog 
-      * La Commande lastb +      * 1.3 - La Commande lastb 
-      * Le Fichier /var/log/secure +      * 1.4 - Le Fichier /var/log/secure 
-    * Le fichier /var/log/audit/audit.log +      * 1.5 - Gestion des évènements audit 
-      * Gestion des événements audit+        * Le fichier /var/log/audit/audit.log
         * auditd         * auditd
         * auditctl         * auditctl
         * audispd         * audispd
-      * La consultation des événements audit +        * La consultation des événements audit 
-        * La Commande aureport +          * La Commande aureport 
-        * La Commande ausearch+          * La Commande ausearch
     * Le fichier /var/log/messages     * Le fichier /var/log/messages
     * Applications     * Applications
-    * rsyslog +    * LAB #2 - rsyslog 
-      * Priorités +      * 2.1 - Priorités 
-      * Sous-systèmes applicatifs +      * 2.2 - Sous-systèmes applicatifs 
-      * /etc/rsyslog.conf+      * 2.3 - /etc/rsyslog.conf
         * Modules         * Modules
         * Directives Globales         * Directives Globales
Ligne 41: Ligne 40:
           * n Sous-systèmes avec la même priorité           * n Sous-systèmes avec la même priorité
           * n Sélecteurs avec la même Action           * n Sélecteurs avec la même Action
-    * La Commande logger +    * LAB #3 - La Commande logger 
-    * La Commande logrotate +    * LAB #4 - La Commande logrotate 
-    * La Journalisation avec journald +    * LAB #5 - La Journalisation avec journald 
-      * Consultation des Journaux +      * 5.1 - Consultation des Journaux 
-        * Consultation des Journaux d'une Application Spécifique +      5.2 - Consultation des Journaux d'une Application Spécifique 
-        * Consultation des Journaux depuis le Dernier Démarrage +      5.3 - Consultation des Journaux depuis le Dernier Démarrage 
-        * Consultation des Journaux d'une Priorité Spécifique +      5.4 - Consultation des Journaux d'une Priorité Spécifique 
-        * Consultation des Journaux d'une Plage de Dates ou d'Heures +      5.5 - Consultation des Journaux d'une Plage de Dates ou d'Heures 
-        * Consultation des Journaux en Live +      5.6 - Consultation des Journaux en Live 
-        * Consultation des Journaux avec des Mots Clefs+      5.7 - Consultation des Journaux avec des Mots Clefs
  
 =====Présentation===== =====Présentation=====
Ligne 56: Ligne 55:
 La majorité des journaux du système et des applications se trouve dans le répertoire **/var/log**. La majorité des journaux du système et des applications se trouve dans le répertoire **/var/log**.
  
-<WRAP center round important>+<WRAP center round important 60%>
 **Important** : Il est conseillé de déplacer le point de montage du répertoire **/var/log** sur une partition physique ou un volume logique à part. De cette façon, en cas de journalisation rapide trop bavarde la limite de la taille de ce répertoire est celle de la taille de la partition physique ou du volume logique. Si vous laissez ce répertoire dans la racine du système, il existe un risque à ce que les journaux grossissent si vite qu'ils occupent toute l'espace disque libre, créant ainsi un crash système. **Important** : Il est conseillé de déplacer le point de montage du répertoire **/var/log** sur une partition physique ou un volume logique à part. De cette façon, en cas de journalisation rapide trop bavarde la limite de la taille de ce répertoire est celle de la taille de la partition physique ou du volume logique. Si vous laissez ce répertoire dans la racine du système, il existe un risque à ce que les journaux grossissent si vite qu'ils occupent toute l'espace disque libre, créant ainsi un crash système.
 </WRAP> </WRAP>
Ligne 65: Ligne 64:
  
 <code> <code>
-[root@centos7 ~]# dmesg | more +[root@centos8 ~]# dmesg | more 
-[    0.000000] Initializing cgroup subsys cpuset +[    0.000000] Linux version 4.18.0-240.22.1.el8_3.x86_64 (mockbuild@kbuilder.bsys.centos.org) (gcc version 8.3.1 20191121 (Red Hat 8.3.1-5) (
-[    0.000000] Initializing cgroup subsys cpu +CC)) #1 SMP Thu Apr 8 19:01:30 UTC 2021 
-[    0.000000] Initializing cgroup subsys cpuacct +[    0.000000] Command line: BOOT_IMAGE=(hd0,msdos1)/vmlinuz-4.18.0-240.22.1.el8_3.x86_64 root=UUID=4c0cc28c-0d59-45be-bd73-d292b80be33c ro cra 
-[    0.000000] Linux version 3.10.0-229.4.2.el7.x86_64 (builder@kbuilder.dev.centos.org) (gcc version 4.8.2 20140120 (Red Hat 4.8.2-16) (GCC) ) #1 SMP +shkernel=auto resume=UUID=c8bb3f47-d67f-4b21-b781-766899dc83d4 rhgb quiet 
- Wed May 13 10:06:09 UTC 2015 +[    0.000000] x86/fpuSupporting XSAVE feature 0x001: 'x87 floating point registers' 
-[    0.000000] Command line: BOOT_IMAGE=/vmlinuz-3.10.0-229.4.2.el7.x86_64 root=UUID=b35de665-5ec8-4226-a533-58a1b567ac91 ro vconsole.keymap=fr crashk +[    0.000000] x86/fpu: Supporting XSAVE feature 0x002: 'SSE registers' 
-ernel=auto vconsole.font=latarcyrheb-sun16 rhgb quiet +[    0.000000] x86/fpu: Supporting XSAVE feature 0x004: 'AVX registers' 
-[    0.000000] e820: BIOS-provided physical RAM map:+[    0.000000] x86/fpu: xstate_offset[2]:  576, xstate_sizes[2]:  256 
 +[    0.000000] x86/fpu: Enabled xstate features 0x7, context size is 832 bytes, using 'standard' format. 
 +[    0.000000] BIOS-provided physical RAM map:
 [    0.000000] BIOS-e820: [mem 0x0000000000000000-0x000000000009fbff] usable [    0.000000] BIOS-e820: [mem 0x0000000000000000-0x000000000009fbff] usable
 [    0.000000] BIOS-e820: [mem 0x000000000009fc00-0x000000000009ffff] reserved [    0.000000] BIOS-e820: [mem 0x000000000009fc00-0x000000000009ffff] reserved
 [    0.000000] BIOS-e820: [mem 0x00000000000f0000-0x00000000000fffff] reserved [    0.000000] BIOS-e820: [mem 0x00000000000f0000-0x00000000000fffff] reserved
-[    0.000000] BIOS-e820: [mem 0x0000000000100000-0x000000005ffeffff] usable +[    0.000000] BIOS-e820: [mem 0x0000000000100000-0x00000000dffeffff] usable 
-[    0.000000] BIOS-e820: [mem 0x000000005fff0000-0x000000005fffffff] ACPI data+[    0.000000] BIOS-e820: [mem 0x00000000dfff0000-0x00000000dfffffff] ACPI data 
 +[    0.000000] BIOS-e820: [mem 0x00000000fec00000-0x00000000fec00fff] reserved 
 +[    0.000000] BIOS-e820: [mem 0x00000000fee00000-0x00000000fee00fff] reserved
 [    0.000000] BIOS-e820: [mem 0x00000000fffc0000-0x00000000ffffffff] reserved [    0.000000] BIOS-e820: [mem 0x00000000fffc0000-0x00000000ffffffff] reserved
 +[    0.000000] BIOS-e820: [mem 0x0000000100000000-0x000000011fffffff] usable
 [    0.000000] NX (Execute Disable) protection: active [    0.000000] NX (Execute Disable) protection: active
 [    0.000000] SMBIOS 2.5 present. [    0.000000] SMBIOS 2.5 present.
 [    0.000000] DMI: innotek GmbH VirtualBox/VirtualBox, BIOS VirtualBox 12/01/2006 [    0.000000] DMI: innotek GmbH VirtualBox/VirtualBox, BIOS VirtualBox 12/01/2006
-[    0.000000] e820update [mem 0x00000000-0x00000fff] usable ==> reserved +[    0.000000] Hypervisor detectedKVM
-[    0.000000] e820: remove [mem 0x000a0000-0x000fffff] usable +
-[    0.000000] No AGP bridge found +
-[    0.000000] e820: last_pfn = 0x5fff0 max_arch_pfn = 0x400000000 +
-[    0.000000] MTRR default type: uncachable +
-[    0.000000] MTRR variable ranges disabled: +
-[    0.000000] x86 PAT enabled: cpu 0, old 0x7040600070406, new 0x7010600070106 +
-[    0.000000] CPU MTRRs all blank - virtualized system. +
-[    0.000000] found SMP MP-table at [mem 0x0009fff0-0x0009ffff] mapped at [ffff88000009fff0] +
-[    0.000000] Base memory trampoline at [ffff880000099000] 99000 size 24576 +
-[    0.000000] init_memory_mapping: [mem 0x00000000-0x000fffff] +
-[    0.000000]  [mem 0x00000000-0x000fffff] page 4k+
 --More-- --More--
 </code> </code>
- 
-====Options de la Commande==== 
  
 Les option de cette commande sont : Les option de cette commande sont :
  
 <code> <code>
-[root@centos7 ~]# dmesg --help+[root@centos8 ~]# dmesg --help
  
 Usage: Usage:
  dmesg [options]  dmesg [options]
 +
 +Display or control the kernel ring buffer.
  
 Options: Options:
Ligne 112: Ligne 105:
  -c, --read-clear            read and clear all messages  -c, --read-clear            read and clear all messages
  -D, --console-off           disable printing messages to console  -D, --console-off           disable printing messages to console
- -d, --show-delta            show time delta between printed messages 
- -e, --reltime               show local time and time delta in readable format 
  -E, --console-on            enable printing messages to console  -E, --console-on            enable printing messages to console
  -F, --file <file>           use the file instead of the kernel log buffer  -F, --file <file>           use the file instead of the kernel log buffer
Ligne 119: Ligne 110:
  -H, --human                 human readable output  -H, --human                 human readable output
  -k, --kernel                display kernel messages  -k, --kernel                display kernel messages
- -L, --color                 colorize messages+ -L, --color[=<when>       colorize messages (auto, always or never) 
 +                               colors are enabled by default
  -l, --level <list>          restrict output to defined levels  -l, --level <list>          restrict output to defined levels
  -n, --console-level <level> set level of messages printed to console  -n, --console-level <level> set level of messages printed to console
  -P, --nopager               do not pipe output into a pager  -P, --nopager               do not pipe output into a pager
 + -p, --force-prefix          force timestamp output on each line of multi-line messages
  -r, --raw                   print the raw message buffer  -r, --raw                   print the raw message buffer
  -S, --syslog                force to use syslog(2) rather than /dev/kmsg  -S, --syslog                force to use syslog(2) rather than /dev/kmsg
  -s, --buffer-size <size>    buffer size to query the kernel ring buffer  -s, --buffer-size <size>    buffer size to query the kernel ring buffer
- -T, --ctime                 show human readable timestamp (could be  
-                               inaccurate if you have used SUSPEND/RESUME) 
- -t, --notime                don't print messages timestamp 
  -u, --userspace             display userspace messages  -u, --userspace             display userspace messages
  -w, --follow                wait for new messages  -w, --follow                wait for new messages
  -x, --decode                decode facility and level to readable string  -x, --decode                decode facility and level to readable string
 + -d, --show-delta            show time delta between printed messages
 + -e, --reltime               show local time and time delta in readable format
 + -T, --ctime                 show human-readable timestamp (may be inaccurate!)
 + -t, --notime                don't show any timestamp with messages
 +     --time-format <format>  show timestamp using the given format:
 +                               [delta|reltime|ctime|notime|iso]
 +Suspending/resume will make ctime and iso timestamps inaccurate.
  
- -h, --help     display this help and exit + -h, --help                  display this help 
- -V, --version  output version information and exit+ -V, --version               display version
  
 Supported log facilities: Supported log facilities:
Ligne 156: Ligne 153:
    debug - debug-level messages    debug - debug-level messages
  
- +For more details see dmesg(1).
-For more details see dmesg(q).+
 </code> </code>
  
-=====Surveillance Sécuritaire=====+=====LAB #1 - Surveillance Sécuritaire=====
  
-====La Commande last====+====1.1 - La Commande last====
  
 Cette commande indique les dates et heures des connexions des utilisateurs à partir du contenu du fichier **/var/log/wtmp** : Cette commande indique les dates et heures des connexions des utilisateurs à partir du contenu du fichier **/var/log/wtmp** :
  
 <code> <code>
-[root@centos7 ~]# last +[root@centos8 ~]# last 
-trainee  pts/0        :              Wed Oct 28 09:42   still logged in    +trainee  pts/0        10.0.2.2         Thu Jun  09:01   still logged in 
-trainee  :0           :              Wed Oct 28 09:41   still logged in    +reboot   system boot  4.18.0-240.22.1Thu Jun  09:01   still running 
-(unknown :0           :              Wed Oct 28 09:41 - 09:41  (00:00)     +trainee  pts/0        10.0.2.2         Wed Jun  2 12:07 crash  (20:54
-reboot   system boot  3.10.0-229.4.2.e Wed Oct 28 09:40 - 09:49  (00:09)     +trainee  pts/0        10.0.2.2         Wed Jun  2 11:16 - 12:06  (00:50
-trainee  pts/1        :0               Tue Oct 27 17:58 - 17:58  (00:00)     +reboot   system boot  4.18.0-240.22.1Wed Jun  11:12   still running 
-trainee  pts/2        :              Tue Oct 27 17:58 - 17:58  (00:00)     +trainee  pts/0        10.0.2.2         Wed Jun  2 11:13 11:14  (00:01
-trainee  pts/1        :              Tue Oct 27 17:58 - 17:58  (00:00)     +reboot   system boot  4.18.0-240.22.1Wed Jun  2 11:10 11:14  (00:04
-trainee  pts/1        :0               Tue Oct 27 16:33 16:33  (00:00    +trainee  pts/0        10.0.2.2         Wed Jun  2 11:08 11:12  (00:04
-trainee  pts/0        :              Tue Oct 27 16:17 - crash  (17:22)     +reboot   system boot  4.18.0-240.22.1. Wed Jun  11:04 - 11:12  (00:07
-trainee  :0           :              Tue Oct 27 16:17 crash  (17:22)     +trainee  pts/0        10.0.2.2         Wed Jun  2 06:40 11:06  (04:26
-(unknown :0           :              Tue Oct 27 16:07 - 16:17  (00:10    +trainee  pts/0        10.0.2.2         Wed Jun  2 06:39 06:39  (00:00) 
-reboot   system boot  3.10.0-229.4.2.e Tue Oct 27 16:06 - 09:49  (17:42)     +reboot   system boot  4.18.0-240.22.1Wed Jun  06:07 11:07  (04:59
-trainee  pts/1        :0               Tue Oct 27 11:47 - crash  (04:19)     +trainee  pts/1        10.0.2.2         Wed May 26 16:51 crash (6+13:15
-trainee  pts/0        :              Sat Oct 24 16:18 - crash (3+00:48)    +trainee  pts/0        10.0.2.2         Wed May 26 10:37 18:50  (08:13
-trainee  :0           :              Sat Oct 24 16:17 crash (3+00:48)    +trainee  pts/0        10.0.2.2         Wed May 26 08:48 10:36  (01:48
-(unknown :0           :              Sat Oct 24 16:17 - 16:17  (00:00    +trainee  tty1                          Wed May 26 08:47 crash (6+21:19
-reboot   system boot  3.10.0-229.4.2.e Sat Oct 24 16:16 09:49 (3+18:32   +reboot   system boot  4.18.0-240.22.1Wed May 26 08:44 11:07 (7+02:22
-trainee  pts/0        :              Thu Oct 15 13:07 - crash (9+03:09)    +trainee  pts/       10.0.2.2         Wed Apr 21 07:23 19:14  (11:51
-trainee  :0           :              Thu Oct 15 13:06 crash (9+03:10)    +trainee  pts/0        10.0.2.2         Tue Apr 20 23:13 07:22  (08:08
-(unknown :0           :              Thu Oct 15 13:05 - 13:06  (00:00    +trainee  pts/1                         Tue Apr 20 10:59 - 11:00  (00:00) 
-reboot   system boot  3.10.0-229.4.2.e Thu Oct 15 13:04 - 09:49 (12+21:44  +trainee  pts/0        10.0.2.2         Tue Apr 20 09:59 - 23:13  (13:13
-trainee  pts/0        :0               Thu Oct  8 21:42 - crash (6+15:22)    +trainee  pts/1        10.0.2.2         Tue Apr 20 04:10 04:29  (00:19
-trainee  :0           :              Thu Oct  8 21:41 - crash (6+15:22)    +trainee  pts/       10.0.2.2         Tue Apr 20 02:21 - 09:57  (07:36
-(unknown :0           :              Thu Oct  8 21:28 - 21:41  (00:12)     +trainee  tty1                          Tue Apr 20 02:17 crash (36+06:26
-reboot   system boot  3.10.0-229.4.2.e Thu Oct  8 21:28 09:49 (19+13:21  +trainee  pts/0        10.0.2.2         Mon Apr 19 13:55 02:17  (12:22
-trainee  pts/0        :0               Thu Oct  8 12:27 - 12:27  (00:00)     +trainee  pts/0        10.0.2.2         Mon Apr 19 12:05 13:47  (01:42
-trainee  :0           :              Thu Oct  8 12:25 - crash  (09:02)     +reboot   system boot  4.18.0-240.22.1. Mon Apr 19 12:05 11:07 (43+23:01
-(unknown :0           :              Thu Oct  8 12:25 - 12:25  (00:00)     +trainee  pts/0        10.0.2.2         Mon Apr 19 11:40 crash  (00:24
-reboot   system boot  3.10.0-229.4.2.e Thu Oct  8 12:24 - 09:49 (19+22:25)   +reboot   system boot  4.18.0-147.8.1.Mon Apr 19 11:37 11:07 (43+23:29
-trainee  :0           :              Sat Jun  6 09:44 crash (124+02:39)  +trainee  pts/0        10.0.2.2         Tue Sep  1 09:59 11:10  (01:10
-(unknown :0           :              Sat Jun  6 09:43 - 09:44  (00:00)     +reboot   system boot  4.18.0-147.8.1.e Tue Sep  1 09:58 11:10  (01:11
-reboot   system boot  3.10.0-229.4.2.e Sat Jun  6 09:43 09:49 (144+01:06)  +reboot   system boot  4.18.0-147.8.1.e Fri May  08:13 11:10 (116+02:56)
-(unknown :0           :              Fri Jun  5 17:22 - crash  (16:20    +
-reboot   system boot  3.10.0-229.4.2.e Fri Jun  5 17:22 09:49 (144+17:27)  +
-trainee  pts/0        :              Fri Jun  5 16:09 - 17:21  (01:12)     +
-trainee  pts/       :0               Thu Jun  4 16:05 16:05  (00:00    +
-trainee  pts/1        :              Thu Jun  4 16:05 - 16:05  (00:00)     +
-trainee  pts/1        :              Thu Jun  4 16:05 16:05  (00:00    +
-trainee  pts/0        :0               Thu Jun  4 15:38 16:08 (1+00:30)    +
-trainee  :0           :              Thu Jun  4 15:36 - 17:21 (1+01:45)    +
-(unknown :0           :              Thu Jun  4 15:36 - 15:36  (00:00    +
-reboot   system boot  3.10.0-229.4.2.e Thu Jun  4 15:35 17:21 (1+01:46   +
-trainee  pts/       :              Thu Jun  4 15:31 15:33  (00:02    +
-trainee  pts/0        :              Thu Jun  4 15:23 15:35  (00:11    +
-trainee  :0           :              Thu Jun  4 15:00 - 15:35  (00:34)     +
-(unknown :0           :              Thu Jun  4 14:59 - 15:00  (00:00)     +
-reboot   system boot  3.10.0-229.4.2.e Thu Jun  4 14:59 - 15:35  (00:36    +
-trainee  pts/1        :              Thu Jun  4 09:50 09:53  (00:03    +
-trainee  pts/       :              Thu Jun  4 09:41 - 09:42  (00:00    +
-trainee  pts/1        :0               Thu Jun  4 09:38 09:39  (00:00    +
-trainee  pts/0        :              Thu Jun  4 09:37 10:36  (00:58    +
-trainee  pts/0        :              Thu Jun  4 09:36 09:37  (00:00)     +
-trainee  :0           :              Thu Jun  4 09:35 - 10:36  (01:00    +
-(unknown :0           :              Mon Jun  1 17:31 - 09:35 (2+16:04)    +
-reboot   system boot  3.10.0-123.el7.Mon Jun  1 17:30 10:36 (2+17:05   +
-trainee  pts/0        :              Mon Jun  1 17:19 - 17:31  (00:11)     +
-trainee  :0           :              Mon Jun  1 15:43 17:31  (01:47)     +
-(unknown :0           :              Mon Jun  1 15:42 - 15:43  (00:01    +
-reboot   system boot  3.10.0-123.el7.Mon Jun  1 15:41 17:31  (01:49    +
-trainee  pts/0        :              Sun Mar  8 14:36 crash (85+00:05)   +
-trainee  :0           :              Sun Mar  8 14:35 - crash (85+00:05  +
-(unknown :0           :              Sun Mar  8 14:32 - 14:35  (00:03)     +
-reboot   system boot  3.10.0-123.el7.x Sun Mar  8 14:31 17:31 (85+01:59)   +
-trainee  :0           :              Sun Mar  8 14:25 - crash  (00:06)     +
-(unknown :0           :              Sun Mar  8 14:24 - 14:25  (00:00    +
-reboot   system boot  3.10.0-123.el7.x Sun Mar  14:23 17:31 (85+02:07 +
  
-wtmp begins Sun Mar  14:23:23 2015+wtmp begins Fri May  08:13:49 2020
 </code> </code>
- 
-===Options de la Commande=== 
  
 Les option de cette commande sont : Les option de cette commande sont :
  
 <code> <code>
-[root@centos7 ~]# last --help +[root@centos8 ~]# last --help 
-last: invalid option -- '-' + 
-Usage: last [-num | -n num] [-f file] [-t YYYYMMDDHHMMSS] [-R] [-adioxFw] [username..] [tty..]+Usage: 
 + last [options] [<username>...] [<tty>...] 
 + 
 +Show a listing of last logged in users. 
 + 
 +Options: 
 + -<number>            how many lines to show 
 + -a, --hostlast       display hostnames in the last column 
 + -d, --dns            translate the IP number back into a hostname 
 + -f, --file <file>    use a specific file instead of /var/log/wtmp 
 + -F, --fulltimes      print full login and logout times and dates 
 + -i, --ip             display IP numbers in numbers-and-dots notation 
 + -n, --limit <number> how many lines to show 
 + -R, --nohostname     don't display the hostname field 
 + -s, --since <time>   display the lines since the specified time 
 + -t, --until <time>   display the lines until the specified time 
 + -p, --present <time> display who were present at the specified time 
 + -w, --fullnames      display full user and domain names 
 + -x, --system         display system shutdown entries and run level changes 
 +     --time-format <format>  show timestamps in the specified <format>: 
 +                               notime|short|full|iso 
 + 
 + -h, --help           display this help 
 + -V, --version        display version 
 + 
 +For more details see last(1).
 </code> </code>
  
-====La Commande lastlog====+====1.2 - La Commande lastlog====
  
 Cette commande indique les dates et heures de la connexion au système la plus récente des utilisateurs : Cette commande indique les dates et heures de la connexion au système la plus récente des utilisateurs :
  
 <code> <code>
-[root@centos7 ~]# lastlog+[root@centos8 ~]# lastlog
 Username         Port     From             Latest Username         Port     From             Latest
-root             pts/                    Wed Oct 28 09:48:43 +0100 2015+root             pts/                    Thu Jun  3 09:01:46 -0400 2021
 bin                                        **Never logged in** bin                                        **Never logged in**
 daemon                                     **Never logged in** daemon                                     **Never logged in**
Ligne 269: Ligne 254:
 nobody                                     **Never logged in** nobody                                     **Never logged in**
 dbus                                       **Never logged in** dbus                                       **Never logged in**
 +systemd-coredump                           **Never logged in**
 +systemd-resolve                            **Never logged in**
 +tss                                        **Never logged in**
 polkitd                                    **Never logged in** polkitd                                    **Never logged in**
 unbound                                    **Never logged in** unbound                                    **Never logged in**
-colord                                     **Never logged in** 
-usbmuxd                                    **Never logged in** 
-avahi                                      **Never logged in** 
-avahi-autoipd                              **Never logged in** 
-saslauth                                   **Never logged in** 
-qemu                                       **Never logged in** 
 libstoragemgmt                             **Never logged in** libstoragemgmt                             **Never logged in**
 +cockpit-ws                                 **Never logged in**
 +sssd                                       **Never logged in**
 +setroubleshoot                             **Never logged in**
 +sshd                                       **Never logged in**
 +chrony                                     **Never logged in**
 +tcpdump                                    **Never logged in**
 +trainee          pts/0    10.0.2.2         Thu Jun  3 09:01:39 -0400 2021
 +cockpit-wsinstance                           **Never logged in**
 +rngd                                       **Never logged in**
 +gluster                                    **Never logged in**
 +qemu                                       **Never logged in**
 rpc                                        **Never logged in** rpc                                        **Never logged in**
 rpcuser                                    **Never logged in** rpcuser                                    **Never logged in**
-nfsnobody                                  **Never logged in** +saslauth                                   **Never logged in**
-rtkit                                      **Never logged in**+
 radvd                                      **Never logged in** radvd                                      **Never logged in**
-ntp                                        **Never logged in** +dnsmasq                                    **Never logged in** 
-chrony                                     **Never logged in** +fenestros2       pts/                    Tue Apr 20 15:20:26 -0400 2021 
-abrt                                       **Never logged in** +fenestros1                                 **Never logged in** 
-pulse                                      **Never logged in** +apache                                     **Never logged in**
-gdm              :                       Wed Oct 28 09:41:03 +0100 2015 +
-gnome-initial-setup                           **Never logged in** +
-postfix                                    **Never logged in** +
-sshd                                       **Never logged in** +
-tcpdump                                    **Never logged in** +
-trainee          :0                        Wed Oct 28 09:41:31 +0100 2015 +
-vboxadd                                    **Never logged in** +
-tss                                        **Never logged in**+
 </code> </code>
- 
-===Options de la Commande=== 
  
 Les option de cette commande sont : Les option de cette commande sont :
  
 <code> <code>
-[root@centos7 ~]# lastlog --help+[root@centos8 ~]# lastlog --help
 Usage: lastlog [options] Usage: lastlog [options]
  
 Options: Options:
   -b, --before DAYS             print only lastlog records older than DAYS   -b, --before DAYS             print only lastlog records older than DAYS
 +  -C, --clear                   clear lastlog record of an user (usable only with -u)
   -h, --help                    display this help message and exit   -h, --help                    display this help message and exit
   -R, --root CHROOT_DIR         directory to chroot into   -R, --root CHROOT_DIR         directory to chroot into
 +  -S, --set                     set lastlog record to current time (usable only with -u)
   -t, --time DAYS               print only lastlog records more recent than DAYS   -t, --time DAYS               print only lastlog records more recent than DAYS
   -u, --user LOGIN              print lastlog record of the specified LOGIN   -u, --user LOGIN              print lastlog record of the specified LOGIN
 </code> </code>
  
-====La Commande lastb====+====1.3 - La Commande lastb====
  
-Cette commande indique les dates et heures des connexions infructueueses des utilisateurs à partir du contenu du fichier **/var/log/btmp** :+Cette commande indique les dates et heures des connexions infructueuses des utilisateurs à partir du contenu du fichier **/var/log/btmp** :
  
 <code> <code>
-[root@centos7 ~]# lastb +[root@centos8 ~]# lastb 
-trainee  :0           :              Tue Jan 19 07:19 07:19  (00:00)     +trainee  tty1                          Thu Jun  3 09:51 09:51  (00:00) 
-trainee  :0           :              Tue Jan 19 07:19 - 07:19  (00:00)     +trainee  tty1                          Thu Jun  3 09:51 09:51  (00:00) 
-root     pts/                        Thu Oct 22 12:36 12:36  (00:00)     +trqinee  tty1                          Thu Jun  3 09:51 09:51  (00:00)
-trainee  :0           :              Thu Oct 15 15:01 15:01  (00:00)    +
  
-btmp begins Thu Oct 15 15:01:57 2015+btmp begins Thu Jun  3 09:51:07 2021
 </code> </code>
- 
-===Options de la Commande=== 
  
 Les options de cette commande sont : Les options de cette commande sont :
  
 <code> <code>
-[root@centos7 ~]# lastb --help +[root@centos8 ~]# lastb --help 
-lastb: invalid option -- '-' + 
-Usage: lastb [-num | -n num] [-f file] [-t YYYYMMDDHHMMSS] [-R] [-adioxFw] [username..] [tty..]+Usage: 
 + lastb [options] [<username>...] [<tty>...] 
 + 
 +Show a listing of last logged in users. 
 + 
 +Options: 
 + -<number>            how many lines to show 
 + -a, --hostlast       display hostnames in the last column 
 + -d, --dns            translate the IP number back into a hostname 
 + -f, --file <file>    use a specific file instead of /var/log/btmp 
 + -F, --fulltimes      print full login and logout times and dates 
 + -i, --ip             display IP numbers in numbers-and-dots notation 
 + -n, --limit <number> how many lines to show 
 + -R, --nohostname     don't display the hostname field 
 + -s, --since <time>   display the lines since the specified time 
 + -t, --until <time>   display the lines until the specified time 
 + -p, --present <time> display who were present at the specified time 
 + -w, --fullnames      display full user and domain names 
 + -x, --system         display system shutdown entries and run level changes 
 +     --time-format <format>  show timestamps in the specified <format>: 
 +                               notime|short|full|iso 
 + 
 + -h, --help           display this help 
 + -V, --version        display version 
 + 
 +For more details see last(1).
 </code> </code>
  
-====Le Fichier /var/log/secure====+====1.4 - Le Fichier /var/log/secure====
  
 Sous RHEL/CentOS ce fichier contient la journalisation des opérations de gestion des authentifications : Sous RHEL/CentOS ce fichier contient la journalisation des opérations de gestion des authentifications :
  
 <code> <code>
-[root@centos7 ~]# tail -n 15 /var/log/secure +[root@centos8 ~]# tail -n 15 /var/log/secure 
-Oct 27 17:31:02 centos7 polkitd[625]: <no filename>:0uncaught exception: Terminating runaway script +Jun  3 09:01:20 centos8 sshd[905]: Server listening on :: port 22. 
-Oct 27 17:31:02 centos7 polkitd[625]: Error evaluating authorization rules +Jun  3 09:01:39 centos8 sshd[1585]: Accepted password for trainee from 10.0.2.2 port 52734 ssh2 
-Oct 27 17:48:27 centos7 gdm-password]: gkr-pam: unlocked login keyring +Jun  3 09:01:39 centos8 systemd[1590]: pam_unix(systemd-user:session)session opened for user trainee by (uid=0) 
-Oct 28 09:40:43 centos7 polkitd[586]: Loading rules from directory /etc/polkit-1/rules.d +Jun  3 09:01:39 centos8 sshd[1585]: pam_unix(sshd:session)session opened for user trainee by (uid=0) 
-Oct 28 09:40:43 centos7 polkitd[586]: Loading rules from directory /usr/share/polkit-1/rules.d +Jun  3 09:01:46 centos8 su[1627]: pam_systemd(su-l:session)Cannot create session: Already running in a session or user slice 
-Oct 28 09:40:44 centos7 polkitd[586]: Finished loading, compiling and executing 5 rules +Jun  3 09:01:46 centos8 su[1627]: pam_unix(su-l:session): session opened for user root by trainee(uid=1000
-Oct 28 09:40:44 centos7 polkitd[586]: Acquired the name org.freedesktop.PolicyKit1 on the system bus +Jun  3 09:51:05 centos8 login[1158]: pam_unix(login:auth): check pass; user unknown 
-Oct 28 09:40:55 centos7 sshd[1217]: Server listening on 0.0.0.0 port 22. +Jun  3 09:51:05 centos8 login[1158]: pam_unix(login:auth): authentication failure; logname=LOGIN uid=0 euid=0 tty=tty1 ruser= rhost= 
-Oct 28 09:40:55 centos7 sshd[1217]: Server listening on :: port 22. +Jun  3 09:51:07 centos8 login[1158]: FAILED LOGIN 1 FROM tty1 FOR trqinee, Authentication failure 
-Oct 28 09:41:03 centos7 gdm-launch-environment]: pam_unix(gdm-launch-environment:session): session opened for user gdm by (uid=0+Jun  3 09:51:18 centos8 unix_chkpwd[2400]: password check failed for user (trainee
-Oct 28 09:41:18 centos7 polkitd[586]: Registered Authentication Agent for unix-session:c1 (system bus name :1.34 [gnome-shell --mode=gdm], object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale en_US.UTF-8+Jun  3 09:51:18 centos8 login[1158]: pam_unix(login:auth): authentication failure; logname=LOGIN uid=0 euid=0 tty=tty1 ruser= rhost=  user=trainee 
-Oct 28 09:41:31 centos7 gdm-password]: pam_unix(gdm-password:session): session opened for user trainee by (unknown)(uid=0) +Jun  3 09:51:20 centos8 login[1158]: FAILED LOGIN 2 FROM tty1 FOR traineeAuthentication failure 
-Oct 28 09:41:32 centos7 polkitd[586]: Unregistered Authentication Agent for unix-session:c1 (system bus name :1.34, object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale en_US.UTF-8) (disconnected from bus+Jun  3 09:51:45 centos8 login[1158]: pam_unix(login:auth): check pass; user unknown 
-Oct 28 09:41:43 centos7 polkitd[586]: Registered Authentication Agent for unix-session:(system bus name :1.73 [/usr/bin/gnome-shell], object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale en_US.utf8) +Jun  3 09:51:45 centos8 login[1158]: pam_unix(login:auth): authentication failure; logname=LOGIN uid=0 euid=0 tty=tty1 ruser= rhost= 
-Oct 28 09:48:43 centos7 su: pam_unix(su-l:session): session opened for user root by trainee(uid=1000)+Jun  3 09:51:47 centos8 login[1158]: FAILED LOGIN SESSION FROM tty1 FOR trainee  , Authentication failure
 </code> </code>
  
-=====Le fichier /var/log/audit/audit.log=====+====1.5 - Gestion des Evénements audit==== 
 + 
 +===Le fichier /var/log/audit/audit.log===
  
-Ce fichier contient les messages du système d'audit, appelés des **évènements**. Le système audit est installé par défaut dans RHEL/CentOS par le paquet **audit**. Le système audit collectionne des informations telles :+Ce fichier contient les messages du système d'audit, appelés des **événements**. Le système audit est installé par défaut dans RHEL/CentOS par le paquet **audit**. Le système audit collectionne des informations telles :
  
   * des appels système,   * des appels système,
Ligne 371: Ligne 379:
  
 <code> <code>
-[root@centos7 ~]# tail -n 15 /var/log/audit/audit.log +[root@centos8 ~]# tail -n 15 /var/log/audit/audit.log 
-type=CRED_ACQ msg=audit(1443519601.478:401): pid=3596 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:crond_t:s0-s0:c0.c1023 msg='op=PAM:setcred grantors=pam_env,pam_unix acct="root" exe="/usr/sbin/crond" hostname=? addr=? terminal=cron res=success' +type=PROCTITLE msg=audit(1622728321.894:455): proctitle=2F7573722F7362696E2F63726F6E64002D6E 
-type=LOGIN msg=audit(1443519601.488:402): pid=3596 uid=0 subj=system_u:system_r:crond_t:s0-s0:c0.c1023 old-auid=4294967295 auid=0 old-ses=4294967295 ses=3 res=1 +type=USER_START msg=audit(1622728321.901:456): pid=2420 uid=0 auid=1000 ses=53 subj=system_u:system_r:crond_t:s0-s0:c0.c1023 msg='op=PAM:session_open grantors=pam_loginuid,pam_keyinit,pam_limits,pam_systemd acct="trainee" exe="/usr/sbin/crond" hostname=? addr=? terminal=cron res=success'UID="root" AUID="trainee" 
-type=USER_START msg=audit(1443519601.563:403): pid=3596 uid=0 auid=ses=subj=system_u:system_r:crond_t:s0-s0:c0.c1023 msg='op=PAM:session_open grantors=pam_loginuid,pam_keyinit,pam_limits,pam_systemd acct="root" exe="/usr/sbin/crond" hostname=? addr=? terminal=cron res=success' +type=CRED_REFR msg=audit(1622728321.902:457): pid=2420 uid=0 auid=1000 ses=53 subj=system_u:system_r:crond_t:s0-s0:c0.c1023 msg='op=PAM:setcred grantors=pam_env,pam_localuser,pam_unix acct="trainee" exe="/usr/sbin/crond" hostname=? addr=? terminal=cron res=success'UID="root" AUID="trainee" 
-type=CRED_REFR msg=audit(1443519601.568:404): pid=3596 uid=0 auid=ses=subj=system_u:system_r:crond_t:s0-s0:c0.c1023 msg='op=PAM:setcred grantors=pam_env,pam_unix acct="root" exe="/usr/sbin/crond" hostname=? addr=? terminal=cron res=success' +type=CRED_DISP msg=audit(1622728321.908:458): pid=2420 uid=0 auid=1000 ses=53 subj=system_u:system_r:crond_t:s0-s0:c0.c1023 msg='op=PAM:setcred grantors=pam_env,pam_localuser,pam_unix acct="trainee" exe="/usr/sbin/crond" hostname=? addr=? terminal=cron res=success'UID="root" AUID="trainee" 
-type=CRED_DISP msg=audit(1443519601.646:405): pid=3596 uid=0 auid=ses=subj=system_u:system_r:crond_t:s0-s0:c0.c1023 msg='op=PAM:setcred grantors=pam_env,pam_unix acct="root" exe="/usr/sbin/crond" hostname=? addr=? terminal=cron res=success' +type=USER_END msg=audit(1622728321.910:459): pid=2420 uid=0 auid=1000 ses=53 subj=system_u:system_r:crond_t:s0-s0:c0.c1023 msg='op=PAM:session_close grantors=pam_loginuid,pam_keyinit,pam_limits,pam_systemd acct="trainee" exe="/usr/sbin/crond" hostname=? addr=? terminal=cron res=success'UID="root" AUID="trainee" 
-type=USER_END msg=audit(1443519601.654:406): pid=3596 uid=0 auid=ses=subj=system_u:system_r:crond_t:s0-s0:c0.c1023 msg='op=PAM:session_close grantors=pam_loginuid,pam_keyinit,pam_limits,pam_systemd acct="root" exe="/usr/sbin/crond" hostname=? addr=? terminal=cron res=success' +type=SERVICE_STOP msg=audit(1622728330.965:460): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=fprintd comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'UID="root" AUID="unset" 
-type=SERVICE_START msg=audit(1443519610.092:407): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg=' comm="systemd-tmpfiles-clean" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success' +type=USER_ACCT msg=audit(1622728381.954:461): pid=2439 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:crond_t:s0-s0:c0.c1023 msg='op=PAM:accounting grantors=pam_access,pam_unix,pam_localuser acct="trainee" exe="/usr/sbin/crond" hostname=? addr=? terminal=cron res=success'UID="root" AUID="unset" 
-type=SERVICE_STOP msg=audit(1443519610.092:408): pid=uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg=' comm="systemd-tmpfiles-clean" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=res=success' +type=CRED_ACQ msg=audit(1622728381.954:462): pid=2439 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:crond_t:s0-s0:c0.c1023 msg='op=PAM:setcred grantors=pam_env,pam_localuser,pam_unix acct="trainee" exe="/usr/sbin/crond" hostname=? addr=? terminal=cron res=success'UID="root" AUID="unset" 
-type=SERVICE_START msg=audit(1443519737.774:409): pid=uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg=' comm="fprintd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=res=success' +type=LOGIN msg=audit(1622728381.954:463): pid=2439 uid=subj=system_u:system_r:crond_t:s0-s0:c0.c1023 old-auid=4294967295 auid=1000 tty=(none) old-ses=4294967295 ses=54 res=1UID="root" OLD-AUID="unsetAUID="trainee" 
-type=USER_AUTH msg=audit(1443519740.732:410): pid=3718 uid=1000 auid=1000 ses=1 subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 msg='op=PAM:authentication grantors=pam_unix acct="root" exe="/usr/bin/suhostname=? addr=? terminal=pts/0 res=success' +type=SYSCALL msg=audit(1622728381.954:463): arch=c000003e syscall=1 success=yes exit=4 a0=7 a1=7ffdcd7a6d50 a2=4 a3=0 items=0 ppid=1126 pid=2439 auid=1000 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=54 comm="crond" exe="/usr/sbin/crond" subj=system_u:system_r:crond_t:s0-s0:c0.c1023 key=(null)ARCH=x86_64 SYSCALL=write AUID="trainee" UID="root" GID="rootEUID="root" SUID="root" FSUID="root" EGID="root" SGID="root" FSGID="root" 
-type=USER_ACCT msg=audit(1443519740.754:411): pid=3718 uid=1000 auid=1000 ses=subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 msg='op=PAM:accounting grantors=pam_unix,pam_localuser acct="root" exe="/usr/bin/suhostname=? addr=? terminal=pts/0 res=success' +type=PROCTITLE msg=audit(1622728381.954:463): proctitle=2F7573722F7362696E2F63726F6E64002D6E 
-type=CRED_ACQ msg=audit(1443519740.754:412): pid=3718 uid=1000 auid=1000 ses=subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 msg='op=PAM:setcred grantors=pam_unix acct="root" exe="/usr/bin/su" hostname=? addr=? terminal=pts/0 res=success' +type=USER_START msg=audit(1622728381.960:464): pid=2439 uid=auid=1000 ses=54 subj=system_u:system_r:crond_t:s0-s0:c0.c1023 msg='op=PAM:session_open grantors=pam_loginuid,pam_keyinit,pam_limits,pam_systemd acct="trainee" exe="/usr/sbin/crond" hostname=? addr=? terminal=cron res=success'UID="root" AUID="trainee" 
-type=USER_START msg=audit(1443519740.886:413): pid=3718 uid=1000 auid=1000 ses=subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 msg='op=PAM:session_open grantors=pam_keyinit,pam_keyinit,pam_limits,pam_systemd,pam_unix,pam_xauth acct="root" exe="/usr/bin/su" hostname=? addr=? terminal=pts/0 res=success' +type=CRED_REFR msg=audit(1622728381.962:465): pid=2439 uid=auid=1000 ses=54 subj=system_u:system_r:crond_t:s0-s0:c0.c1023 msg='op=PAM:setcred grantors=pam_env,pam_localuser,pam_unix acct="trainee" exe="/usr/sbin/crond" hostname=? addr=? terminal=cron res=success'UID="root" AUID="trainee" 
-type=SERVICE_STOP msg=audit(1443519767.698:414): pid=uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg=' comm="fprintd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=res=success' +type=CRED_DISP msg=audit(1622728381.966:466): pid=2439 uid=0 auid=1000 ses=54 subj=system_u:system_r:crond_t:s0-s0:c0.c1023 msg='op=PAM:setcred grantors=pam_env,pam_localuser,pam_unix acct="trainee" exe="/usr/sbin/crond" hostname=? addr=? terminal=cron res=success'UID="root" AUID="trainee" 
-type=SERVICE_STOP msg=audit(1443519851.018:415): pid=uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg=' comm="systemd-hostnamed" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=res=success'+type=USER_END msg=audit(1622728381.968:467): pid=2439 uid=0 auid=1000 ses=54 subj=system_u:system_r:crond_t:s0-s0:c0.c1023 msg='op=PAM:session_close grantors=pam_loginuid,pam_keyinit,pam_limits,pam_systemd acct="trainee" exe="/usr/sbin/crond" hostname=? addr=? terminal=cron res=success'UID="root" AUID="trainee"
 </code> </code>
  
-====Gestion des évènements audit==== +La gestion des événements audit se repose sur trois exécutables :
- +
-La gestion des évènements audit se repose sur trois exécutables :+
  
 ===auditd=== ===auditd===
Ligne 398: Ligne 404:
  
 <code> <code>
-[root@centos7 ~]# cat /etc/audit/auditd.conf+[root@centos8 ~]# cat /etc/audit/auditd.conf
 # #
 # This file controls the configuration of the audit daemon # This file controls the configuration of the audit daemon
 # #
  
 +local_events = yes
 +write_logs = yes
 log_file = /var/log/audit/audit.log log_file = /var/log/audit/audit.log
-log_format = RAW 
 log_group = root log_group = root
-priority_boost 4 +log_format ENRICHED 
-flush = INCREMENTAL +flush = INCREMENTAL_ASYNC 
-freq = 20+freq = 50 
 +max_log_file = 8
 num_logs = 5 num_logs = 5
-disp_qos lossy +priority_boost 4
-dispatcher = /sbin/audispd+
 name_format = NONE name_format = NONE
 ##name = mydomain ##name = mydomain
-max_log_file = 6  
 max_log_file_action = ROTATE max_log_file_action = ROTATE
 space_left = 75 space_left = 75
 space_left_action = SYSLOG space_left_action = SYSLOG
 +verify_email = yes
 action_mail_acct = root action_mail_acct = root
 admin_space_left = 50 admin_space_left = 50
Ligne 423: Ligne 430:
 disk_full_action = SUSPEND disk_full_action = SUSPEND
 disk_error_action = SUSPEND disk_error_action = SUSPEND
-##tcp_listen_port = +use_libwrap = yes 
 +##tcp_listen_port = 60
 tcp_listen_queue = 5 tcp_listen_queue = 5
 tcp_max_per_addr = 1 tcp_max_per_addr = 1
 ##tcp_client_ports = 1024-65535 ##tcp_client_ports = 1024-65535
 tcp_client_max_idle = 0 tcp_client_max_idle = 0
-enable_krb5 no+transport TCP
 krb5_principal = auditd krb5_principal = auditd
 ##krb5_key_file = /etc/audit/audit.key ##krb5_key_file = /etc/audit/audit.key
 +distribute_network = no
 +q_depth = 400
 +overflow_action = SYSLOG
 +max_restarts = 10
 +plugin_dir = /etc/audit/plugins.d
 </code> </code>
- 
-==Options de la Commande== 
  
 Les option de cette commande sont : Les option de cette commande sont :
  
 <code> <code>
-[root@centos7 ~]# auditd --help +[root@centos8 ~]# auditd --help 
-auditd: invalid option -- '-+auditd: unrecognized option '--help
-Usage: auditd [-f] [-l] [-n] [-s disable|enable|nochange]+Usage: auditd [-f] [-l] [-n] [-s disable|enable|nochange] [-c <config_file>]
 </code> </code>
  
Ligne 448: Ligne 459:
  
 <code> <code>
-[root@centos7 ~]# cat /etc/audit/audit.rules+[root@centos8 ~]# cat /etc/audit/audit.rules
 ## This file is automatically generated from /etc/audit/rules.d ## This file is automatically generated from /etc/audit/rules.d
 -D -D
--b 320+-b 8192 
 +-f 1 
 +--backlog_wait_time 60000
  
 </code> </code>
- 
-==Options de la Commande== 
  
 Les options de cette commande sont : Les options de cette commande sont :
  
 <code> <code>
-[root@centos7 ~]# auditctl --help+[root@centos8 ~]# auditctl --help
 usage: auditctl [options] usage: auditctl [options]
     -a <l,a>            Append rule to end of <l>ist with <a>ction     -a <l,a>            Append rule to end of <l>ist with <a>ction
Ligne 494: Ligne 505:
     -w <path>           Insert watch at <path>     -w <path>           Insert watch at <path>
     -W <path>           Remove watch at <path>     -W <path>           Remove watch at <path>
-    --loginuid-immutable   Make loginuids unchangeable once set +    --loginuid-immutable  Make loginuids unchangeable once set 
-    --backlog_wait_time    Set the kernel backlog_wait_time+    --backlog_wait_time  Set the kernel backlog_wait_time 
 +    --reset-lost         Reset the lost record counter
 </code> </code>
  
-===audispd===+===La consultation des événements audit===
  
-Cet exécutable est responsable de la distribution des évènements audit à des applications tierces. Le démarrage et l'arrêt de cet exécutable est contrôlé par **auditd**. Afin d'informer **audispd** de la façon dont elles veulent recevoir les informations concernant les évènements, les applications placent un fichier de configuration dans le répertoire **/etc/audisp/plugins.d** :+La consultation des événements audit se fait en utilisant les commandes **ausearch** et **aureport** :
  
-<code> +==La Commande aureport==
-[root@centos7 ~]# ls /etc/audisp/plugins.d +
-af_unix.conf  sedispatch.conf  syslog.conf +
-</code> +
- +
-Le contenu de ces fichiers suit un format précis : +
- +
-<code> +
-[root@centos7 ~]# cat /etc/audisp/plugins.d/syslog.conf +
-# This file controls the configuration of the syslog plugin. +
-# It simply takes events and writes them to syslog. The +
-# arguments provided can be the default priority that you +
-# want the events written with. And optionally, you can give +
-# a second argument indicating the facility that you want events +
-# logged to. Valid options are LOG_LOCAL0 through 7. +
- +
-active = no +
-direction = out +
-path = builtin_syslog +
-type = builtin  +
-args = LOG_INFO +
-format = string +
-</code> +
- +
-====La consultation des évènements audit==== +
- +
-La consultation des évènements audit se fait en utilisant les commandes **ausearch** et **aureport** : +
- +
-===La Commande aureport===+
  
 Cette commande est utilisée pour générer des rapports : Cette commande est utilisée pour générer des rapports :
  
 <code> <code>
-[root@centos7 ~]# aureport+[root@centos8 ~]# aureport
  
 Summary Report Summary Report
 ====================== ======================
-Range of time in logs: 03/08/2015 14:23:34.354 09/29/2015 11:44:11.018 +Range of time in logs: 05/08/2020 08:13:52.320 06/03/2021 10:20:02.028 
-Selected time for report: 03/08/2015 14:23:34 09/29/2015 11:44:11.018 +Selected time for report: 05/08/2020 08:13:52 06/03/2021 10:20:02.028 
-Number of changes in configuration: 5309 +Number of changes in configuration: 46 
-Number of changes to accounts, groups, or roles: 30 +Number of changes to accounts, groups, or roles: 56 
-Number of logins: 14 +Number of logins: 21 
-Number of failed logins: 1 +Number of failed logins: 5 
-Number of authentications: 61 +Number of authentications: 50 
-Number of failed authentications: 1+Number of failed authentications: 8
 Number of users: 3 Number of users: 3
-Number of terminals: 7 +Number of terminals: 10 
-Number of host names: 1 +Number of host names: 4 
-Number of executables: 17 +Number of executables: 22 
-Number of commands: 84 +Number of commands: 11 
-Number of files: 1 +Number of files: 0 
-Number of AVC's: 1 +Number of AVC's: 0 
-Number of MAC events: 15+Number of MAC events: 35
 Number of failed syscalls: 0 Number of failed syscalls: 0
-Number of anomaly events: 1+Number of anomaly events: 7
 Number of responses to anomaly events: 0 Number of responses to anomaly events: 0
-Number of crypto events: 28+Number of crypto events: 287
 Number of integrity events: 0 Number of integrity events: 0
 Number of virt events: 0 Number of virt events: 0
 Number of keys: 0 Number of keys: 0
-Number of process IDs: 1414 +Number of process IDs: 616 
-Number of events: 8610+Number of events: 6030
 </code> </code>
- 
-==Options de la Commande== 
  
 Les options de cette commande sont : Les options de cette commande sont :
  
 <code> <code>
-[root@centos7 ~]# aureport --help+[root@centos8 ~]# aureport --help
 usage: aureport [options] usage: aureport [options]
  -a,--avc Avc report  -a,--avc Avc report
Ligne 611: Ligne 593:
 </code> </code>
  
-===La Commande ausearch===+==La Commande ausearch==
  
-Cette commande est utilisée pour rechercher des évènements. Par exemple, pour rechercher les évènements liés à un utilisateur représenté par son UID :+Cette commande est utilisée pour rechercher des événements. Par exemple, pour rechercher les événements liés à un utilisateur représenté par son UID :
  
 <code> <code>
-[root@centos7 ~]# ausearch -ui 1000 | more+[root@centos8 ~]# ausearch -ui 1000 | more
 ---- ----
-time->Sun Mar  8 14:26:43 2015 +time->Tue Sep  1 11:05:28 2020 
-type=ANOM_ABEND msg=audit(1425821203.409:383): auid=1000 uid=1000 gid=1000 ses=1 subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 pid=11897  +type=USER_AUTH msg=audit(1598972728.209:77): pid=1633 uid=1000 auid=1000 ses=1 subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 msg='op=PAM:authentication grantors=pam_unix acct="rootexe="/usr/bin/suhostname=localhost.locald 
-comm="yelpreason="memory violationsig=6+omain addr=? terminal=pts/0 res=success'
 ---- ----
-time->Sun Mar  8 14:36:33 2015 +time->Tue Sep  1 11:05:28 2020 
-type=USER_AUTH msg=audit(1425821793.757:383): pid=3200 uid=1000 auid=1000 ses=1 subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 msg='op=PAM +type=USER_ACCT msg=audit(1598972728.214:78): pid=1633 uid=1000 auid=1000 ses=1 subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 msg='op=PAM:accounting grantors=pam_unix,pam_localuser acct="root" exe="/usr/bin/su" hostname=localh 
-:authentication acct="root" exe="/usr/bin/su" hostname=addr=? terminal=pts/0 res=success'+ost.localdomain addr=? terminal=pts/0 res=success'
 ---- ----
-time->Sun Mar  8 14:36:33 2015 +time->Tue Sep  1 11:05:28 2020 
-type=USER_ACCT msg=audit(1425821793.765:384): pid=3200 uid=1000 auid=1000 ses=1 subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 msg='op=PAM +type=CRED_ACQ msg=audit(1598972728.218:79): pid=1633 uid=1000 auid=1000 ses=1 subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 msg='op=PAM:setcred grantors=pam_unix acct="root" exe="/usr/bin/su" hostname=localhost.localdomain ad 
-:accounting acct="root" exe="/usr/bin/su" hostname=? addr=? terminal=pts/0 res=success'+dr=? terminal=pts/0 res=success'
 ---- ----
-time->Sun Mar  8 14:36:33 2015 +time->Tue Sep  1 11:05:28 2020 
-type=CRED_ACQ msg=audit(1425821793.765:385): pid=3200 uid=1000 auid=1000 ses=1 subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 msg='op=PAM: +type=USER_START msg=audit(1598972728.223:80): pid=1633 uid=1000 auid=1000 ses=1 subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 msg='op=PAM:session_open grantors=pam_keyinit,pam_keyinit,pam_limits,pam_systemd,pam_unix,pam_umask 
-setcred acct="root" exe="/usr/bin/su" hostname=addr=? terminal=pts/0 res=success'+,pam_xauth acct="root" exe="/usr/bin/su" hostname=localhost.localdomain addr=? terminal=pts/0 res=success'
 ---- ----
-time->Sun Mar  8 14:36:33 2015 +time->Tue Sep  1 11:10:13 2020 
-type=USER_START msg=audit(1425821793.920:386): pid=3200 uid=1000 auid=1000 ses=1 subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 msg='op=PA +type=USER_END msg=audit(1598973013.687:87): pid=1633 uid=1000 auid=1000 ses=1 subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 msg='op=PAM:session_close grantors=pam_keyinit,pam_keyinit,pam_limits,pam_systemd,pam_unix,pam_umask, 
-M:session_open acct="root" exe="/usr/bin/su" hostname=addr=? terminal=pts/0 res=success'+pam_xauth acct="root" exe="/usr/bin/su" hostname=localhost.localdomain addr=? terminal=pts/0 res=success'
 ---- ----
-time->Mon Jun  17:20:11 2015 +time->Tue Sep  11:10:13 2020 
-type=USER_AUTH msg=audit(1433172011.329:505): pid=466 uid=1000 auid=1000 ses=1 subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 msg='op=PAM: +type=CRED_DISP msg=audit(1598973013.687:88): pid=1633 uid=1000 auid=1000 ses=1 subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 msg='op=PAM:setcred grantors=pam_unix acct="root" exe="/usr/bin/su" hostname=localhost.localdomain a 
-authentication acct="root" exe="/usr/bin/su" hostname=? addr=? terminal=pts/0 res=success'+ddr=? terminal=pts/0 res=success'
 ---- ----
-time->Mon Jun  17:20:11 2015 +time->Mon Apr 19 11:48:01 2021 
-type=USER_ACCT msg=audit(1433172011.330:506): pid=466 uid=1000 auid=1000 ses=1 subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 msg='op=PAM: +type=USER_AUTH msg=audit(1618847281.847:77): pid=1768 uid=1000 auid=1000 ses=subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 msg='op=PAM:authentication grantors=pam_unix acct="root" exe="/usr/bin/su" hostname=centos8.ittraini 
-accounting acct="root" exe="/usr/bin/su" hostname=? addr=? terminal=pts/0 res=success'+ng.loc addr=? terminal=pts/0 res=success' 
 +---- 
 +time->Mon Apr 19 11:48:01 2021 
 +type=USER_ACCT msg=audit(1618847281.847:78): pid=1768 uid=1000 auid=1000 ses=1 subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 msg='op=PAM:accounting grantors=pam_unix,pam_localuser acct="root" exe="/usr/bin/su" hostname=centos 
 +8.ittraining.loc addr=? terminal=pts/0 res=success' 
 +---- 
 +time->Mon Apr 19 11:48:01 2021 
 +type=CRED_ACQ msg=audit(1618847281.847:79): pid=1768 uid=1000 auid=1000 ses=1 subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 msg='op=PAM:setcred grantors=pam_unix acct="root" exe="/usr/bin/su" hostname=centos8.ittraining.loc a 
 +ddr=? terminal=pts/0 res=success' 
 +---- 
 +time->Mon Apr 19 11:48:01 2021 
 +type=USER_START msg=audit(1618847281.883:80): pid=1768 uid=1000 auid=1000 ses=1 subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 msg='op=PAM:session_open grantors=pam_keyinit,pam_keyinit,pam_limits,pam_systemd,pam_unix,pam_umask 
 +,pam_xauth acct="root" exe="/usr/bin/su" hostname=centos8.ittraining.loc addr=? terminal=pts/0 res=success' 
 +---- 
 +time->Mon Apr 19 12:04:39 2021 
 +type=USER_END msg=audit(1618848279.544:541): pid=1768 uid=1000 auid=1000 ses=1 subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 msg='op=PAM:session_close grantors=pam_keyinit,pam_keyinit,pam_limits,pam_systemd,pam_unix,pam_umask 
 +,pam_xauth acct="root" exe="/usr/bin/su" hostname=centos8.ittraining.loc addr=? terminal=pts/0 res=success' 
 +---- 
 +time->Mon Apr 19 12:04:39 2021 
 +type=CRED_DISP msg=audit(1618848279.544:542): pid=1768 uid=1000 auid=1000 ses=1 subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 msg='op=PAM:setcred grantors=pam_unix acct="root" exe="/usr/bin/su" hostname=centos8.ittraining.loc 
 + addr=? terminal=pts/0 res=success' 
 +---- 
 +time->Mon Apr 19 12:05:57 2021 
 +type=USER_AUTH msg=audit(1618848357.204:69): pid=4892 uid=1000 auid=1000 ses=1 subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 msg='op=PAM:authentication grantors=? acct="root" exe="/usr/bin/su" hostname=centos8.ittraining.loc  
 +addr=? terminal=pts/0 res=failed' 
 +---- 
 +time->Mon Apr 19 12:06:03 2021 
 +type=USER_AUTH msg=audit(1618848363.134:70): pid=4901 uid=1000 auid=1000 ses=1 subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 msg='op=PAM:authentication grantors=pam_unix acct="root" exe="/usr/bin/su" hostname=centos8.ittraini 
 +ng.loc addr=? terminal=pts/0 res=success'
 ---- ----
 --More-- --More--
 </code>  </code> 
- 
-==Options de la Commande== 
  
 Les options de cette commande sont : Les options de cette commande sont :
  
 <code> <code>
-[root@centos7 ~]# ausearch --help+[root@centos8 ~]# ausearch --help
 usage: ausearch [options] usage: ausearch [options]
  -a,--event <Audit event id> search based on audit event id  -a,--event <Audit event id> search based on audit event id
Ligne 663: Ligne 671:
  -e,--exit  <Exit code or errno> search based on syscall exit code  -e,--exit  <Exit code or errno> search based on syscall exit code
  -f,--file  <File name> search based on file name  -f,--file  <File name> search based on file name
 + --format [raw|default|interpret|csv|text] results format options
  -ga,--gid-all <all Group id> search based on All group ids  -ga,--gid-all <all Group id> search based on All group ids
  -ge,--gid-effective <effective Group id>  search based on Effective  -ge,--gid-effective <effective Group id>  search based on Effective
Ligne 705: Ligne 714:
 </code> </code>
  
-<WRAP center round important>+<WRAP center round important 60%>
 **Important** : Pour plus d'information concernant le système audit, consultez les manuels de **auditd**, **auditctl**, **audispd**, **aureport** et **ausearch**. **Important** : Pour plus d'information concernant le système audit, consultez les manuels de **auditd**, **auditctl**, **audispd**, **aureport** et **ausearch**.
 </WRAP> </WRAP>
Ligne 714: Ligne 723:
  
 <code> <code>
-[root@centos7 ~]# tail -n 15 /var/log/messages +[root@centos8 ~]# tail -n 15 /var/log/messages 
-Sep 29 11:40:01 centos7 systemd: Created slice user-0.slice+Jun  3 10:15:01 centos8 systemd[1]session-76.scope: Succeeded
-Sep 29 11:40:01 centos7 systemd: Starting Session of user root+Jun  3 10:16:01 centos8 systemd[1]Started Session 77 of user trainee
-Sep 29 11:40:01 centos7 systemd: Started Session of user root+Jun  3 10:16:01 centos8 systemd[1]: session-77.scope: Succeeded. 
-Sep 29 11:40:09 centos7 systemd: Starting Cleanup of Temporary Directories... +Jun  3 10:17:01 centos8 systemd[1]: Started Session 78 of user trainee
-Sep 29 11:40:10 centos7 systemd: Started Cleanup of Temporary Directories+Jun  3 10:17:01 centos8 systemd[1]session-78.scope: Succeeded
-Sep 29 11:42:17 centos7 dbus-daemondbus[526]: [system] Activating via systemdservice name='net.reactivated.Fprint' unit='fprintd.service' +Jun  3 10:18:01 centos8 systemd[1]: Started Session 79 of user trainee
-Sep 29 11:42:17 centos7 dbus[526]: [system] Activating via systemd: service name='net.reactivated.Fprint' unit='fprintd.service' +Jun  3 10:18:01 centos8 systemd[1]: session-79.scopeSucceeded
-Sep 29 11:42:17 centos7 systemd: Starting Fingerprint Authentication Daemon... +Jun  3 10:19:01 centos8 systemd[1]: Started Session 80 of user trainee
-Sep 29 11:42:17 centos7 dbus-daemon: dbus[526]: [system] Successfully activated service 'net.reactivated.Fprint' +Jun  3 10:19:01 centos8 systemd[1]session-80.scope: Succeeded
-Sep 29 11:42:17 centos7 dbus[526]: [system] Successfully activated service 'net.reactivated.Fprint' +Jun  3 10:20:02 centos8 systemd[1]: Started Session 81 of user trainee
-Sep 29 11:42:17 centos7 systemd: Started Fingerprint Authentication Daemon+Jun  3 10:20:02 centos8 systemd[1]: session-81.scope: Succeeded
-Sep 29 11:42:17 centos7 fprintd: Launching FprintObject +Jun  3 10:21:01 centos8 systemd[1]: Started Session 82 of user trainee
-Sep 29 11:42:17 centos7 fprintd** Message: D-Bus service launched with namenet.reactivated.Fprint +Jun  3 10:21:01 centos8 systemd[1]session-82.scopeSucceeded
-Sep 29 11:42:17 centos7 fprintd** Message: entering main loop +Jun  3 10:22:01 centos8 systemd[1]Started Session 83 of user trainee. 
-Sep 29 11:42:20 centos7 su(to root) trainee on pts/0+Jun  3 10:22:01 centos8 systemd[1]session-83.scope: Succeeded.
 </code> </code>
  
Ligne 742: Ligne 751:
  
 <code> <code>
-[root@centos7 ~]# ls -l /var/log +[root@centos8 ~]# ls -l /var/log 
-total 1332 +total 2448 
-drwxr-xr-x. 2 root   root     4096 Mar  8  2015 anaconda +drwxr-xr-x. 2 root   root      280 May  8  2020 anaconda 
-drwxr-x---. 2 root   root       22 Mar  5  2015 audit +drwx------. 2 root   root       23 Apr 23  2020 audit 
--rw-r--r--. 1 root   root    12098 Sep 29 11:25 boot.log +-rw-------. 1 root   root        0 Jun  3 10:16 boot.log 
--rw-------. 1 root   utmp        0 Jun  4 09:54 btmp +-rw-------. 1 root   root    19710 Apr 19 13:44 boot.log-20210419 
-drwxr-xr-x. 2 chrony chrony      6 Jun 18  2014 chrony +-rw-------. 1 root   root     9548 May 26 09:35 boot.log-20210526 
--rw-r--r--. 1 root   root     2094 Sep 29 11:50 cron +-rw-------. 1 root   root     9491 Jun  2 07:40 boot.log-20210602 
--rw-r--r--. 1 root   root     1828 Jun 10 11:38 cron-20150610.gz +-rw-------. 1 root   root    38555 Jun  3 10:16 boot.log-20210603 
--rw-r--r--. 1 root   root    10593 Sep 28 15:41 cron-20150928 +-rw-rw----. 1 root   utmp     1152 Jun  3 09:51 btmp 
-drwxr-xr-x. 2 lp     sys      4096 Sep 28 15:41 cups +-rw-rw----. 1 root   utmp      384 May 26 10:37 btmp-20210602 
--rw-r--r--. 1 root   root    33323 Sep 29 11:25 dmesg +drwxr-xr-x. 2 chrony chrony      Nov 19  2019 chrony 
--rw-r--r--. 1 root   root    33322 Sep 28 14:46 dmesg.old +-rw-------. 1 root   root    35397 Jun  10:22 cron 
-drwx--x--x. 2 root   gdm        79 Sep 29 11:25 gdm +-rw-------. 1 root   root     5652 Apr 19 13:01 cron-20210419 
-drwxr-xr-x. 2 root   root        Mar  6  2015 glusterfs +-rw-------. root   root    16279 May 26 09:01 cron-20210526 
--rw-------. 1 root   root     1340 Jun  10:00 grubby +-rw-------. 1 root   root     5117 Jun  2 07:01 cron-20210602 
--rw-r--r--. 1 root   root   292292 Sep 29 11:42 lastlog +-rw-------. 1 root   root    13577 Jun  10:12 dnf.librepo.log 
-drwx------. root   root       17 Jun  4 10:11 libvirt +-rw-r--r--. 1 root   root    43871 Apr 19 13:15 dnf.librepo.log-20210419 
--rw-------. 1 root   root      194 Sep 29 11:25 maillog +-rw-------. 1 root   root    89109 May 26 08:54 dnf.librepo.log-20210526 
--rw-------. 1 root   root      815 Jun 10 10:06 maillog-20150610.gz +-rw-------. 1 root   root    17737 Jun  2 07:18 dnf.librepo.log-20210602 
--rw-------. 1 root   root      582 Sep 28 14:46 maillog-20150928 +-rw-r--r--. 1 root   root   749350 Jun  3 10:12 dnf.log 
--rw-------. 1 root   root    98378 Sep 29 11:50 messages +-rw-r--r--. 1 root   root   138497 Jun  3 10:12 dnf.rpm.log 
--rw-------. 1 root   root   252331 Jun 10 11:30 messages-20150610.gz +-rw-r-----. root   root     3808 Jun  3 09:01 firewalld 
--rw-------. 1 root   root   274071 Sep 28 15:40 messages-20150928 +drwxr-xr-x. 2 root   root        6 Nov   2020 glusterfs 
-drwxr-xr-x3 root   root       17 Mar  8  2015 pluto +-rw-------. root   root      510 Jun  3 09:58 hawkey.log 
--rw-r--r--. 1 root   root        0 Sep 29 11:26 pm-powersave.log +-rw-r--r--. root   root      561 Apr 19 12:13 hawkey.log-20210419 
-drwx------. root   root        Jun 10  2014 ppp +-rw-------. 1 root   root     3927 May 26 08:54 hawkey.log-20210526 
-drwxr-xr-x. 2 root   root        6 Mar   2015 qemu-ga +-rw-------. 1 root   root      306 Jun  2 06:17 hawkey.log-20210602 
-drwxr-xr-xroot   root     4096 Sep 29 11:25 sa +-rw-rw-r--. 1 root   utmp   293168 Jun  3 09:01 lastlog 
-drwx------. root   root       16 May 12 22:19 samba +drwx------. root   root       18 Apr 19 12:07 libvirt 
--rw-------. 1 root   root     1597 Sep 29 11:42 secure +-rw-------. root   root        Jun  2 07:40 maillog 
--rw-------. 1 root   root     2698 Jun 10 10:07 secure-20150610.gz +-rw-------. 1 root   root        0 May  8  2020 maillog-20210419 
--rw-------. root   root     5500 Sep 28 14:48 secure-20150928 +-rw-------. 1 root   root        0 Apr 19 13:44 maillog-20210526 
-drwx------. root   root        Jun 10  2014 speech-dispatcher +-rw-------. root   root        0 May 26 09:35 maillog-20210602 
--rw-------. 1 root   root        0 Mar  8  2015 spooler +-rw-------. 1 root   root   452404 Jun  3 10:22 messages 
--rw-------. 1 root   root        0 Mar  8  2015 tallylog +-rw-------. 1 root   root   397916 Apr 19 13:15 messages-20210419 
-drwxr-xr-xroot   root       22 Mar  6  2015 tuned +-rw-------. 1 root   root   173289 May 26 09:19 messages-20210526 
--rw-r--r--. 1 root   root   209481 Jun  4 15:33 vboxadd-install.log +-rw-------. 1 root   root   123100 Jun  2 07:38 messages-20210602 
--rw-r--r--. 1 root   root       73 Jun  4 15:33 vboxadd-install-x11.log +drwx------2 root   root        6 May  8  2020 private 
--rw-r--r--. 1 root   root      148 Jun  4 15:33 VBoxGuestAdditions.log +drwx------. 3 root   root       17 Aug 17  2020 samba 
--rw-r--r--. 1 root   root      210 Jun  4 15:31 VBoxGuestAdditions-uninstall.log +-rw-------. 1 root   root     6554 Jun  3 09:51 secure 
--rw-rw-r--. 1 root   utmp    50304 Sep 29 11:42 wtmp +-rw-------. 1 root   root    10835 Apr 19 12:07 secure-20210419 
--rw-r--r--. 1 root   root    20240 Sep 29 11:25 Xorg.0.log +-rw-------. 1 root   root    11884 May 26 08:49 secure-20210526 
--rw-r--r--. 1 root   root    20240 Sep 28 14:46 Xorg.0.log.old +-rw-------. 1 root   root     3633 Jun  2 06:40 secure-20210602 
--rw-r--r--. 1 root   root    18540 Jun  4 14:59 Xorg.9.log +-rw-------. 1 root   root        Jun  2 07:40 spooler 
--rw-r--r--. 1 root   root    56231 Mar  8  2015 Xorg.9.log.old +-rw-------. 1 root   root        0 May  8  2020 spooler-20210419 
--rw-------. 1 root   root    31581 Sep 28 14:52 yum.log+-rw-------1 root   root        0 Apr 19 13:44 spooler-20210526 
 +-rw-------. 1 root   root        0 May 26 09:35 spooler-20210602 
 +drwxr-x---2 sssd   sssd      270 Jun  3 10:16 sssd 
 +drwxr-xr-x. 3 root   root       21 Apr 19 12:07 swtpm 
 +drwxr-xr-x. 2 root   root       23 Jan  4 11:24 tuned 
 +-rw-rw-r--. 1 root   utmp    34176 Jun  3 09:51 wtmp
 </code> </code>
  
-=====rsyslog=====+=====LAB #2 - rsyslog=====
  
 **rsyslog**, le successeur de syslog, centralise les journaux du système grâce au daemon **rsyslog**.  **rsyslog**, le successeur de syslog, centralise les journaux du système grâce au daemon **rsyslog**. 
Ligne 815: Ligne 829:
  
 <code> <code>
-[root@centos7 ~]# cat /etc/sysconfig/rsyslog+[root@centos8 ~]# cat /etc/sysconfig/rsyslog
 # Options for rsyslogd # Options for rsyslogd
 # Syslogd options are deprecated since rsyslog v3. # Syslogd options are deprecated since rsyslog v3.
Ligne 830: Ligne 844:
 | SYSLOGD_OPTIONS="-c 0" | syslogd | | SYSLOGD_OPTIONS="-c 0" | syslogd |
  
-<WRAP center round important> +====2.1 - Priorités====
-**Important** : Notez que l'emplacement du fichier **rsyslog** n'est pas le même. +
-</WRAP> +
- +
-====Priorités====+
  
 La **Priorité** permet d'indiquer à rsyslog l'importance des informations : La **Priorité** permet d'indiquer à rsyslog l'importance des informations :
Ligne 848: Ligne 858:
 | 7 | debug | Condition normale - message de débogage |  | 7 | debug | Condition normale - message de débogage | 
  
-====Sous-systèmes applicatifs====+====2.2 - Sous-systèmes applicatifs====
  
 Le **Sous-système applicatif**, aussi appelé **facility**, permet d'indiquer à rsyslog le type de programme qui envoie les informations : Le **Sous-système applicatif**, aussi appelé **facility**, permet d'indiquer à rsyslog le type de programme qui envoie les informations :
Ligne 866: Ligne 876:
  
  
-====/etc/rsyslog.conf====+====2.3 - /etc/rsyslog.conf====
  
 rsyslog est configuré par le fichier **/etc/rsyslog.conf** : rsyslog est configuré par le fichier **/etc/rsyslog.conf** :
  
 <code> <code>
-[root@centos7 ~]# cat /etc/rsyslog.conf+[root@centos8 ~]# cat /etc/rsyslog.conf
 # rsyslog configuration file # rsyslog configuration file
  
 # For more information see /usr/share/doc/rsyslog-*/rsyslog_conf.html # For more information see /usr/share/doc/rsyslog-*/rsyslog_conf.html
 +# or latest version online at http://www.rsyslog.com/doc/rsyslog_conf.html 
 # If you experience problems, see http://www.rsyslog.com/doc/troubleshoot.html # If you experience problems, see http://www.rsyslog.com/doc/troubleshoot.html
  
 #### MODULES #### #### MODULES ####
  
-# The imjournal module bellow is now used as a message source instead of imuxsock. +module(load="imuxsock"   # provides support for local system logging (e.g. via logger command) 
-$ModLoad imuxsock # provides support for local system logging (e.g. via logger command) +       SysSock.Use="off") # Turn off message reception via local log socket;  
-$ModLoad imjournal # provides access to the systemd journal +   # local messages are retrieved through imjournal now. 
-#$ModLoad imklog # reads kernel messages (the same are read from journald) +module(load="imjournal"     # provides access to the systemd journal 
-#$ModLoad immark  # provides --MARK-- message capability+       StateFile="imjournal.state"File to store the position in the journal 
 +#module(load="imklog"# reads kernel messages (the same are read from journald) 
 +#module(load="immark"# provides --MARK-- message capability
  
 # Provides UDP syslog reception # Provides UDP syslog reception
-#$ModLoad imudp +for parameters see http://www.rsyslog.com/doc/imudp.html 
-#$UDPServerRun 514+#module(load="imudp") # needs to be done just once 
 +#input(type="imudp" port="514")
  
 # Provides TCP syslog reception # Provides TCP syslog reception
-#$ModLoad imtcp +for parameters see http://www.rsyslog.com/doc/imtcp.html 
-#$InputTCPServerRun 514 +#module(load="imtcp") # needs to be done just once 
 +#input(type="imtcp" port="514")
  
 #### GLOBAL DIRECTIVES #### #### GLOBAL DIRECTIVES ####
  
 # Where to place auxiliary files # Where to place auxiliary files
-$WorkDirectory /var/lib/rsyslog+global(workDirectory="/var/lib/rsyslog")
  
 # Use default timestamp format # Use default timestamp format
-$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat +module(load="builtin:omfile" Template="RSYSLOG_TraditionalFileFormat")
- +
-# File syncing capability is disabled by default. This feature is usually not required, +
-# not useful and an extreme performance hit +
-#$ActionFileEnableSync on+
  
 # Include all config files in /etc/rsyslog.d/ # Include all config files in /etc/rsyslog.d/
-$IncludeConfig /etc/rsyslog.d/*.conf +include(file="/etc/rsyslog.d/*.conf" mode="optional")
- +
-# Turn off message reception via local log socket; +
-# local messages are retrieved through imjournal now. +
-$OmitLocalLogging on +
- +
-# File to store the position in the journal +
-$IMJournalStateFile imjournal.state +
  
 #### RULES #### #### RULES ####
Ligne 947: Ligne 949:
  
  
-# ### begin forwarding rule ### +# ### sample forwarding rule ### 
-The statement between the begin ... end define a SINGLE forwarding +#action(type="omfwd"  
-# rule. They belong together, do NOT split them. If you create multiple +
-# forwarding rules, duplicate the whole block! +
-# Remote Logging (we use TCP for reliable delivery) +
-#+
 # An on-disk queue is created for this action. If the remote host is # An on-disk queue is created for this action. If the remote host is
 # down, messages are spooled to disk and sent when it is up again. # down, messages are spooled to disk and sent when it is up again.
-#$ActionQueueFileName fwdRule1 # unique name prefix for spool files +#queue.filename="fwdRule1      # unique name prefix for spool files 
-#$ActionQueueMaxDiskSpace 1g   # 1gb space limit (use as much as possible) +#queue.maxdiskspace="1g        # 1gb space limit (use as much as possible) 
-#$ActionQueueSaveOnShutdown on # save messages to disk on shutdown +#queue.saveonshutdown="on      # save messages to disk on shutdown 
-#$ActionQueueType LinkedList   # run asynchronously +#queue.type="LinkedList        # run asynchronously 
-#$ActionResumeRetryCount -1    # infinite retries if host is down +#action.resumeRetryCount="-1   # infinite retries if host is down 
-remote host is: name/ip:port, e.g. 192.168.0.1:514, port optional +Remote Logging (we use TCP for reliable delivery) 
-#*.* @@remote-host:514 +# remote_host is: name/ip, e.g. 192.168.0.1, port optional e.g. 10514 
-### end of the forwarding rule ###+#Target="remote_host" Port="XXX" Protocol="tcp")
 </code> </code>
  
Ligne 972: Ligne 970:
     * Section traitant les options de comportement global du service rsyslog,     * Section traitant les options de comportement global du service rsyslog,
   * **Règles** (//Rules//),   * **Règles** (//Rules//),
-    * Section traitant les règles de configuration des journaux. Les règles au format syslogd gardent le même format. Les nouvelles règles, compatibles seulement avec rsyslog commencent par **$**.+    * Section traitant les règles de configuration des journaux. Les règles au format syslogd gardent le même format. Les nouvelles règles, compatibles seulement avec rsyslog commencent par **module**.
  
 ===Modules=== ===Modules===
Ligne 979: Ligne 977:
  
 ^ Module ^ Fonction ^ ^ Module ^ Fonction ^
-$ModLoad imuxsock.so | Active la trace des messages locaux, per exemple de la commande **logger** | +module(load="imuxsock" SysSock.Use="off"| Active la trace des messages locaux, per exemple de la commande **logger** | 
-$ModLoad imklog.so | Active la trace de messages du **noyau** | +module(load="imjournal" StateFile="imjournal.state") | Fournit un accès au journal **systemd** | 
-$ModLoad immark.so | Active la trace des messages de type **mark** | +| module(load="imklog"| Active la trace de messages du **noyau** | 
-$ModLoad imudp.so | Active la réception de messages en utilisant le protocole **UDP** | +module(load="immark"| Active la trace des messages de type **mark** | 
-$ModLoad imtcp.so | Active la réception de messages en utilisant le protocole **TCP** |+module(load="imudp"| Active la réception de messages en utilisant le protocole **UDP** | 
 +module(load="imtcp"| Active la réception de messages en utilisant le protocole **TCP** |
  
-Dans le fichier **/etc/rsyslog.conf** nous pouvons constater que les inputs **$ModLoad imuxsock.so** et **$ModLoad imklog.so** sont activés :+Dans le fichier **/etc/rsyslog.conf** nous pouvons constater que les inputs **module(load="imuxsock" SysSock.Use="off")** et **module(load="imjournal" StateFile="imjournal.state")** sont activés :
  
 <file> <file>
 ... ...
-  * **#### MODULES ####+#### MODULES ####
  
-$ModLoad imuxsock.so # provides support for local system logging (e.g. via logger command) +module(load="imuxsock"   # provides support for local system logging (e.g. via logger command) 
-$ModLoad imklog.so # provides kernel logging support (previously done by rklogd+       SysSock.Use="off") # Turn off message reception via local log socket;  
-#$ModLoad immark.so # provides --MARK-- message capability+   # local messages are retrieved through imjournal now. 
 +module(load="imjournal"     # provides access to the systemd journal 
 +       StateFile="imjournal.state") # File to store the position in the journal 
 +#module(load="imklog") # reads kernel messages (the same are read from journald
 +#module(load="immark"# provides --MARK-- message capability
  
 # Provides UDP syslog reception # Provides UDP syslog reception
-#$ModLoad imudp.so +for parameters see http://www.rsyslog.com/doc/imudp.html 
-#$UDPServerRun 514+#module(load="imudp") # needs to be done just once 
 +#input(type="imudp" port="514")
  
 # Provides TCP syslog reception # Provides TCP syslog reception
-#$ModLoad imtcp.so   +for parameters see http://www.rsyslog.com/doc/imtcp.html 
-#$InputTCPServerRun 514+#module(load="imtcp") # needs to be done just once 
 +#input(type="imtcp" port="514")
 ... ...
 </file> </file>
Ligne 1009: Ligne 1014:
 <file> <file>
 ... ...
-  * **#### MODULES #### 
- 
-$ModLoad imuxsock.so # provides support for local system logging (e.g. via logger command) 
-$ModLoad imklog.so # provides kernel logging support (previously done by rklogd) 
-#$ModLoad immark.so # provides --MARK-- message capability 
- 
 # Provides UDP syslog reception # Provides UDP syslog reception
-$ModLoad imudp.so +# for parameters see http://www.rsyslog.com/doc/imudp.html 
-$UDPServerRun 514+module(load="imudp") # needs to be done just once 
 +input(type="imudp" port="514")
  
 # Provides TCP syslog reception # Provides TCP syslog reception
-$ModLoad imtcp.so   +# for parameters see http://www.rsyslog.com/doc/imtcp.html 
-$InputTCPServerRun 514+module(load="imtcp") # needs to be done just once 
 +input(type="imtcp" port="514")
 ... ...
 </file> </file>
  
-<WRAP center round important> +<WRAP center round important 60%
-**Important** : Les deux directives **$ModLoad imudp.so** et **$UDPServerRun 514** crée un ** Écouteur** sur le port UDP/514 tandis que les deux directives **$ModLoad imtcp.so** et **$InputTCPServerRun 514** crée un Écouteur sur le port TCP/514. Le port 514 est le port standard pour les Écouteurs de rsyslog. Cependant il est possible de modifier le port utilisé en modifiant la valeur dans la directive **$UDPServerRun** ou **$InputTCPServerRun**. Par exemple : **$InputTCPServerRun 1514**.+**Important** : Les deux directives **module(load="imudp")** et **input(type="imudp" port="514")** crée un ** Écouteur** sur le port UDP/514 tandis que les deux directives **module(load="imtcp")** et **input(type="imtcp" port="514")** crée un Écouteur sur le port TCP/514. Le port 514 est le port standard pour les Écouteurs de rsyslog. Cependant il est possible de modifier le numéro du port.
 </WRAP> </WRAP>
  
-Pour envoyer l'ensemble des traces de journalisation vers un serveur rsyslog distant, il convient de décommenter ou d'ajouter les lignes dans la section suivante du fichier **/etc/rsyslog.conf** :+Pour envoyer l'ensemble des traces de journalisation vers un serveur rsyslog distant, il convient de décommenter et modifier une ligne dans la section suivante du fichier **/etc/rsyslog.conf** :
  
 <file> <file>
 ... ...
-# ### begin forwarding rule ### +# ### sample forwarding rule ### 
-The statement between the begin ... end define a SINGLE forwarding +#action(type="omfwd"  
-# rule. They belong together, do NOT split them. If you create multiple +
-# forwarding rules, duplicate the whole block! +
-# Remote Logging (we use TCP for reliable delivery) +
-#+
 # An on-disk queue is created for this action. If the remote host is # An on-disk queue is created for this action. If the remote host is
 # down, messages are spooled to disk and sent when it is up again. # down, messages are spooled to disk and sent when it is up again.
-$WorkDirectory /var/spppl/rsyslog where to place spool files +#queue.filename="fwdRule1      # unique name prefix for spool files 
-$ActionQueueFileName fwdRule1 # unique name prefix for spool files +#queue.maxdiskspace="1g        # 1gb space limit (use as much as possible) 
-$ActionQueueMaxDiskSpace 1g   # 1gb space limit (use as much as possible) +#queue.saveonshutdown="on      # save messages to disk on shutdown 
-$ActionQueueSaveOnShutdown on # save messages to disk on shutdown +#queue.type="LinkedList        # run asynchronously 
-$ActionQueueType LinkedList   # run asynchronously +#action.resumeRetryCount="-1   # infinite retries if host is down 
-$ActionResumeRetryCount -1    # infinite retries if host is down +Remote Logging (we use TCP for reliable delivery) 
-remote host is: name/ip:port, e.g. 192.168.0.1:514, port optional +# remote_host is: name/ip, e.g. 192.168.0.1, port optional e.g. 10514 
-*.* @@remote-host:514 +Target="remote_host" Port="514" Protocol="tcp")
-# ### end of the forwarding rule ###+
 ... ...
 </file> </file>
  
-<WRAP center round important> +<WRAP center round important 60%
-**Important** : Ces directives utilisent le protocole TCP. Le serveur distant doit donc être configuré pour ce mode de communication.La directive ***.* @@remote-host:514** doit être modifiée pour indiquer l'adresse IP du serveur rsyslog distant.+**Important** : Ces directives utilisent le protocole TCP. Le serveur distant doit donc être configuré pour ce mode de communication. La directive **Target="remote_host" Port="514" Protocol="tcp")** doit être modifiée pour indiquer l'adresse IP du serveur rsyslog distant.
 </WRAP> </WRAP>
- 
  
 ===Directives Globales=== ===Directives Globales===
Ligne 1063: Ligne 1058:
  
 <file> <file>
-$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat+module(load="builtin:omfile" Template="RSYSLOG_TraditionalFileFormat")
 </file> </file>
  
Ligne 1103: Ligne 1098:
  
  
-<WRAP center round important>+<WRAP center round important 60%>
 **Important** : Une Action précédée par le signe **-** est entreprise d'une manière **asynchrone**. Dans le cas ou l'action est entreprise d'une manière **synchrone**, la pertinence des journaux est garantie mais au prix d'un ralentissement du système. **Important** : Une Action précédée par le signe **-** est entreprise d'une manière **asynchrone**. Dans le cas ou l'action est entreprise d'une manière **synchrone**, la pertinence des journaux est garantie mais au prix d'un ralentissement du système.
 </WRAP> </WRAP>
  
- +=====LAB #3 - La Commande logger=====
-=====La Commande logger=====+
  
 La commande **/usr/bin/logger** permet d'intégrer des informations dans rsyslog. Ceci peut s'avérer utile dans des scripts bash. La commande **/usr/bin/logger** permet d'intégrer des informations dans rsyslog. Ceci peut s'avérer utile dans des scripts bash.
Ligne 1121: Ligne 1115:
  
 <code> <code>
-[root@centos7 ~]# logger -p user.info Linux est super+[root@centos8 ~]# logger -p user.info Linux est super
 </code> </code>
  
Ligne 1127: Ligne 1121:
  
 <code> <code>
-[root@centos7 ~]# tail /var/log/messages +[root@centos8 ~]# tail /var/log/messages 
-Sep 29 11:42:17 centos7 fprintd** Messageentering main loop +Jun  3 12:55:01 centos8 systemd[1]session-237.scopeSucceeded. 
-Sep 29 11:42:20 centos7 su(to root) trainee on pts/0 +Jun  3 12:56:01 centos8 systemd[1]Started Session 238 of user trainee. 
-Sep 29 11:42:47 centos7 fprintd** MessageNo devices in use, exit +Jun  3 12:56:01 centos8 systemd[1]session-238.scopeSucceeded. 
-Sep 29 11:49:39 centos7 pulseaudio[2833]: [alsa-sink] alsa-sink.c: ALSA woke us up to write new data to the device, but there was actually nothing to write! +Jun  3 12:57:01 centos8 systemd[1]: Started Session 239 of user trainee
-Sep 29 11:49:39 centos7 pulseaudio[2833]: [alsa-sink] alsa-sink.cMost likely this is a bug in the ALSA driver 'snd_intel8x0'. Please report this issue to the ALSA developers+Jun  3 12:57:01 centos8 systemd[1]: session-239.scopeSucceeded
-Sep 29 11:49:39 centos7 pulseaudio[2833]: [alsa-sink] alsa-sink.c: We were woken up with POLLOUT set -- however a subsequent snd_pcm_avail() returned 0 or another value < min_avail+Jun  3 12:58:01 centos8 systemd[1]: Started Session 240 of user trainee
-Sep 29 11:50:01 centos7 systemd: Created slice user-0.slice+Jun  3 12:58:01 centos8 systemd[1]session-240.scope: Succeeded
-Sep 29 11:50:01 centos7 systemdStarting Session 4 of user root. +Jun  3 12:58:55 centos8 trainee[5139]Linux est super 
-Sep 29 11:50:01 centos7 systemd: Started Session of user root+Jun  3 12:59:01 centos8 systemd[1]: Started Session 241 of user trainee
-Sep 29 11:55:57 centos7 traineeLinux est super+Jun  3 12:59:01 centos8 systemd[1]session-241.scope: Succeeded.
 </code> </code>
- 
-====Options de la commande==== 
  
 Les options de la commande logger sont : Les options de la commande logger sont :
  
 <code> <code>
-[root@centos7 ~]# logger --help+[root@centos8 ~]# logger --help
  
 Usage: Usage:
- logger [options] [message]+ logger [options] [<message>] 
 + 
 +Enter messages into the system log.
  
 Options: Options:
- -T, --tcp             use TCP only + -i                       log the logger command's PID 
- -d, --udp             use UDP only +     --id[=<id>         log the given <id>, or otherwise the PID 
- -i, --id              log the process ID too + -f, --file <file>        log the contents of this file 
- -f, --file <file>     log the contents of this file + -e, --skip-empty         do not log empty lines when processing files 
- -h, --help            display this help text and exit +     --no-act             do everything except the write the log 
- -n, --server <name>   write to this remote syslog server + -p, --priority <prio>    mark given message with this priority 
- -P, --port <number>   use this UDP port +     --octet-count        use rfc6587 octet counting 
- -p, --priority <prio> mark given message with this priority +     --prio-prefix        look for a prefix on every line read from stdin 
- -s, --stderr          output message to standard error as well + -s, --stderr             output message to standard error as well 
- -t, --tag <tag>       mark every line with this tag + -S, --size <size>        maximum size for a single message 
- -u, --socket <socket> write to this Unix socket + -t, --tag <tag>          mark every line with this tag 
- -V, --version         output version information and exit+ -n, --server <name>      write to this remote syslog server 
 + -P, --port <port>        use this port for UDP or TCP connection 
 + -T, --tcp                use TCP only 
 + -d, --udp                use UDP only 
 +     --rfc3164            use the obsolete BSD syslog protocol 
 +     --rfc5424[=<snip>  use the syslog protocol (the default for remote); 
 +                            <snip> can be notime, or notq, and/or nohost 
 +     --sd-id <id>         rfc5424 structured data ID 
 +     --sd-param <data>    rfc5424 structured data name=value 
 +     --msgid <msgid>      set rfc5424 message id field 
 + -u, --socket <socket>    write to this Unix socket 
 +     --socket-errors[=<on|off|auto>
 +                          print connection errors when using Unix sockets 
 +     --journald[=<file> write journald entry 
 + 
 + -h, --help               display this help 
 + -V, --version            display version 
 + 
 +For more details see logger(1).
 </code> </code>
  
-=====La Commande logrotate=====+=====LAB #4 - La Commande logrotate=====
  
 Les fichiers journaux grossissent régulièrement. Le programme **/usr/sbin/logrotate** est utilisé pour effectuer des rotations de ces fichiers selon la configuration contenue dans le fichier **/etc/logrotate.conf**. Les fichiers journaux grossissent régulièrement. Le programme **/usr/sbin/logrotate** est utilisé pour effectuer des rotations de ces fichiers selon la configuration contenue dans le fichier **/etc/logrotate.conf**.
Ligne 1172: Ligne 1184:
  
 <code> <code>
-[root@centos7 ~]# cat /etc/logrotate.conf+[root@centos8 ~]# cat /etc/logrotate.conf
 # see "man logrotate" for details # see "man logrotate" for details
 # rotate log files weekly # rotate log files weekly
Ligne 1191: Ligne 1203:
 # RPM packages drop log rotation information into this directory # RPM packages drop log rotation information into this directory
 include /etc/logrotate.d include /etc/logrotate.d
- 
-# no packages own wtmp and btmp -- we'll rotate them here 
-/var/log/wtmp { 
-    monthly 
-    create 0664 root utmp 
- minsize 1M 
-    rotate 1 
-} 
- 
-/var/log/btmp { 
-    missingok 
-    monthly 
-    create 0600 root utmp 
-    rotate 1 
-} 
  
 # system-specific logs may be also be configured here. # system-specific logs may be also be configured here.
Ligne 1221: Ligne 1218:
 La deuxième partie du fichier concerne des configurations spécifiques pour certains fichiers journaux. La deuxième partie du fichier concerne des configurations spécifiques pour certains fichiers journaux.
  
-<WRAP center round important>+<WRAP center round important 60%>
 **Important** : Notez que la compression des fichiers de journalisation n'est pas activée par défaut. **Important** : Notez que la compression des fichiers de journalisation n'est pas activée par défaut.
 </WRAP> </WRAP>
- 
-====Options de la commande==== 
  
 Les options de la commande logrotate sont : Les options de la commande logrotate sont :
  
 <code> <code>
-[root@centos7 ~]# logrotate --help+[root@centos8 ~]# logrotate --help
 Usage: logrotate [OPTION...] <configfile> Usage: logrotate [OPTION...] <configfile>
-  -d, --debug               Don't do anything, just test (implies -v)+  -d, --debug               Don't do anything, just test and print debug 
 +                            messages
   -f, --force               Force file rotation   -f, --force               Force file rotation
   -m, --mail=command        Command to send mail (instead of `/bin/mail')   -m, --mail=command        Command to send mail (instead of `/bin/mail')
   -s, --state=statefile     Path of state file   -s, --state=statefile     Path of state file
   -v, --verbose             Display messages during rotation   -v, --verbose             Display messages during rotation
-  --version                 Display version information+  -l, --log=logfile         Log file or 'syslog' to log to syslog 
 +      --version             Display version information
  
 Help options: Help options:
   -?, --help                Show this help message   -?, --help                Show this help message
-  --usage                   Display brief usage message+      --usage               Display brief usage message
 </code> </code>
  
-=====La Journalisation avec journald=====+=====LAB #5 - La Journalisation avec journald=====
  
-Sous RHEL/CentOS 7, les fichiers de Syslog sont gardés pour une question de compatibilité. Cependant, tous les journaux sont d'abord collectés par **Journald** pour ensuite être redistribués vers les fichiers classiques se trouvant dans le répertoire /var/log. Les journaux de journald sont stockés dans un seul et unique fichier dynamique dans le répertoire **/run/log/journal** :+Sous RHEL/CentOS 8, les fichiers de Syslog sont gardés pour une question de compatibilité. Cependant, tous les journaux sont d'abord collectés par **Journald** pour ensuite être redistribués vers les fichiers classiques se trouvant dans le répertoire /var/log. Les journaux de journald sont stockés dans un seul et unique fichier dynamique dans le répertoire **/run/log/journal** :
  
 <code> <code>
-[root@centos7 ~]# ls -l /run/log/journal/+[root@centos8 ~]# ls -l /run/log/journal/
 total 0 total 0
-drwxr-sr-x. 2 root systemd-journal 60 Sep 29 14:41 a2feb9eb09b1488da0f23b99a66350f8+drwxr-s---+ 2 root systemd-journal 60 Jun  3 09:01 de79af4f226d480fa7d3fec4cabbf97a
 </code> </code>
  
Ligne 1259: Ligne 1256:
  
 <code> <code>
-[root@centos7 ~]# mkdir /var/log/journal +[root@centos8 ~]# mkdir /var/log/journal 
-[root@centos7 ~]# ls -l /var/log/journal/+[root@centos8 ~]# ls -l /var/log/journal/
 total 0 total 0
-[root@centos7 ~]# systemctl restart systemd-journald +[root@centos8 ~]# systemctl restart systemd-journald 
-[root@centos7 ~]# ls -l /run/log/journal/ +[root@centos8 ~]# ls -l /run/log/journal/ 
-ls: cannot access /run/log/journal/: No such file or directory +ls: cannot access '/run/log/journal/': No such file or directory 
-[root@centos7 ~]# ls -l /var/log/journal/+[root@centos8 ~]# ls -l /var/log/journal/
 total 0 total 0
-drwxr-sr-x. 2 root systemd-journal 73 Sep 29 15:30 a2feb9eb09b1488da0f23b99a66350f8 +drwxr-xr-x. 2 root root 28 Jun  3 13:03 de79af4f226d480fa7d3fec4cabbf97a
-[root@centos7 ~]# +
 </code> </code>
  
-<WRAP center round important> +Journald ne peut pas envoyer les traces à un autre ordinateur. Pour utiliser un serveur de journalisation distant il faut donc inclure la directive **ForwardToSyslog=yes** dans le fichier de configuration de journald, **/etc/systemd/journald.conf**, puis configurer Rsyslog à envoyer les traces au serveur distant 
-**Important** : Journald ne peut pas envoyer les traces à un autre ordinateur. Pour utiliser un serveur de journalisation distant il faut donc inclure la directive **ForwardToSyslog=yes** dans le fichier de configuration de journald, **/etc/systemd/journald.conf**, puis configurer Rsyslog à envoyer les traces au serveur distant. + 
-</WRAP>+<code> 
 +[root@centos8 ~]# cat /etc/systemd/journald.conf 
 +#  This file is part of systemd. 
 +
 +#  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 2.1 of the License, or 
 +#  (at your option) any later version. 
 +
 +# Entries in this file show the compile time defaults. 
 +# You can change settings by editing this file. 
 +# Defaults can be restored by simply deleting this file. 
 +
 +# See journald.conf(5) for details. 
 + 
 +[Journal] 
 +#Storage=auto 
 +#Compress=yes 
 +#Seal=yes 
 +#SplitMode=uid 
 +#SyncIntervalSec=5m 
 +#RateLimitIntervalSec=30s 
 +#RateLimitBurst=10000 
 +#SystemMaxUse= 
 +#SystemKeepFree= 
 +#SystemMaxFileSize= 
 +#SystemMaxFiles=100 
 +#RuntimeMaxUse= 
 +#RuntimeKeepFree= 
 +#RuntimeMaxFileSize= 
 +#RuntimeMaxFiles=100 
 +#MaxRetentionSec= 
 +#MaxFileSec=1month 
 +#ForwardToSyslog=no 
 +ForwardToSyslog=yes 
 +#ForwardToKMsg=no 
 +#ForwardToConsole=no 
 +#ForwardToWall=yes 
 +#TTYPath=/dev/console 
 +#MaxLevelStore=debug 
 +#MaxLevelSyslog=debug 
 +#MaxLevelKMsg=notice 
 +#MaxLevelConsole=info 
 +#MaxLevelWall=emerg 
 +#LineMax=48K 
 +</code>
  
-====Consultation des Journaux====+====5.1 - Consultation des Journaux====
  
 L'utilisation de la commande **journalctl** permet la consultation des journaux : L'utilisation de la commande **journalctl** permet la consultation des journaux :
  
 <code> <code>
-[root@centos7 ~]# journalctl +[root@centos8 ~]# journalctl 
--- Logs begin at Tue 2015-09-29 11:25:10 CEST, end at Tue 2015-09-29 18:10:01 CEST. -- +-- Logs begin at Thu 2021-06-03 09:01:10 EDT, end at Thu 2021-06-03 13:08:01 EDT. -- 
-Sep 29 11:25:10 centos7.fenestros.loc systemd-journal[82]Runtime journal is using 8.0M (max 74.8M, leaving 112.3M of free 740.8M, current limit 74.8 +Jun 03 09:01:10 centos8.ittraining.loc kernelLinux version 4.18.0-240.22.1.el8_3.x86_64 (mockbuild@kbuilder.bsys.centos.org) (gcc version 8.3.1 20191121 (Red Hat 8.3.1-5) (GCC)) #1 SMP Thu Apr 8 19:01:30 UTC 2021 
-Sep 29 11:25:10 centos7.fenestros.loc systemd-journal[82]Runtime journal is using 8.0M (max 74.8Mleaving 112.3M of free 740.8M, current limit 74.8 +Jun 03 09:01:10 centos8.ittraining.loc kernelCommand line: BOOT_IMAGE=(hd0,msdos1)/vmlinuz-4.18.0-240.22.1.el8_3.x86_64 root=UUID=4c0cc28c-0d59-45be-bd73-d292b80be33c ro crashkernel=auto resume=UUID=c8bb3f47-d67f-4b21-b781-766899dc83d4> 
-Sep 29 11:25:10 centos7.fenestros.loc kernel: Initializing cgroup subsys cpuset +Jun 03 09:01:10 centos8.ittraining.loc kernel: x86/fpu: Supporting XSAVE feature 0x001: 'x87 floating point registers' 
-Sep 29 11:25:10 centos7.fenestros.loc kernel: Initializing cgroup subsys cpu +Jun 03 09:01:10 centos8.ittraining.loc kernel: x86/fpu: Supporting XSAVE feature 0x002: 'SSE registers' 
-Sep 29 11:25:10 centos7.fenestros.loc kernel: Initializing cgroup subsys cpuacct +Jun 03 09:01:10 centos8.ittraining.loc kernel: x86/fpu: Supporting XSAVE feature 0x004: 'AVX registers' 
-Sep 29 11:25:10 centos7.fenestros.loc kernel: Linux version 3.10.0-229.4.2.el7.x86_64 (builder@kbuilder.dev.centos.org) (gcc version 4.8.20140120 (R +Jun 03 09:01:10 centos8.ittraining.loc kernel: x86/fpu: xstate_offset[2]:  576, xstate_sizes[2]:  256 
-Sep 29 11:25:10 centos7.fenestros.loc kernel: Command lineBOOT_IMAGE=/vmlinuz-3.10.0-229.4.2.el7.x86_64 root=UUID=b35de665-5ec8-4226-a533-58a1b567ac +Jun 03 09:01:10 centos8.ittraining.loc kernel: x86/fpuEnabled xstate features 0x7, context size is 832 bytes, using 'standard' format
-Sep 29 11:25:10 centos7.fenestros.loc kernel: e820: BIOS-provided physical RAM map: +Jun 03 09:01:10 centos8.ittraining.loc kernel: BIOS-provided physical RAM map: 
-Sep 29 11:25:10 centos7.fenestros.loc kernel: BIOS-e820: [mem 0x0000000000000000-0x000000000009fbff] usable +Jun 03 09:01:10 centos8.ittraining.loc kernel: BIOS-e820: [mem 0x0000000000000000-0x000000000009fbff] usable 
-Sep 29 11:25:10 centos7.fenestros.loc kernel: BIOS-e820: [mem 0x000000000009fc00-0x000000000009ffff] reserved +Jun 03 09:01:10 centos8.ittraining.loc kernel: BIOS-e820: [mem 0x000000000009fc00-0x000000000009ffff] reserved 
-Sep 29 11:25:10 centos7.fenestros.loc kernel: BIOS-e820: [mem 0x00000000000f0000-0x00000000000fffff] reserved +Jun 03 09:01:10 centos8.ittraining.loc kernel: BIOS-e820: [mem 0x00000000000f0000-0x00000000000fffff] reserved 
-Sep 29 11:25:10 centos7.fenestros.loc kernel: BIOS-e820: [mem 0x0000000000100000-0x000000005ffeffff] usable +Jun 03 09:01:10 centos8.ittraining.loc kernel: BIOS-e820: [mem 0x0000000000100000-0x00000000dffeffff] usable 
-Sep 29 11:25:10 centos7.fenestros.loc kernel: BIOS-e820: [mem 0x000000005fff0000-0x000000005fffffff] ACPI data +Jun 03 09:01:10 centos8.ittraining.loc kernel: BIOS-e820: [mem 0x00000000dfff0000-0x00000000dfffffff] ACPI data 
-Sep 29 11:25:10 centos7.fenestros.loc kernel: BIOS-e820: [mem 0x00000000fffc0000-0x00000000ffffffff] reserved +Jun 03 09:01:10 centos8.ittraining.loc kernel: BIOS-e820: [mem 0x00000000fec00000-0x00000000fec00fff] reserved 
-Sep 29 11:25:10 centos7.fenestros.loc kernel: NX (Execute Disable) protection: active +Jun 03 09:01:10 centos8.ittraining.loc kernel: BIOS-e820: [mem 0x00000000fee00000-0x00000000fee00fff] reserved 
-Sep 29 11:25:10 centos7.fenestros.loc kernel: SMBIOS 2.5 present. +Jun 03 09:01:10 centos8.ittraining.loc kernel: BIOS-e820: [mem 0x00000000fffc0000-0x00000000ffffffff] reserved 
-Sep 29 11:25:10 centos7.fenestros.loc kernel: DMI: innotek GmbH VirtualBox/VirtualBox, BIOS VirtualBox 12/01/2006 +Jun 03 09:01:10 centos8.ittraining.loc kernel: BIOS-e820: [mem 0x0000000100000000-0x000000011fffffff] usable 
-Sep 29 11:25:10 centos7.fenestros.loc kernel: e820: update [mem 0x00000000-0x00000fff] usable ==> reserved +Jun 03 09:01:10 centos8.ittraining.loc kernel: NX (Execute Disable) protection: active 
-Sep 29 11:25:10 centos7.fenestros.loc kernel: e820: remove [mem 0x000a0000-0x000fffff] usable +Jun 03 09:01:10 centos8.ittraining.loc kernel: SMBIOS 2.5 present. 
-Sep 29 11:25:10 centos7.fenestros.loc kernel: No AGP bridge found +Jun 03 09:01:10 centos8.ittraining.loc kernel: DMI: innotek GmbH VirtualBox/VirtualBox, BIOS VirtualBox 12/01/2006 
-Sep 29 11:25:10 centos7.fenestros.loc kernel: e820: last_pfn = 0x5fff0 max_arch_pfn = 0x400000000 +Jun 03 09:01:10 centos8.ittraining.loc kernel: Hypervisor detected: KVM 
-Sep 29 11:25:10 centos7.fenestros.loc kernel: MTRR default type: uncachable +Jun 03 09:01:10 centos8.ittraining.loc kernel: kvm-clock: Using msrs 4b564d01 and 4b564d00 
-Sep 29 11:25:10 centos7.fenestros.loc kernel: MTRR variable ranges disabled: +Jun 03 09:01:10 centos8.ittraining.loc kernel: kvm-clock: cpu 0, msr 114801001, primary cpu clock 
-Sep 29 11:25:10 centos7.fenestros.loc kernel: x86 PAT enabledcpu 0old 0x7040600070406, new 0x7010600070106 +Jun 03 09:01:10 centos8.ittraining.loc kernel: kvm-clock: using sched offset of 5675771878 cycles 
-Sep 29 11:25:10 centos7.fenestros.loc kernel: CPU MTRRs all blank - virtualized system. +Jun 03 09:01:10 centos8.ittraining.loc kernel: clocksource: kvm-clock: mask: 0xffffffffffffffff max_cycles: 0x1cd42e4dffb, max_idle_ns: 881590591483 ns 
-Sep 29 11:25:10 centos7.fenestros.loc kernel: found SMP MP-table at [mem 0x0009fff0-0x0009ffff] mapped at [ffff88000009fff0+Jun 03 09:01:10 centos8.ittraining.loc kernel: tsc: Detected 1190.400 MHz processor 
-Sep 29 11:25:10 centos7.fenestros.loc kernel: Base memory trampoline at [ffff88000009900099000 size 24576 +Jun 03 09:01:10 centos8.ittraining.loc kernel: e820: update [mem 0x00000000-0x00000fff] usable ==> reserved 
-Sep 29 11:25:10 centos7.fenestros.loc kernel: init_memory_mapping: [mem 0x00000000-0x000fffff+Jun 03 09:01:10 centos8.ittraining.loc kernel: e820: remove [mem 0x000a0000-0x000fffff] usable 
-lines 1-29+Jun 03 09:01:10 centos8.ittraining.loc kernel: last_pfn = 0x120000 max_arch_pfn = 0x400000000 
 +Jun 03 09:01:10 centos8.ittraining.loc kernel: MTRR default type: uncachable 
 +Jun 03 09:01:10 centos8.ittraining.loc kernel: MTRR variable ranges disabled: 
 +Jun 03 09:01:10 centos8.ittraining.loc kernel: Disabled 
 +Jun 03 09:01:10 centos8.ittraining.loc kernel: x86/PAT: MTRRs disabledskipping PAT initialization too. 
 +Jun 03 09:01:10 centos8.ittraining.loc kernel: CPU MTRRs all blank - virtualized system. 
 +Jun 03 09:01:10 centos8.ittraining.loc kernel: x86/PAT: Configuration [0-7]: WB  WT  UC- UC  WB  WT  UC- UC   
 +Jun 03 09:01:10 centos8.ittraining.loc kernel: last_pfn = 0xdfff0 max_arch_pfn = 0x400000000 
 +Jun 03 09:01:10 centos8.ittraining.loc kernel: found SMP MP-table at [mem 0x0009fff0-0x0009ffff] 
 +Jun 03 09:01:10 centos8.ittraining.loc kernel: kexec: Reserving the low 1M of memory for crashkernel 
 +Jun 03 09:01:10 centos8.ittraining.loc kernel: BRK [0x114a01000, 0x114a01fffPGTABLE 
 +Jun 03 09:01:10 centos8.ittraining.loc kernel: BRK [0x114a02000, 0x114a02fffPGTABLE 
 +Jun 03 09:01:10 centos8.ittraining.loc kernel: BRK [0x114a03000, 0x114a03fff] PGTABLE 
 +Jun 03 09:01:10 centos8.ittraining.loc kernel: BRK [0x114a04000, 0x114a04fff] PGTABLE 
 +Jun 03 09:01:10 centos8.ittraining.loc kernel: BRK [0x114a05000, 0x114a05fff] PGTABLE 
 +Jun 03 09:01:10 centos8.ittraining.loc kernel: BRK [0x114a06000, 0x114a06fff] PGTABLE 
 +Jun 03 09:01:10 centos8.ittraining.loc kernel: BRK [0x114a07000, 0x114a07fff] PGTABLE 
 +Jun 03 09:01:10 centos8.ittraining.loc kernel: BRK [0x114a08000, 0x114a08fff] PGTABLE 
 +Jun 03 09:01:10 centos8.ittraining.loc kernel: BRK [0x114a09000, 0x114a09fff] PGTABLE 
 +Jun 03 09:01:10 centos8.ittraining.loc kernel: RAMDISK: [mem 0x34e00000-0x366f7fff] 
 +Jun 03 09:01:10 centos8.ittraining.loc kernel: ACPI: Early table checksum verification disabled 
 +Jun 03 09:01:10 centos8.ittraining.loc kernel: ACPI: RSDP 0x00000000000E0000 000024 (v02 VBOX  ) 
 +Jun 03 09:01:10 centos8.ittraining.loc kernel: ACPI: XSDT 0x00000000DFFF0030 00003C (v01 VBOX   VBOXXSDT 00000001 ASL  00000061) 
 +Jun 03 09:01:10 centos8.ittraining.loc kernel: ACPI: FACP 0x00000000DFFF00F0 0000F4 (v04 VBOX   VBOXFACP 00000001 ASL  00000061) 
 +Jun 03 09:01:10 centos8.ittraining.loc kernel: ACPI: DSDT 0x00000000DFFF0480 002325 (v02 VBOX   VBOXBIOS 00000002 INTL 20190509) 
 +Jun 03 09:01:10 centos8.ittraining.loc kernel: ACPI: FACS 0x00000000DFFF0200 000040 
 +Jun 03 09:01:10 centos8.ittraining.loc kernel: ACPI: FACS 0x00000000DFFF0200 000040 
 +Jun 03 09:01:10 centos8.ittraining.loc kernel: ACPI: APIC 0x00000000DFFF0240 00006C (v02 VBOX   VBOXAPIC 00000001 ASL  00000061) 
 +lines 1-57
 </code> </code>
  
-<WRAP center round important>+<WRAP center round important 60%>
 **Important** : Notez que les messages importants sont en gras, par exemple les messages de niveaux **notice** ou **warning** et que les messages graves sont en rouge. **Important** : Notez que les messages importants sont en gras, par exemple les messages de niveaux **notice** ou **warning** et que les messages graves sont en rouge.
 </WRAP> </WRAP>
  
-===Consultation des Journaux d'une Application Spécifique===+====5.2 - Consultation des Journaux d'une Application Spécifique====
  
 Pour consulter les entrées concernant une application spécifique, il suffit de passer l'exécutable, y compris son chemin complet, en argument à la commande journalctl :  Pour consulter les entrées concernant une application spécifique, il suffit de passer l'exécutable, y compris son chemin complet, en argument à la commande journalctl : 
  
 <code> <code>
-[root@centos7 ~]# journalctl /sbin/anacron +[root@centos8 ~]# journalctl /sbin/anacron 
--- Logs begin at Tue 2015-09-29 11:25:10 CEST, end at Tue 2015-09-29 18:20:01 CEST. -- +-- Logs begin at Thu 2021-06-03 09:01:10 EDT, end at Thu 2021-06-03 13:10:01 EDT. -- 
-Sep 29 12:01:01 centos7.fenestros.loc anacron[4100]: Anacron started on 2015-09-29 +Jun 03 10:01:01 centos8.ittraining.loc anacron[2575]: Anacron started on 2021-06-03 
-Sep 29 12:01:01 centos7.fenestros.loc anacron[4100]: Will run job `cron.daily' in 38 min. +Jun 03 10:01:01 centos8.ittraining.loc anacron[2575]: Will run job `cron.daily' in 15 min. 
-Sep 29 12:01:01 centos7.fenestros.loc anacron[4100]: Jobs will be executed sequentially +Jun 03 10:01:01 centos8.ittraining.loc anacron[2575]: Jobs will be executed sequentially 
-Sep 29 13:45:00 centos7.fenestros.loc anacron[4100]: Job `cron.daily' started+Jun 03 10:16:01 centos8.ittraining.loc anacron[2575]: Job `cron.daily' started 
 +Jun 03 10:16:01 centos8.ittraining.loc anacron[2575]: Job `cron.daily' terminated 
 +Jun 03 10:16:01 centos8.ittraining.loc anacron[2575]: Normal exit (1 job run)
 </code> </code>
  
-<WRAP center round important> +<WRAP center round important 60%
-**Important** : Rappelez-vous que sous RHEL/CentOS le répertoire **/sbin** est un lien symbolique vers **/usr/sbin**.+**Important** : Rappelez-vous que sous RHEL/CentOS le répertoire **/sbin** est un lien symbolique vers **/usr/sbin**.
 </WRAP> </WRAP>
  
-===Consultation des Journaux depuis le Dernier Démarrage===+====5.3 - Consultation des Journaux depuis le Dernier Démarrage====
  
 Pour consulter les entrées depuis le dernier démarrage, il suffit d'utiliser l'option **-b** de la commande journalctl :  Pour consulter les entrées depuis le dernier démarrage, il suffit d'utiliser l'option **-b** de la commande journalctl : 
  
 <code> <code>
-[root@centos7 ~]# journalctl -b | more +[root@centos8 ~]# journalctl -b | more 
--- Logs begin at Tue 2015-09-29 11:25:10 CEST, end at Tue 2015-09-29 18:28:56 CEST. -- +-- Logs begin at Thu 2021-06-03 09:01:10 EDT, end at Thu 2021-06-03 13:11:01 EDT. -- 
-Sep 29 11:25:10 centos7.fenestros.loc systemd-journal[82]: Runtime journal is using 8.0M (max 74.8M, leaving 112.3M of free 740.8M, current limit 74.8 +Jun 03 09:01:10 centos8.ittraining.loc kernel: Linux version 4.18.0-240.22.1.el8_3.x86_64 (mockbuild@kbuilder.bsys.centos.org) (gcc version 
-M). + 8.3.1 20191121 (Red Hat 8.3.1-5) (GCC)) #1 SMP Thu Apr 8 19:01:30 UTC 2021 
-Sep 29 11:25:10 centos7.fenestros.loc systemd-journal[82]: Runtime journal is using 8.0M (max 74.8M, leaving 112.3M of free 740.8M, current limit 74.8 +Jun 03 09:01:10 centos8.ittraining.loc kernel: Command line: BOOT_IMAGE=(hd0,msdos1)/vmlinuz-4.18.0-240.22.1.el8_3.x86_64 root=UUID=4c0cc28 
-M). +c-0d59-45be-bd73-d292b80be33c ro crashkernel=auto resume=UUID=c8bb3f47-d67f-4b21-b781-766899dc83d4 rhgb quiet 
-Sep 29 11:25:10 centos7.fenestros.loc kernel: Initializing cgroup subsys cpuset +Jun 03 09:01:10 centos8.ittraining.loc kernel: x86/fpu: Supporting XSAVE feature 0x001: 'x87 floating point registers' 
-Sep 29 11:25:10 centos7.fenestros.loc kernel: Initializing cgroup subsys cpu +Jun 03 09:01:10 centos8.ittraining.loc kernel: x86/fpu: Supporting XSAVE feature 0x002: 'SSE registers' 
-Sep 29 11:25:10 centos7.fenestros.loc kernel: Initializing cgroup subsys cpuacct +Jun 03 09:01:10 centos8.ittraining.loc kernel: x86/fpu: Supporting XSAVE feature 0x004: 'AVX registers' 
-Sep 29 11:25:10 centos7.fenestros.loc kernel: Linux version 3.10.0-229.4.2.el7.x86_64 (builder@kbuilder.dev.centos.org) (gcc version 4.8.2 20140120 (+Jun 03 09:01:10 centos8.ittraining.loc kernel: x86/fpu: xstate_offset[2]:  576, xstate_sizes[2]:  256 
-ed Hat 4.8.2-16) (GCC) ) #1 SMP Wed May 13 10:06:09 UTC 2015 +Jun 03 09:01:10 centos8.ittraining.loc kernel: x86/fpu: Enabled xstate features 0x7, context size is 832 bytes, using 'standard' format. 
-Sep 29 11:25:10 centos7.fenestros.loc kernel: Command line: BOOT_IMAGE=/vmlinuz-3.10.0-229.4.2.el7.x86_64 root=UUID=b35de665-5ec8-4226-a533-58a1b567ac +Jun 03 09:01:10 centos8.ittraining.loc kernel: BIOS-provided physical RAM map: 
-91 ro vconsole.keymap=fr crashkernel=auto vconsole.font=latarcyrheb-sun16 rhgb quiet +Jun 03 09:01:10 centos8.ittraining.loc kernel: BIOS-e820: [mem 0x0000000000000000-0x000000000009fbff] usable 
-Sep 29 11:25:10 centos7.fenestros.loc kernel: e820: BIOS-provided physical RAM map: +Jun 03 09:01:10 centos8.ittraining.loc kernel: BIOS-e820: [mem 0x000000000009fc00-0x000000000009ffff] reserved 
-Sep 29 11:25:10 centos7.fenestros.loc kernel: BIOS-e820: [mem 0x0000000000000000-0x000000000009fbff] usable +Jun 03 09:01:10 centos8.ittraining.loc kernel: BIOS-e820: [mem 0x00000000000f0000-0x00000000000fffff] reserved 
-Sep 29 11:25:10 centos7.fenestros.loc kernel: BIOS-e820: [mem 0x000000000009fc00-0x000000000009ffff] reserved +Jun 03 09:01:10 centos8.ittraining.loc kernel: BIOS-e820: [mem 0x0000000000100000-0x00000000dffeffff] usable 
-Sep 29 11:25:10 centos7.fenestros.loc kernel: BIOS-e820: [mem 0x00000000000f0000-0x00000000000fffff] reserved +Jun 03 09:01:10 centos8.ittraining.loc kernel: BIOS-e820: [mem 0x00000000dfff0000-0x00000000dfffffff] ACPI data 
-Sep 29 11:25:10 centos7.fenestros.loc kernel: BIOS-e820: [mem 0x0000000000100000-0x000000005ffeffff] usable +Jun 03 09:01:10 centos8.ittraining.loc kernel: BIOS-e820: [mem 0x00000000fec00000-0x00000000fec00fff] reserved 
-Sep 29 11:25:10 centos7.fenestros.loc kernel: BIOS-e820: [mem 0x000000005fff0000-0x000000005fffffff] ACPI data +Jun 03 09:01:10 centos8.ittraining.loc kernel: BIOS-e820: [mem 0x00000000fee00000-0x00000000fee00fff] reserved 
-Sep 29 11:25:10 centos7.fenestros.loc kernel: BIOS-e820: [mem 0x00000000fffc0000-0x00000000ffffffff] reserved +Jun 03 09:01:10 centos8.ittraining.loc kernel: BIOS-e820: [mem 0x00000000fffc0000-0x00000000ffffffff] reserved 
-Sep 29 11:25:10 centos7.fenestros.loc kernel: NX (Execute Disable) protection: active +Jun 03 09:01:10 centos8.ittraining.loc kernel: BIOS-e820: [mem 0x0000000100000000-0x000000011fffffff] usable 
-Sep 29 11:25:10 centos7.fenestros.loc kernel: SMBIOS 2.5 present. +Jun 03 09:01:10 centos8.ittraining.loc kernel: NX (Execute Disable) protection: active 
-Sep 29 11:25:10 centos7.fenestros.loc kernel: DMI: innotek GmbH VirtualBox/VirtualBox, BIOS VirtualBox 12/01/2006 +Jun 03 09:01:10 centos8.ittraining.loc kernel: SMBIOS 2.5 present. 
-Sep 29 11:25:10 centos7.fenestros.loc kernel: e820update [mem 0x00000000-0x00000fff] usable ==> reserved +Jun 03 09:01:10 centos8.ittraining.loc kernel: DMI: innotek GmbH VirtualBox/VirtualBox, BIOS VirtualBox 12/01/2006 
-Sep 29 11:25:10 centos7.fenestros.loc kernel: e820: remove [mem 0x000a0000-0x000fffff] usable +Jun 03 09:01:10 centos8.ittraining.loc kernel: Hypervisor detectedKVM 
-Sep 29 11:25:10 centos7.fenestros.loc kernel: No AGP bridge found +Jun 03 09:01:10 centos8.ittraining.loc kernel: kvm-clock: Using msrs 4b564d01 and 4b564d00 
-Sep 29 11:25:10 centos7.fenestros.loc kernel: e820last_pfn = 0x5fff0 max_arch_pfn = 0x400000000 +Jun 03 09:01:10 centos8.ittraining.loc kernel: kvm-clock: cpu 0, msr 114801001, primary cpu clock 
-Sep 29 11:25:10 centos7.fenestros.loc kernel: MTRR default typeuncachable +Jun 03 09:01:10 centos8.ittraining.loc kernel: kvm-clockusing sched offset of 5675771878 cycles 
-Sep 29 11:25:10 centos7.fenestros.loc kernel: MTRR variable ranges disabled+Jun 03 09:01:10 centos8.ittraining.loc kernel: clocksourcekvm-clock: mask: 0xffffffffffffffff max_cycles: 0x1cd42e4dffb, max_idle_ns: 881 
-Sep 29 11:25:10 centos7.fenestros.loc kernel: x86 PAT enabledcpu 0, old 0x7040600070406, new 0x7010600070106+590591483 ns 
 +Jun 03 09:01:10 centos8.ittraining.loc kernel: tscDetected 1190.400 MHz processor 
 +Jun 03 09:01:10 centos8.ittraining.loc kernel: e820update [mem 0x00000000-0x00000fff] usable ==> reserved
 --More-- --More--
 </code> </code>
  
-<WRAP center round important>+<WRAP center round important 60%>
 **Important** : Notez que vous pouvez consulter les messages des démarrages précédents, il est possible d'utiliser les options **-b 1**, **-b 2** etc. **Important** : Notez que vous pouvez consulter les messages des démarrages précédents, il est possible d'utiliser les options **-b 1**, **-b 2** etc.
 </WRAP> </WRAP>
  
-===Consultation des Journaux d'une Priorité Spécifique===+====5.4 - Consultation des Journaux d'une Priorité Spécifique====
  
 Pour consulter les entrées à partir d'une priorité spécifique et supérieur, il suffit d'utiliser l'option **-p** de la commande journalctl en spécifiant la priorité concernée :  Pour consulter les entrées à partir d'une priorité spécifique et supérieur, il suffit d'utiliser l'option **-p** de la commande journalctl en spécifiant la priorité concernée : 
  
 <code> <code>
-[root@centos7 ~]# journalctl -p warning +[root@centos8 ~]# journalctl -p warning 
--- Logs begin at Tue 2015-09-29 11:25:10 CEST, end at Tue 2015-09-29 18:30:02 CEST. -- +-- Logs begin at Thu 2021-06-03 09:01:10 EDT, end at Thu 2021-06-03 13:12:01 EDT. -- 
-Sep 29 11:25:10 centos7.fenestros.loc kernel: ACPI: RSDP 00000000000e0000 00024 (v02 VBOX  ) +Jun 03 09:01:10 centos8.ittraining.loc kernel:  #2 
-Sep 29 11:25:10 centos7.fenestros.loc kernel: ACPI: XSDT 000000005fff0030 0003C (v01 VBOX   VBOXXSDT 00000001 ASL  00000061) +Jun 03 09:01:10 centos8.ittraining.loc kernel:  #3 
-Sep 29 11:25:10 centos7.fenestros.loc kernel: ACPIFACP 000000005fff00f0 000F4 (v04 VBOX   VBOXFACP 00000001 ASL  00000061) +Jun 03 09:01:10 centos8.ittraining.loc kernel: acpi PNP0A03:00fail to add MMCONFIG information, can't access extended PCI configuration > 
-Sep 29 11:25:10 centos7.fenestros.loc kernel: ACPI: DSDT 000000005fff0470 01BF1 (v01 VBOX   VBOXBIOS 00000002 INTL 20100528) +Jun 03 09:01:12 centos8.ittraining.loc kernel: e1000E1000 MODULE IS NOT SUPPORTED 
-Sep 29 11:25:10 centos7.fenestros.loc kernel: ACPIFACS 000000005fff0200 00040 +Jun 03 09:01:12 centos8.ittraining.loc kernel: [drm:vmw_host_log [vmwgfx]] *ERROR* Failed to send host log message
-Sep 29 11:25:10 centos7.fenestros.loc kernel: ACPIAPIC 000000005fff0240 00054 (v02 VBOX   VBOXAPIC 00000001 ASL  00000061) +Jun 03 09:01:12 centos8.ittraining.loc kernel: [drm:vmw_host_log [vmwgfx]] *ERROR* Failed to send host log message
-Sep 29 11:25:10 centos7.fenestros.loc kernel: ACPI: SSDT 000000005fff02a0 001CC (v01 VBOX   VBOXCPUT 00000002 INTL 20100528) +Jun 03 09:01:18 centos8.ittraining.loc kernel: printksystemd19 output lines suppressed due to ratelimiting 
-Sep 29 11:25:10 centos7.fenestros.loc kernel: kexeccrashkernel=auto resulted in zero bytes of reserved memory+Jun 03 09:01:20 centos8.ittraining.loc firewalld[874]: WARNINGAllowZoneDrifting is enabledThis is considered an insecure configuration> 
-Sep 29 11:25:10 centos7.fenestros.loc kernel: Zone ranges: +Jun 03 09:01:21 centos8.ittraining.loc systemd[1]iscsi.serviceUnit cannot be reloaded because it is inactive
-Sep 29 11:25:10 centos7.fenestros.loc kernel:   DMA      [mem 0x00001000-0x00ffffff] +Jun 03 09:01:24 centos8.ittraining.loc systemd[1]: iscsi.serviceUnit cannot be reloaded because it is inactive
-Sep 29 11:25:10 centos7.fenestros.loc kernel:   DMA32    [mem 0x01000000-0xffffffff] +Jun 03 09:01:24 centos8.ittraining.loc systemd[1]iscsi.serviceUnit cannot be reloaded because it is inactive
-Sep 29 11:25:10 centos7.fenestros.loc kernel:   Normal   empty +Jun 03 09:01:26 centos8.ittraining.loc chronyd[850]System clock wrong by 1.753498 secondsadjustment started 
-Sep 29 11:25:10 centos7.fenestros.loc kernelMovable zone start for each node +Jun 03 09:01:28 centos8.ittraining.loc chronyd[850]: System clock was stepped by 1.753498 seconds 
-Sep 29 11:25:10 centos7.fenestros.loc kernelEarly memory node ranges +Jun 03 12:46:31 centos8.ittraining.loc chronyd[850]: System clock wrong by 47255.336542 secondsadjustment started 
-Sep 29 11:25:10 centos7.fenestros.loc kernel:   node   0: [mem 0x00001000-0x0009efff] +lines 1-15/15 (END)
-Sep 29 11:25:10 centos7.fenestros.loc kernel:   node   0: [mem 0x00100000-0x5ffeffff] +
-Sep 29 11:25:10 centos7.fenestros.loc kernelBuilt 1 zonelists in Node order, mobility grouping on Total pages: 386937 +
-Sep 29 11:25:10 centos7.fenestros.loc kernelPolicy zone: DMA32 +
-Sep 29 11:25:10 centos7.fenestros.loc kerneltsc: Fast TSC calibration failed +
-Sep 29 11:25:10 centos7.fenestros.loc kernel: tsc: Unable to calibrate against PIT +
-Sep 29 11:25:10 centos7.fenestros.loc kernelACPI: All ACPI Tables successfully acquired +
-Sep 29 11:25:10 centos7.fenestros.loc kernel: NMI watchdog: disabled (cpu0): hardware events not enabled +
-Sep 29 11:25:10 centos7.fenestros.loc kernel: ACPI: Executed blocks of module-level executable AML code +
-Sep 29 11:25:10 centos7.fenestros.loc kernel: ACPI Exception: AE_NOT_FOUNDWhile evaluating Sleep State [\_S1_] (20130517/hwxface-571) +
-Sep 29 11:25:10 centos7.fenestros.loc kernel: ACPI Exception: AE_NOT_FOUND, While evaluating Sleep State [\_S2_(20130517/hwxface-571) +
-Sep 29 11:25:10 centos7.fenestros.loc kernel: ACPI Exception: AE_NOT_FOUND, While evaluating Sleep State [\_S3_] (20130517/hwxface-571) +
-Sep 29 11:25:10 centos7.fenestros.loc kernel: ACPI Exception: AE_NOT_FOUND, While evaluating Sleep State [\_S4_(20130517/hwxface-571) +
-Sep 29 11:25:10 centos7.fenestros.loc kernel: acpi PNP0A03:00: fail to add MMCONFIG informationcan't access extended PCI configuration space under t +
-lines 1-29+
 </code> </code>
  
-===Consultation des Journaux d'une Plage de Dates ou d'Heures===+Les priorités reconnues par Journald sont : 
 + 
 +^ Niveau ^ Priorité ^ Description ^ 
 +| 0 | emerg | Système inutilisable | 
 +| 1 | alert | Action immédiate requise | 
 +| 2 | crit | Condition critique atteinte | 
 +| 3 | err | Erreurs rencontrées | 
 +| 4 | warning | Avertissements présentés | 
 +| 5 | notice | Condition normale - message important | 
 +| 6 | info | Condition normale - message simple | 
 +| 7 | debug | Condition normale - message de débogage |  
 + 
 +====5.5 - Consultation des Journaux d'une Plage de Dates ou d'Heures====
  
 Pour consulter les entrées d'une plage de dates ou d'heures, il suffit de passer cette plage en argument à la commande journalctl :  Pour consulter les entrées d'une plage de dates ou d'heures, il suffit de passer cette plage en argument à la commande journalctl : 
  
 <code> <code>
-[root@centos7 ~]# journalctl --since 18:00 --until now +[root@centos8 ~]# journalctl --since 12:00 --until now 
--- Logs begin at Tue 2015-09-29 11:25:10 CEST, end at Tue 2015-09-29 18:30:02 CEST. -- +-- Logs begin at Thu 2021-06-03 09:01:10 EDT, end at Thu 2021-06-03 13:14:01 EDT. -- 
-Sep 29 18:05:50 centos7.fenestros.loc systemd[1]: Time has been changed +Jun 03 12:00:01 centos8.ittraining.loc systemd[1]: Started Session 181 of user trainee. 
-Sep 29 18:06:23 centos7.fenestros.loc dbus-daemon[526]: dbus[526]: [systemActivating via systemdservice name='net.reactivated.Fprint' unit='fprint +Jun 03 12:00:01 centos8.ittraining.loc CROND[4238]: (trainee) CMD (/bin/pwd > pwd.txt) 
-Sep 29 18:06:23 centos7.fenestros.loc dbus[526]: [system] Activating via systemd: service name='net.reactivated.Fprint' unit='fprintd.service' +Jun 03 12:00:01 centos8.ittraining.loc systemd[1]: session-181.scope: Succeeded
-Sep 29 18:06:23 centos7.fenestros.loc systemd[1]: Starting Fingerprint Authentication Daemon..+Jun 03 12:01:01 centos8.ittraining.loc CROND[4251]: (root) CMD (run-parts /etc/cron.hourly) 
-Sep 29 18:06:23 centos7.fenestros.loc dbus-daemon[526]: dbus[526]: [systemSuccessfully activated service 'net.reactivated.Fprint' +Jun 03 12:01:01 centos8.ittraining.loc systemd[1]: Started Session 182 of user trainee
-Sep 29 18:06:23 centos7.fenestros.loc dbus[526]: [system] Successfully activated service 'net.reactivated.Fprint' +Jun 03 12:01:01 centos8.ittraining.loc run-parts[4255]: (/etc/cron.hourly) starting 0anacron 
-Sep 29 18:06:23 centos7.fenestros.loc systemd[1]: Started Fingerprint Authentication Daemon+Jun 03 12:01:01 centos8.ittraining.loc CROND[4260]: (trainee) CMD (/bin/pwd > pwd.txt) 
-Sep 29 18:06:23 centos7.fenestros.loc fprintd[7642]: Launching FprintObject +Jun 03 12:01:01 centos8.ittraining.loc run-parts[4262]: (/etc/cron.hourly) finished 0anacron 
-Sep 29 18:06:23 centos7.fenestros.loc fprintd[7642]: ** Message: D-Bus service launched with name: net.reactivated.Fprint +Jun 03 12:01:01 centos8.ittraining.loc systemd[1]: session-182.scope: Succeeded
-Sep 29 18:06:23 centos7.fenestros.loc fprintd[7642]: ** Messageentering main loop +Jun 03 12:02:01 centos8.ittraining.loc systemd[1]: Started Session 183 of user trainee. 
-Sep 29 18:06:27 centos7.fenestros.loc gdm-password][7646]: gkr-pam: unlocked login keyring +Jun 03 12:02:01 centos8.ittraining.loc CROND[4275]: (trainee) CMD (/bin/pwd > pwd.txt) 
-Sep 29 18:06:27 centos7.fenestros.loc dbus-daemon[526]: dbus[526]: [system] Activating via systemd: service name='org.freedesktop.hostname1' unit='dbu +Jun 03 12:02:01 centos8.ittraining.loc systemd[1]: session-183.scopeSucceeded. 
-Sep 29 18:06:27 centos7.fenestros.loc dbus[526]: [system] Activating via systemd: service name='org.freedesktop.hostname1' unit='dbus-org.freedesktop+Jun 03 12:03:01 centos8.ittraining.loc systemd[1]: Started Session 184 of user trainee. 
-Sep 29 18:06:27 centos7.fenestros.loc systemd[1]: Starting Hostname Service..+Jun 03 12:03:01 centos8.ittraining.loc CROND[4289]: (trainee) CMD (/bin/pwd > pwd.txt) 
-Sep 29 18:06:27 centos7.fenestros.loc dbus-daemon[526]: dbus[526]: [system] Successfully activated service 'org.freedesktop.hostname1' +Jun 03 12:03:01 centos8.ittraining.loc systemd[1]: session-184.scope: Succeeded
-Sep 29 18:06:27 centos7.fenestros.loc dbus[526]: [system] Successfully activated service 'org.freedesktop.hostname1' +Jun 03 12:04:01 centos8.ittraining.loc systemd[1]: Started Session 185 of user trainee
-Sep 29 18:06:27 centos7.fenestros.loc systemd[1]: Started Hostname Service+Jun 03 12:04:01 centos8.ittraining.loc CROND[4303]: (trainee) CMD (/bin/pwd > pwd.txt) 
-Sep 29 18:06:53 centos7.fenestros.loc fprintd[7642]: ** Message: No devices in use, exit +Jun 03 12:04:01 centos8.ittraining.loc systemd[1]: session-185.scope: Succeeded
-Sep 29 18:09:27 centos7.fenestros.loc systemd[1]: Stopping Journal Service... +Jun 03 12:05:01 centos8.ittraining.loc systemd[1]: Started Session 186 of user trainee
-Sep 29 18:09:27 centos7.fenestros.loc systemd-journal[362]: Journal stopped +Jun 03 12:05:01 centos8.ittraining.loc CROND[4319]: (trainee) CMD (/bin/pwd > pwd.txt) 
-Sep 29 18:09:27 centos7.fenestros.loc systemd-journal[7694]: Permanent journal is using 8.0M (max 699.0M, leaving 1.0G of free 2.5G, current limit 699 +Jun 03 12:05:01 centos8.ittraining.loc systemd[1]: session-186.scope: Succeeded
-Sep 29 18:09:27 centos7.fenestros.loc systemd-journal[7694]: Permanent journal is using 8.0M (max 699.0M, leaving 1.0G of free 2.5G, current limit 699 +Jun 03 12:06:02 centos8.ittraining.loc systemd[1]: Started Session 187 of user trainee. 
-Sep 29 18:09:27 centos7.fenestros.loc systemd-journal[7694]: Time spent on flushing to /var is 52.802ms for 1492 entries+Jun 03 12:06:02 centos8.ittraining.loc CROND[4332]: (trainee) CMD (/bin/pwd > pwd.txt) 
-Sep 29 18:09:27 centos7.fenestros.loc systemd-journald[362]: Received SIGTERM +Jun 03 12:06:02 centos8.ittraining.loc systemd[1]: session-187.scope: Succeeded
-Sep 29 18:09:27 centos7.fenestros.loc systemd-journal[7694]: Journal started +Jun 03 12:07:01 centos8.ittraining.loc systemd[1]: Started Session 188 of user trainee
-Sep 29 18:09:27 centos7.fenestros.loc systemd[1]: Starting Trigger Flushing of Journal to Persistent Storage..+Jun 03 12:07:01 centos8.ittraining.loc CROND[4346]: (trainee) CMD (/bin/pwd > pwd.txt) 
-Sep 29 18:09:27 centos7.fenestros.loc systemd[1]: Started Trigger Flushing of Journal to Persistent Storage+Jun 03 12:07:01 centos8.ittraining.loc systemd[1]: session-188.scope: Succeeded. 
-Sep 29 18:10:01 centos7.fenestros.loc systemd[1]: Created slice user-0.slice+Jun 03 12:08:01 centos8.ittraining.loc systemd[1]: Started Session 189 of user trainee
-lines 1-29+Jun 03 12:08:01 centos8.ittraining.loc CROND[4360]: (trainee) CMD (/bin/pwd > pwd.txt) 
 +Jun 03 12:08:01 centos8.ittraining.loc systemd[1]: session-189.scope: Succeeded
 +lines 1-31
 </code> </code>
  
-<WRAP center round important> +<WRAP center round important 60%
-**Important** : Le format de la date est **2015-09-29 18:38:00**. Il est possible d'utiliser des mots clefs : **yesterday**, **today**, **tomorrow**, **now**.+**Important** : Il est possible d'utiliser des mots clefs : **yesterday**, **today**, **tomorrow**, **now**.
 </WRAP> </WRAP>
  
-===Consultation des Journaux en Live===+====5.6 - Consultation des Journaux en Live====
  
 Pour consulter les journaux en live, il suffit d'utiliser l'option **-f** de la commande journalctl :  Pour consulter les journaux en live, il suffit d'utiliser l'option **-f** de la commande journalctl : 
  
 <code> <code>
-[root@centos7 ~]# journalctl -f +[root@centos8 ~]# journalctl -f 
--- Logs begin at Tue 2015-09-29 11:25:10 CEST. -- +-- Logs begin at Thu 2021-06-03 09:01:10 EDT. -- 
-Sep 29 18:28:56 centos7.fenestros.loc gdm-password][8599]: gkr-pam: unlocked login keyring +Jun 03 13:13:08 centos8.ittraining.loc systemd[1]: Started dnf makecache. 
-Sep 29 18:29:24 centos7.fenestros.loc fprintd[8595]: ** Message: No devices in use, exit +Jun 03 13:14:01 centos8.ittraining.loc systemd[1]: Started Session 256 of user trainee. 
-Sep 29 18:30:01 centos7.fenestros.loc systemd[1]: Created slice user-0.slice+Jun 03 13:14:01 centos8.ittraining.loc CROND[5391]: (trainee) CMD (/bin/pwd > pwd.txt) 
-Sep 29 18:30:02 centos7.fenestros.loc systemd[1]: Starting Session 33 of user root+Jun 03 13:14:01 centos8.ittraining.loc systemd[1]: session-256.scope: Succeeded
-Sep 29 18:30:02 centos7.fenestros.loc systemd[1]: Started Session 33 of user root+Jun 03 13:15:01 centos8.ittraining.loc systemd[1]: Started Session 257 of user trainee
-Sep 29 18:30:02 centos7.fenestros.loc CROND[8670]: (root) CMD (/usr/lib64/sa/sa1 1 1+Jun 03 13:15:01 centos8.ittraining.loc CROND[5407]: (trainee) CMD (/bin/pwd > pwd.txt
-Sep 29 18:40:01 centos7.fenestros.loc systemd[1]: Created slice user-0.slice. +Jun 03 13:15:01 centos8.ittraining.loc systemd[1]: session-257.scopeSucceeded
-Sep 29 18:40:01 centos7.fenestros.loc systemd[1]: Starting Session 34 of user root+Jun 03 13:16:02 centos8.ittraining.loc systemd[1]: Started Session 258 of user trainee
-Sep 29 18:40:01 centos7.fenestros.loc systemd[1]: Started Session 34 of user root+Jun 03 13:16:02 centos8.ittraining.loc CROND[5420]: (trainee) CMD (/bin/pwd > pwd.txt
-Sep 29 18:40:01 centos7.fenestros.loc CROND[8809]: (root) CMD (/usr/lib64/sa/sa1 1 1+Jun 03 13:16:02 centos8.ittraining.loc systemd[1]: session-258.scope: Succeeded. 
 +^C
 </code> </code>
  
Ligne 1479: Ligne 1552:
  
 <code> <code>
-[trainee@centos7 ~]$ logger -p user.info Linux est super+[trainee@centos8 ~]$ logger -p user.info Linux est super
 </code> </code>
  
Ligne 1485: Ligne 1558:
  
 <code> <code>
-[root@centos7 ~]# journalctl -f +[root@centos8 ~]# journalctl -f 
--- Logs begin at Tue 2015-09-29 11:25:10 CEST. -- +-- Logs begin at Thu 2021-06-03 09:01:10 EDT. -- 
-Sep 29 18:28:56 centos7.fenestros.loc gdm-password][8599]: gkr-pamunlocked login keyring +Jun 03 13:13:08 centos8.ittraining.loc systemd[1]: Started dnf makecache. 
-Sep 29 18:29:24 centos7.fenestros.loc fprintd[8595]: ** MessageNo devices in use, exit +Jun 03 13:14:01 centos8.ittraining.loc systemd[1]: Started Session 256 of user trainee. 
-Sep 29 18:30:01 centos7.fenestros.loc systemd[1]: Created slice user-0.slice+Jun 03 13:14:01 centos8.ittraining.loc CROND[5391]: (trainee) CMD (/bin/pwd > pwd.txt) 
-Sep 29 18:30:02 centos7.fenestros.loc systemd[1]: Starting Session 33 of user root+Jun 03 13:14:01 centos8.ittraining.loc systemd[1]: session-256.scopeSucceeded. 
-Sep 29 18:30:02 centos7.fenestros.loc systemd[1]: Started Session 33 of user root+Jun 03 13:15:01 centos8.ittraining.loc systemd[1]: Started Session 257 of user trainee. 
-Sep 29 18:30:02 centos7.fenestros.loc CROND[8670]: (root) CMD (/usr/lib64/sa/sa1 1 1+Jun 03 13:15:01 centos8.ittraining.loc CROND[5407]: (trainee) CMD (/bin/pwd > pwd.txt) 
-Sep 29 18:40:01 centos7.fenestros.loc systemd[1]: Created slice user-0.slice+Jun 03 13:15:01 centos8.ittraining.loc systemd[1]: session-257.scope: Succeeded
-Sep 29 18:40:01 centos7.fenestros.loc systemd[1]: Starting Session 34 of user root+Jun 03 13:16:02 centos8.ittraining.loc systemd[1]: Started Session 258 of user trainee
-Sep 29 18:40:01 centos7.fenestros.loc systemd[1]: Started Session 34 of user root+Jun 03 13:16:02 centos8.ittraining.loc CROND[5420]: (trainee) CMD (/bin/pwd > pwd.txt) 
-Sep 29 18:40:01 centos7.fenestros.loc CROND[8809]: (root) CMD (/usr/lib64/sa/sa1 1 1+Jun 03 13:16:02 centos8.ittraining.loc systemd[1]: session-258.scope: Succeeded. 
-Sep 29 18:43:00 centos7.fenestros.loc trainee[8930]: Linux est super +Jun 03 13:17:01 centos8.ittraining.loc systemd[1]: Started Session 259 of user trainee
- +Jun 03 13:17:01 centos8.ittraining.loc CROND[5436]: (trainee) CMD (/bin/pwd > pwd.txt
 +Jun 03 13:17:01 centos8.ittraining.loc systemd[1]: session-259.scope: Succeeded. 
 +Jun 03 13:17:19 centos8.ittraining.loc sshd[5439]: Accepted password for trainee from 10.0.2.2 port 39906 ssh2 
 +Jun 03 13:17:19 centos8.ittraining.loc systemd-logind[880]: New session 260 of user trainee. 
 +Jun 03 13:17:19 centos8.ittraining.loc systemd[1]: Started Session 260 of user trainee
 +Jun 03 13:17:19 centos8.ittraining.loc sshd[5439]: pam_unix(sshd:session): session opened for user trainee by (uid=0) 
 +Jun 03 13:17:34 centos8.ittraining.loc trainee[5470]: Linux est super 
 +Jun 03 13:17:34 centos8.ittraining.loc rsyslogd[1113]: imjournal: journal files changed, reloading...  [v8.1911.0-6.el8 try https://www.rsyslog.com/e/0 ] 
 +Jun 03 13:18:01 centos8.ittraining.loc systemd[1]: Started Session 261 of user trainee
 +Jun 03 13:18:01 centos8.ittraining.loc CROND[5481]: (trainee) CMD (/bin/pwd > pwd.txt
 +Jun 03 13:18:01 centos8.ittraining.loc systemd[1]: session-261.scope: Succeeded. 
 +^C
 </code> </code>
  
-<WRAP center round important> +<WRAP center round important 60%
-**Important** : Notez la présence de la dernière ligne. +**Important** : Notez la présence de la ligne **Jun 03 13:17:34 centos8.ittraining.loc trainee[5470]: Linux est super**
 </WRAP> </WRAP>
  
-===Consultation des Journaux avec des Mots Clefs===+====5.7 - Consultation des Journaux avec des Mots Clefs===
  
-Pour consulter les mots clefs compris par Journald, tapez la commande journalctl puis appuyer trois fois sur la touche <key>Tab</key> :+Pour consulter les mots clefs compris par Journald, tapez la commande **journalctl** puis appuyer **deux** fois sur la touche <key>Tab</key> :
  
 <code> <code>
-[root@centos7 ~]# journalctl [tab] [tab] [tab] +[root@centos8 ~]# journalctl [tab] [tab] 
-_AUDIT_LOGINUID=             COREDUMP_EXE               _MACHINE_ID                _SOURCE_REALTIME_TIMESTAMP=  _TRANSPORT+_AUDIT_LOGINUID=              _HOSTNAME                   NM_DEVICE                   _SYSTEMD_SESSION
-_AUDIT_SESSION=              __CURSOR=                    MESSAGE                    SYSLOG_FACILITY=             _UDEV_DEVLINK+_AUDIT_SESSION=               INITRD_USEC=                  NM_LOG_DOMAINS=               _SYSTEMD_SLICE= 
-_BOOT_ID=                    ERRNO                      MESSAGE_ID                 SYSLOG_IDENTIFIER          _UDEV_DEVNODE+AVAILABLE=                    INVOCATION_ID               NM_LOG_LEVEL=                 _SYSTEMD_UNIT= 
-_CMDLINE=                    _EXE                       __MONOTONIC_TIMESTAMP      SYSLOG_PID=                  _UDEV_SYSNAME+AVAILABLE_PRETTY=             JOB_ID=                       N_RESTARTS=                   _SYSTEMD_USER_SLICE
-CODE_FILE=                   _GID                       _PID=                        _SYSTEMD_CGROUP=             _UID+_BOOT_ID=                     JOB_RESULT                  _PID                        _SYSTEMD_USER_UNIT= 
-CODE_FUNC=                   _HOSTNAME=                   PRIORITY=                    _SYSTEMD_OWNER_UID          +_CAP_EFFECTIVE=               JOB_TYPE=                     PRIORITY=                     TIMESTAMP_BOOTTIME
-CODE_LINE=                   _KERNEL_DEVICE=              __REALTIME_TIMESTAMP=        _SYSTEMD_SESSION=             +_CMDLINE=                     JOURNAL_NAME                SEAT_ID                     TIMESTAMP_MONOTONIC
-_COMM                      _KERNEL_SUBSYSTEM          _SELINUX_CONTEXT           _SYSTEMD_UNIT   +CODE_FILE=                    JOURNAL_PATH                _SELINUX_CONTEXT=             _TRANSPORT
 +CODE_FUNC=                    _KERNEL_DEVICE=               SESSION_ID=                   _UDEV_DEVNODE= 
 +CODE_LINE=                    _KERNEL_SUBSYSTEM=            _SOURCE_MONOTONIC_TIMESTAMP=  _UDEV_SYSNAME
 +_COMM=                        KERNEL_USEC=                  _SOURCE_REALTIME_TIMESTAMP=   _UID= 
 +CURRENT_USE=                  LEADER=                       SSSD_DOMAIN=                  UNIT= 
 +CURRENT_USE_PRETTY=           LIMIT=                        _STREAM_ID=                   USER_ID= 
 +DISK_AVAILABLE=               LIMIT_PRETTY=                 SYSLOG_FACILITY=              USER_INVOCATION_ID= 
 +DISK_AVAILABLE_PRETTY=        _MACHINE_ID=                  SYSLOG_IDENTIFIER=            USERSPACE_USEC= 
 +DISK_KEEP_FREE              MAX_USE                     SYSLOG_PID                  USER_UNIT= 
 +DISK_KEEP_FREE_PRETTY=        MAX_USE_PRETTY=               _SYSTEMD_CGROUP=               
 +_EXE=                         MESSAGE=                      _SYSTEMD_INVOCATION_ID=        
 +_GID=                         MESSAGE_ID=                   _SYSTEMD_OWNER_UID  
 </code> </code>
  
Ligne 1525: Ligne 1619:
  
 <code> <code>
-[root@centos7 ~]# journalctl _UID= +[root@centos8 ~]# journalctl _UID= 
-0     1000  172   32    42    70    81    994   997   999    +0     1000  81    983   990   992   998    
-[root@centos7 ~]# journalctl _COMM= +[root@centos8 ~]# journalctl _COMM= 
-abrtd            avahi-daemon     dracut-cmdline   kdumpctl         NetworkManager   rtkit-daemon     su               vboxadd-service +anacron          dbus-daemon      kdumpctl         NetworkManager   smartd           sssd_nss         systemd-hiberna   
-accounts-daemon  bluetoothd       fprintd          libvirtd         nm-dispatcher    run-parts        systemd          vmtoolsd +auditd           dnf              logger           polkitd          sm-notify        su               systemd-journal   
-alsactl          chronyd          gdm-session-wor  logger           polkitd          sa1              systemd-fsck      +augenrules       dnsmasq          login            rngd             sshd             (systemd)        systemd-logind    
-anacron          colord           gnome-session    master           postlog          sh               systemd-journal   +chronyd          dracut-cmdline   lvm              rsyslogd         sssd             systemd          systemd-udevd     
-audispd          crond            goa-daemon       ModemManager     pulseaudio       smartd           systemd-logind    +crond            firewalld        netcf-transacti  sh               sssd_be          systemd-fsck   
-auditd           dbus-daemon      goa-identity-se  netcf-transacti  rngd             sm-notify        udisksd           +
-augenrules       dhclient         irqbalance       network          rpcbind          sshd             vboxadd  +
-[root@centos7 ~]# journalctl _COMM=   +
 </code> </code>
  
 ----- -----
-<html> +Copyright © 2024 Hugh Norris.
-<div align="center"> +
-Copyright © 2021 Hugh Norris. +
-</html>+
Menu