In this exercise, you 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
Log in to the servera machine as the student user.
[student@workstation ~]$ ssh student@servera
[student@servera ~]$The web console is already installed on the system, but it is not active.
Enable and start the cockpit service.
Enable the web console service.
[student@servera ~]$sudo systemctl enable --now cockpit.socket[sudo] password for student:studentCreated symlink /etc/systemd/system/sockets.target.wants/cockpit.socket -> /usr/lib/systemd/system/cockpit.socket.
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.
Open the browser and navigate to https://servera.lab.example.com:9090.
Accept the self-signed certificate by adding it as an exception.
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.
Verify your current authorization within the web console interface.
Click the 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.c1023Click the button on the left navigation bar to manage users.
The button does not appear, because you are logged in with limited access.
Click the link.
On the student user's account details page, you can only set a new password or add an authorized SSH public key.
Escalate privileges in the web console.
Click the button to switch to administrative access.
Use student as the student user password and click the button.
The web console replaces the button by the button.
To investigate system statistics, click on the left navigation bar and the button on the section.
This page displays various operating system statistics, such as current load, disk usage, disk I/O, and network traffic.
To inspect system logs, click the 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.
Click the list and choose .
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.
Add a second IP address to an existing network interface device.
Click the 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.
Scroll down to the 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.
Click the link in the section.
An window opens, where you can change the network interface configuration.
In the window, click the button next to the list.
In the text box, enter 172.25.250.99 as the second IP address.
In the text box, enter 24 as the netmask value.
Click to save the new network configuration.
The new configuration is applied immediately in the web console. The new IP address is visible in the line.
Create a user account.
Click the button on the left navigation bar. The web console now shows the button, because you have administrative rights.
Click the button.
In the window, add the following details:
| Field | Value |
|---|---|
| Full Name |
manager1
|
| User Name |
manager1
|
| Password |
redh@t!23
|
| Confirm |
redh@t!23
|
Click .
Access a terminal session within the web console to add the manager1 user to the wheel group.
Click the button on the left navigation bar.
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)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
Use the id manager1 command again to verify that the manager1 user is a member of the wheel group.
[student@servera ~]$id manager1uid=1002(manager1) gid=1002(manager1) groups=1002(manager1),10(wheel)
Enable and start the Kernel process accounting service (psacct).
Click the button on the left navigation bar.
Search for the service. Click the service link. A details page displays the service status as disabled.
Click the button next to the service name.
The service is now enabled and started.
Log off from the web console interface.
Return to the workstation system as the student user.
[student@servera ~]$ exit
[student@workstation ~]$This concludes the section.