Bookmark this page

Guided Exercise: Analyze and Manage Remote Servers

Enable and access the web console on a server to manage it and to diagnose and resolve issues.

Outcomes

  • Use the web console to monitor system features, inspect log files, create user accounts, and access the terminal.

As the student user on the workstation machine, use the lab command to prepare your system for this exercise.

This command prepares your environment and ensures that all required resources are available.

[student@workstation ~]$ lab start support-cockpit

Instructions

  1. Log in to the servera machine as the student user.

    [student@workstation ~]$ ssh student@servera
    [student@servera ~]$
  2. The web console is already installed on the system, but it is not active. Enable and start the cockpit service.

    1. Enable the web console service.

      [student@servera ~]$ sudo systemctl enable --now cockpit.socket
      [sudo] password for student: student
      Created symlink /etc/systemd/system/sockets.target.wants/cockpit.socket -> /usr/lib/systemd/system/cockpit.socket.
  3. On the workstation machine, open the Firefox web browser and log in to the web console interface at servera.lab.example.com. Log in as the student user.

    1. Open the browser and navigate to https://servera.lab.example.com:9090.

    2. Accept the self-signed certificate by adding it as an exception.

    3. Log in as the student user, with student as the password.

      You are now logged in to the web console as a normal user, with minimal privileges.

  4. Verify your current authorization within the web console interface.

    1. Click the Terminal button on the left navigation bar to access the terminal.

      A terminal session opens where the student user is already logged in. Verify that command execution works in the embedded terminal.

      [student@servera ~]$ id
      uid=1000(student) gid=1000(student) groups=1000(student),10(wheel) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
    2. Click the Accounts button on the left navigation bar to manage users.

      The Create new account button does not appear, because you are logged in with limited access.

    3. Click the Student User link.

      On the student user's account details page, you can only set a new password or add an authorized SSH public key.

  5. Escalate privileges in the web console.

    1. Click the Limited access button to switch to administrative access. Use student as the student user password and click the Authenticate button. The web console replaces the Limited access button by the Administrative access button.

  6. To investigate system statistics, click Overview on the left navigation bar and the View metrics and history button on the Usage section.

    This page displays various operating system statistics, such as current load, disk usage, disk I/O, and network traffic.

  7. To inspect system logs, click the Logs button on the left navigation bar.

    This page displays the systemd system logs. Use the buttons in the upper-left corner to modify how the web console displays the log entries based on date and the priority of the logs.

    1. Click the Priority list and choose Debug and above.

    2. Based on the current day of the month, click any log entry from the list. A log entry detail page opens with additional information about the event, such as the hostname, the SELinux context, or the PID number of the process that the entry corresponds to.

  8. Add a second IP address to an existing network interface device.

    1. Click the Networking button on the left navigation bar.

      This page displays details of the current network configuration for servera, as well as real-time network statistics, firewall configuration, and log entries about networking.

    2. Scroll down to the Interfaces section and click the row for the eth0 network interface.

      A details page displays real-time network statistics, as well as the current configuration for that network interface.

    3. Click the edit link in the IPv4 section.

      An IPv4 settings window opens, where you can change the network interface configuration.

    4. In the IPv4 settings window, click the + button next to the Manual list.

    5. In the Address text box, enter 172.25.250.99 as the second IP address.

    6. In the Prefix length or Netmask text box, enter 24 as the netmask value.

    7. Click Save to apply new network configuration.

      The new configuration is applied immediately in the web console. The new IP address is visible in the IPv4 line.

  9. Create a user account.

    1. Click the Accounts button on the left navigation bar. The web console now shows the Create new account button, because you have administrative rights.

    2. Click the Create new account button.

    3. In the Create new account window, add the following details:

      Field Value
      Full Name manager1
      User Name manager1
      Password redh@t!23
      Confirm redh@t!23
    4. Click Create.

  10. Access a terminal session within the web console to add the manager1 user to the wheel group.

    1. Click the Terminal button on the left navigation bar.

    2. Use the id manager1 command to view the group membership of the manager1 user.

      [student@servera ~]$ id manager1
      uid=1002(manager1) gid=1002(manager1) groups=1002(manager1)
    3. Use the sudo usermod -aG wheel manager1 command to add the manager1 user to the wheel group.

      [student@servera ~]$ sudo usermod -aG wheel manager1
      [sudo] password for student: student
    4. Use the id manager1 command again to verify that the manager1 user is a member of the wheel group.

      [student@servera ~]$ id manager1
      uid=1002(manager1) gid=1002(manager1) groups=1002(manager1),10(wheel)
  11. Enable and start the Kernel process accounting service (psacct).

    1. Click the Services button on the left navigation bar.

    2. Search for the psacct service. Click the service link. A details page displays the service status as disabled.

    3. Click the Start and Enable button next to the service name.

    4. The service is now enabled and started.

  12. Log off from the web console interface.

  13. Return to the workstation system as the student user.

    [student@servera ~]$ exit
    [student@workstation ~]$

Finish

On the workstation machine, change to the student user home directory and use the lab command to complete this exercise. This step is important to ensure that resources from previous exercises do not impact upcoming exercises.

[student@workstation ~]$ lab finish support-cockpit

Revision: rh124-9.3-770cc61