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:redhat:rh124en:l112 [2024/11/12 13:49] adminelearning:workbooks:redhat:rh124en:l112 [2024/11/29 08:45] (Version actuelle) admin
Ligne 62: Ligne 62:
         * Usage         * Usage
       * 3.6 - Setting up Asymmetric Keys       * 3.6 - Setting up Asymmetric Keys
 +
 =====Understanding IPv4===== =====Understanding IPv4=====
  
 ==== TCP headers ==== ==== TCP headers ====
  
-The TCP header is encoded in 4 bytes, i.e. 32 bits: +The TCP header is encoded on 4 bytes, i.e. 32 bits: 
  
 ^ 1st byte ^ 2nd byte ^ 3rd byte ^ 4th byte ^ ^ 1st byte ^ 2nd byte ^ 3rd byte ^ 4th byte ^
Ligne 98: Ligne 99:
 ==== UDP headers ==== ==== UDP headers ====
  
-The UDP header is encoded in 4 bytes, i.e. 32 bits: +The UDP header is encoded on 4 bytes, i.e. 32 bits: 
  
 ^ 1st byte ^ 2nd byte ^ 3rd byte ^ 4th byte ^ ^ 1st byte ^ 2nd byte ^ 3rd byte ^ 4th byte ^
Ligne 104: Ligne 105:
 |  Length  ||  Checksum  || |  Length  ||  Checksum  ||
 |  Data  |||| |  Data  ||||
- 
-The UDP header is 8 bytes long. 
  
 ==== Fragmentation and Re-encapsulation ==== ==== Fragmentation and Re-encapsulation ====
Ligne 165: Ligne 164:
 ==== Subnet Masks ==== ==== Subnet Masks ====
  
-Like the IP address, the subnet mask has 4 octets or 32 bits. Subnet masks are used to identify the Net ID and Host ID:+Like the IP address, the subnet mask has 4 bytes or 32 bits. Subnet masks are used to identify the Net ID and Host ID:
  
 ^  Class  ^  Mask  ^  CIDR notation  ^ ^  Class  ^  Mask  ^  CIDR notation  ^
Ligne 202: Ligne 201:
 |  Network address  |   192     168    10  |  0  | |  Network address  |   192     168    10  |  0  |
  
-Since the network address is identical in both cases, the sending host assumes that the destination host is on its network and sends the packets directly to the network without addressing its default gateway.+Since the network address is identical in both cases, the sending host assumes that the destination host is on its network and sends the packets directly to the network.
  
 The sending host is now trying to communicate with a host with an IP address of 192.168.2.1. It therefore performs the same calculation by applying **its own subnet mask** to the IP address of the destination host: The sending host is now trying to communicate with a host with an IP address of 192.168.2.1. It therefore performs the same calculation by applying **its own subnet mask** to the IP address of the destination host:
Ligne 214: Ligne 213:
 |  Network address  |   192     168    2  |  0  | |  Network address  |   192     168    2  |  0  |
  
-In this case, the sending host finds that the destination network 192.168.2.0 is not identical to its own network 192.168.10.0. It therefore addresses the packets to the default gateway.+In this case, the sending host finds that the destination network 192.168.2.0 is not identical to its own network 192.168.10.0. It therefore sends the packets to the default gateway.
  
 ==== VLSM ==== ==== VLSM ====
Ligne 567: Ligne 566:
   2001:0db8:0000:0010:0000:0000:0000:0001   2001:0db8:0000:0010:0000:0000:0000:0001
  
-To make it easier to write IPv6 addresses, it is not necessary to write zeros at the head of a group separated by a colon. However, at least one hexadecimal digit must be written in each group separated by a colon:+To make it easier to write IPv6 addresses, it is not necessary to write zeros at the start of a group separated by a colon. However, at least one hexadecimal digit must be written in each group separated by a colon:
  
   2001:db8:0:10:0:0:0:1   2001:db8:0:10:0:0:0:1
Ligne 576: Ligne 575:
  
   * Remove leading zeros in a group.   * Remove leading zeros in a group.
-  * Use : : to shorten as much as possible.+  * Use : : to shorten the address as much as possible.
   * If an address contains two consecutive groups of zeros of the same length, it is preferable to shorten the leftmost groups of zeros to : : and the rightmost groups to :0 : for each group.   * If an address contains two consecutive groups of zeros of the same length, it is preferable to shorten the leftmost groups of zeros to : : and the rightmost groups to :0 : for each group.
   * Although permitted, do not use :: to shorten a group of zeros. Instead, use :0 : and keep : : for consecutive groups of zeros.   * Although permitted, do not use :: to shorten a group of zeros. Instead, use :0 : and keep : : for consecutive groups of zeros.
Ligne 592: Ligne 591:
  
   * The network prefix,   * The network prefix,
-  * The prefix identifies the subnet.+    * The prefix identifies the subnet.
   * The interface identifier,    * The interface identifier, 
-  * Two network interfaces on the same subnet cannot have the same identifier, +    * Two network interfaces on the same subnet cannot have the same identifier, 
-  * An interface identifier identifies a particular interface on the subnet.+    * An interface identifier identifies a particular interface on the subnet.
  
 ====Subnet Masks==== ====Subnet Masks====
Ligne 672: Ligne 671:
 RHEL 9 uses **Network Manager** to manage the network. Network Manager has two components: RHEL 9 uses **Network Manager** to manage the network. Network Manager has two components:
  
-* a service that manages network connections and reports their status, +  * a service that manages network connections and reports their status, 
-* front-ends that use an API to configure the service.+  * front-ends that use an API to configure the service.
  
 <WRAP center round important 60%> <WRAP center round important 60%>
Ligne 710: Ligne 709:
 The **nmcli** (Network Manager Command Line Interface) command is used to configure NetworkManager. The **nmcli** (Network Manager Command Line Interface) command is used to configure NetworkManager.
  
-Command line switches and sub-commands can be accessed using the following commands:+Command line switches and sub-commands can be viewed using the following command:
  
 <code> <code>
Ligne 754: Ligne 753:
 </code> </code>
  
-Create fixed IP profile attached to the **ens18** device:+Now create another IP profile attached to the **ens18** device:
  
 <code> <code>
-[root@redhat9 ~]# nmcli connection add con-name ip_fixe ifname ens18 type ethernet ip4 10.0.2.102/24 gw4 10.0.2.1 +[root@redhat9 ~]# nmcli connection add con-name ip_fixed ifname ens18 type ethernet ip4 10.0.2.102/24 gw4 10.0.2.1 
-Connection 'ip_fixe' (b3d51921-4deb-4975-ad52-f31993b2af0c) successfully added.+Connection 'ip_fixed' (b3d51921-4deb-4975-ad52-f31993b2af0c) successfully added.
 </code> </code>
  
Ligne 768: Ligne 767:
 ens18    ea4c8254-6236-3130-8323-8b3f71d807a1  ethernet  ens18   ens18    ea4c8254-6236-3130-8323-8b3f71d807a1  ethernet  ens18  
 lo       8df82174-1d45-4506-9248-6bfcd2d20240  loopback  lo      lo       8df82174-1d45-4506-9248-6bfcd2d20240  loopback  lo     
-ip_fixe  b3d51921-4deb-4975-ad52-f31993b2af0c  ethernet  --   +ip_fixed b3d51921-4deb-4975-ad52-f31993b2af0c  ethernet  --   
 </code> </code>
  
-Note that the output does not indicate that the **ip_fix** profile is associated with the **ens18** device because the **ip_fix** profile is not enabled:+Note that the output does not indicate that the **ip_fixed** profile is associated with the **ens18** device because the **ip_fixed** profile is not enabled:
  
 <code> <code>
Ligne 806: Ligne 805:
 </code> </code>
  
-To activate the ip_fix profile, use the following command :+To activate the ip_fixed profile, use the following command :
  
 <code> <code>
-[root@redhat9 ~]# nmcli connection up ip_fixe+[root@redhat9 ~]# nmcli connection up ip_fixed
  
 </code> </code>
Ligne 819: Ligne 818:
 </WRAP> </WRAP>
  
-The ip_fix profile is now enabled while the ens18 profile has been disabled:+The ip_fixed profile is now enabled while the ens18 profile has been disabled:
  
 <code> <code>
 [root@redhat9 ~]# nmcli c show [root@redhat9 ~]# nmcli c show
 NAME     UUID                                  TYPE      DEVICE  NAME     UUID                                  TYPE      DEVICE 
-ip_fixe  b3d51921-4deb-4975-ad52-f31993b2af0c  ethernet  ens18  +ip_fixed b3d51921-4deb-4975-ad52-f31993b2af0c  ethernet  ens18  
 lo       8df82174-1d45-4506-9248-6bfcd2d20240  loopback  lo      lo       8df82174-1d45-4506-9248-6bfcd2d20240  loopback  lo     
 ens18    ea4c8254-6236-3130-8323-8b3f71d807a1  ethernet  --   ens18    ea4c8254-6236-3130-8323-8b3f71d807a1  ethernet  --  
Ligne 834: Ligne 833:
 GENERAL.MTU:                            1500 GENERAL.MTU:                            1500
 GENERAL.STATE:                          100 (connected) GENERAL.STATE:                          100 (connected)
-GENERAL.CONNECTION:                     ip_fixe+GENERAL.CONNECTION:                     ip_fixed
 GENERAL.CON-PATH:                       /org/freedesktop/NetworkManager/ActiveConnection/3 GENERAL.CON-PATH:                       /org/freedesktop/NetworkManager/ActiveConnection/3
 WIRED-PROPERTIES.CARRIER:               on WIRED-PROPERTIES.CARRIER:               on
Ligne 921: Ligne 920:
 [q] [q]
 </code> </code>
-Similarly, to view the **ip_fixe** profile parameters, use the following command:+Similarly, to view the **ip_fixed** profile parameters, use the following command:
  
 <code> <code>
-[root@redhat9 ~]# nmcli -p connection show ip_fixe+[root@redhat9 ~]# nmcli -p connection show ip_fixed
 =============================================================================== ===============================================================================
-                     Connection profile details (ip_fixe)+                     Connection profile details (ip_fixed)
 =============================================================================== ===============================================================================
-connection.id:                          ip_fixe+connection.id:                          ip_fixed
 connection.uuid:                        b3d51921-4deb-4975-ad52-f31993b2af0c connection.uuid:                        b3d51921-4deb-4975-ad52-f31993b2af0c
 connection.stable-id:                   -- connection.stable-id:                   --
Ligne 990: Ligne 989:
 CONNECTIONS.AVAILABLE-CONNECTION-PATHS: /org/freedesktop/NetworkManager/Settings/1,/org/freedesktop/NetworkManager/Settings/3 CONNECTIONS.AVAILABLE-CONNECTION-PATHS: /org/freedesktop/NetworkManager/Settings/1,/org/freedesktop/NetworkManager/Settings/3
 CONNECTIONS.AVAILABLE-CONNECTIONS[1]:   ea4c8254-6236-3130-8323-8b3f71d807a1 | ens18 CONNECTIONS.AVAILABLE-CONNECTIONS[1]:   ea4c8254-6236-3130-8323-8b3f71d807a1 | ens18
-CONNECTIONS.AVAILABLE-CONNECTIONS[2]:   b3d51921-4deb-4975-ad52-f31993b2af0c | ip_fixe+CONNECTIONS.AVAILABLE-CONNECTIONS[2]:   b3d51921-4deb-4975-ad52-f31993b2af0c | ip_fixed
 </code> </code>
  
Ligne 999: Ligne 998:
 total 8 total 8
 -rw-------. 1 root root 253 Oct 19  2023 ens18.nmconnection -rw-------. 1 root root 253 Oct 19  2023 ens18.nmconnection
--rw-------. 1 root root 218 Sep 29 12:21 ip_fixe.nmconnection+-rw-------. 1 root root 218 Sep 29 12:21 ip_fixed.nmconnection
 </code> </code>
  
 ====1.2 - Name resolution==== ====1.2 - Name resolution====
  
-A study of the **/etc/NetworkManager/system-connections/ip_fixe.nmconnection** file shows that there are no directives concerning DNS :+A study of the **/etc/NetworkManager/system-connections/ip_fixed.nmconnection** file shows that there are no directives concerning DNS :
  
 <code> <code>
-[root@redhat9 ~]# cat /etc/NetworkManager/system-connections/ip_fixe.nmconnection +[root@redhat9 ~]# cat /etc/NetworkManager/system-connections/ip_fixed.nmconnection 
 [connection] [connection]
-id=ip_fixe+id=ip_fixed
 uuid=b3d51921-4deb-4975-ad52-f31993b2af0c uuid=b3d51921-4deb-4975-ad52-f31993b2af0c
 type=ethernet type=ethernet
Ligne 1034: Ligne 1033:
 </code> </code>
  
-Modify the configuration of the **ip_fixe** profile:+Modify the configuration of the **ip_fixed** profile:
  
 <code> <code>
-[root@redhat9 ~]# nmcli connection mod ip_fix ipv4.dns 8.8.8.8+[root@redhat9 ~]# nmcli connection mod ip_fixed ipv4.dns 8.8.8.8
 </code> </code>
  
-A look at the **/etc/NetworkManager/system-connections/ip_fixe.nmconnection** file shows that the DNS server directive has been added:+A look at the **/etc/NetworkManager/system-connections/ip_fixed.nmconnection** file shows that the DNS server directive has been added:
  
 <code> <code>
-[root@redhat9 ~]# cat /etc/NetworkManager/system-connections/ip_fixe.nmconnection +[root@redhat9 ~]# cat /etc/NetworkManager/system-connections/ip_fixed.nmconnection 
 [connection] [connection]
-id=ip_fixe+id=ip_fixed
 uuid=b3d51921-4deb-4975-ad52-f31993b2af0c uuid=b3d51921-4deb-4975-ad52-f31993b2af0c
 type=ethernet type=ethernet
Ligne 1105: Ligne 1104:
 Lastly, check the name resolution: Lastly, check the name resolution:
  
 +<code>
 [root@redhat9 ~]# ping www.free.fr [root@redhat9 ~]# ping www.free.fr
 PING www.free.fr (212.27.48.10) 56(84) bytes of data. PING www.free.fr (212.27.48.10) 56(84) bytes of data.
Ligne 1125: Ligne 1125:
  
 <code> <code>
-[root@redhat9 ~]# nmcli connection mod ip_fix +ipv4.addresses 192.168.1.2/24+[root@redhat9 ~]# nmcli connection mod ip_fixed +ipv4.addresses 192.168.1.2/24
 </code> </code>
  
Ligne 1131: Ligne 1131:
  
 <code> <code>
-[root@redhat9 ~]# nmcli con up ip_fixe+[root@redhat9 ~]# nmcli con up ip_fixed
 Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/3) Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/3)
 </code> </code>
Ligne 1138: Ligne 1138:
  
 <code> <code>
-[root@redhat9 ~]# nmcli connection show ip_fixe +[root@redhat9 ~]# nmcli connection show ip_fixed 
-connection.id:                          ip_fixe+connection.id:                          ip_fixed
 connection.uuid:                        b3d51921-4deb-4975-ad52-f31993b2af0c connection.uuid:                        b3d51921-4deb-4975-ad52-f31993b2af0c
 connection.stable-id:                   -- connection.stable-id:                   --
Ligne 1247: Ligne 1247:
 proxy.pac-url:                          -- proxy.pac-url:                          --
 proxy.pac-script:                       -- proxy.pac-script:                       --
-GENERAL.NAME:                           ip_fixe+GENERAL.NAME:                           ip_fixed
 GENERAL.UUID:                           b3d51921-4deb-4975-ad52-f31993b2af0c GENERAL.UUID:                           b3d51921-4deb-4975-ad52-f31993b2af0c
 GENERAL.DEVICES:                        ens18 GENERAL.DEVICES:                        ens18
Ligne 1273: Ligne 1273:
 [q] [q]
 </code> </code>
 +
 <WRAP center round important 60%> <WRAP center round important 60%>
 **Important** : Note the addition of the secondary address to the **ipv4.addresses: ** and the addition of the **IP4.ADDRESS[2]:** line. **Important** : Note the addition of the secondary address to the **ipv4.addresses: ** and the addition of the **IP4.ADDRESS[2]:** line.
 </WRAP> </WRAP>
  
-Now look at the contents of the **/etc/NetworkManager/system-connections/ip_fix.nmconnection** file:+Now look at the contents of the **/etc/NetworkManager/system-connections/ip_fixed.nmconnection** file:
  
 <code> <code>
-[root@redhat9 ~]# cat /etc/NetworkManager/system-connections/ip_fixe.nmconnection +[root@redhat9 ~]# cat /etc/NetworkManager/system-connections/ip_fixed.nmconnection 
 [connection] [connection]
-id=ip_fixe+id=ip_fixed
 uuid=b3d51921-4deb-4975-ad52-f31993b2af0c uuid=b3d51921-4deb-4975-ad52-f31993b2af0c
 type=ethernet type=ethernet
Ligne 1583: Ligne 1584:
 ====2.3 - traceroute==== ====2.3 - traceroute====
  
-The ping command is the basis of the **traceroute** command. This command is used to find out the route taken to access a given site:+The ping command is the basis of the **traceroute** command. This command is used to find out the route taken to reach a given host:
  
 <code> <code>
Ligne 2130: Ligne 2131:
   * The **keys**   * The **keys**
     * **Asymmetric** and persistent user key pairs which ensure a user's identity and which are stored on the hard disk,     * **Asymmetric** and persistent user key pairs which ensure a user's identity and which are stored on the hard disk,
-    * **Asymmetric and persistent** host key guaranteeing the identity of the server and stored on hard disk.+    * **Asymmetric and persistent** host key guaranteeing the identity of the server and stored on the hard disk.
     * **Temporary asymmetric server key** used by the SSH1 protocol to encrypt the session key,     * **Temporary asymmetric server key** used by the SSH1 protocol to encrypt the session key,
     * **Symmetric session key** which is generated at random and is used to encrypt the communication between the client and the server. It is destroyed at the end of the session. SSH-1 uses a single key, while SSH-2 uses one key for each direction of communication,     * **Symmetric session key** which is generated at random and is used to encrypt the communication between the client and the server. It is destroyed at the end of the session. SSH-1 uses a single key, while SSH-2 uses one key for each direction of communication,
Ligne 2175: Ligne 2176:
  
   * Using **asymmetric keys**,   * Using **asymmetric keys**,
-    * Identical to SSH-1 except with the DSA algorithm, 
   * **%%RhostsRSA%%**,   * **%%RhostsRSA%%**,
   * Using a **password**.   * Using a **password**.
Ligne 2212: Ligne 2212:
    * The **client** sends the server an asymmetric key authentication request containing the key module to be used,    * The **client** sends the server an asymmetric key authentication request containing the key module to be used,
    * The **server** looks for a match for this module in the **~/.ssh/authorized_keys** authorised keys file,    * The **server** looks for a match for this module in the **~/.ssh/authorized_keys** authorised keys file,
-   * If no match is found, the server terminates communication, +     * If no match is found, the server terminates communication, 
-   * If a match is not found, the server generates a 256-bit random string called a **challenge** and encrypts it with the client's **public key**,+     * If a match is found, the server generates a 256-bit random string called a **challenge** and encrypts it with the client's **public key**,
    * The **client** receives the challenge and decrypts it using the private part of its key. It combines the challenge with the session identifier and encrypts the result. It then sends the encrypted result to the server.    * The **client** receives the challenge and decrypts it using the private part of its key. It combines the challenge with the session identifier and encrypts the result. It then sends the encrypted result to the server.
    * The **server** generates the same hash and compares it with the one received from the client. If the two hashes are identical, authentication is successful.    * The **server** generates the same hash and compares it with the one received from the client. If the two hashes are identical, authentication is successful.
Ligne 2432: Ligne 2432:
 Sep 29 14:06:49 redhat9.ittraining.loc systemd[1]: Started OpenSSH server daemon. Sep 29 14:06:49 redhat9.ittraining.loc systemd[1]: Started OpenSSH server daemon.
 </code> </code>
- 
  
 Put the **trainee** user in the **adm** group: Put the **trainee** user in the **adm** group:
Ligne 2548: Ligne 2547:
 </code> </code>
  
-Generated public keys have the **.pub** extension. Private keys do not have a :+Generated public keys have the **.pub** extension. Private keys do not have a file extension:
  
 <code> <code>
Ligne 2556: Ligne 2555:
 </code> </code>
  
-Then restart the sshd service:+Now restart the sshd service:
  
 <code> <code>
Ligne 2693: Ligne 2692:
 ===SSH Tunnels=== ===SSH Tunnels===
  
-The SSH protocol can be used to secure protocols such as telnet, pop3 and so on. In fact, you can create an SSH //tunnel// through which unsecured protocol communications pass.+The SSH protocol can be used to secure protocols such as telnet, pop3 and so on. You can create an SSH //tunnel// through which unsecured protocol communications pass.
  
 The command to create an ssh tunnel takes the following form: The command to create an ssh tunnel takes the following form:
Menu