How To Install and Use Cockpit Web Console in Centos 8
Tags: cockpit, centos8, redhat, linux
Published: 2022-09-28 17:33:55

##**What Is Cockpit?**
The Cockpit is a Web Console with an easy to use web based interface that enables you to managing and monitoring on your server.
You can use the cockpit to monitor system logs and view system performance graphs.in addition, you can also configure settings directly in the web console or through the terminal.

##**Installing Cockpit in Centos 8**
In this RHEL 8 installation, the Cockpit Web Console is not yet installed, therefore you must first install it using the following command (you can use yum or dnf, but this time I will install it using yum):

```
sudo yum install cockpit
```
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/csk3krll5eqnjlr38283.png)

type letter **y** then press **Enter**,and wait for the installation process to finish.

After the Cockpit Web Console has finished installing, run the command to start, enable and check the status of the cockpit service with the following few command lines:
 
  

```
 sudo systemctl start cockpit.socket
 sudo systemctl enable --now cockpit.socket

```
To check the status run the following command:
```
sudo systemctl status cockpit.socket
sudo ps auxf|grep cockpit
```

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/n3h55h1wnak31xjet337.png)So If you are running a firewalld on the system, you need to open the cockpit port **9090** in the firewall.

Open the Cockpit service in Firewall Server by running the following few command lines:
  
```
sudo firewall-cmd --add-service=cockpit --permanent
sudo firewall-cmd --reload
```

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/188phl9wfsgofr2crmau.png)

**Login to the Cockpit Web Console**
open the **Cockpit** web console in your web browser at the following URL's:

   **Local**:
   https://localhost:9090

   **Server's hostname**:
   https://example.com:9090

   **Server's IP Address**:
   https://192.168.12.128:9090

 To access the Cockpit Web Console in Red Hat 8, you can access using a Browser such as Firefox or Chrome with a url https://localhost:9090 or https://IP_ADDRESS_SERVER:9090 if you access it from the Client.
 Since the url uses https, you'll see a security warning in your browser, but that's fine and can be continued.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c1y4t1unisxfc0vlbec2.jpg)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gawx0kslp50d9nt2ywa9.jpg)
After you see the login display like this, you can enter your Red Hat linux username and password
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kcobrnq3a2jg4nnsp0gx.png)
Click on Login
The Web Console will display the username on the right side of the title bar.but if you are logged in as the root user then the **Privileged** icon will be displayed to the left of the username.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xck74gh0xird6m3jrgt5.png)but if you are logged in as a regular user(a user who does not have privileged) the privileged icon is not displayed.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u8c5sgw51g3mxxjzr8mi.png)

## Change Password
Privileged users and regular users can change passwords when logging in to the Web Console.click accounts on the navigation bar.click your account bar to see more.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3z3lbyoepfi4ath7muuv.png)if you are a non-privileged user, you will be limited to resetting passwords and managing public SSH keys. To reset your password, click Set Password.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/39cn2gk5u491zs4hv1oc.png)Type your information in the Old Password, New Password, and Confirm New Password fields. Click Set to change the password.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qitetbybpssj3tu1odij.png)

##Get to Know the Features of the Web Console Feature and its Uses##

**1. Overview**
Click **Overview** on the navigation bar to view information about the system, such as its type of hardware, operating system, host name, and more.if you are logged in as a regular user, you will see all the information but you cannot change anything.here is the overview page image
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vx3bf3cmzcgyjip5qzkw.png)

**2. Logs**
**Logs** in the navigation bar provides access to analysis tools for the system logs. You can use the menus on the page to filter log messages based on a logging date range, severity level, or both.
The web console uses the current date and you can also specify any vulnerable date. Similarly, the **Severity** menu provides the option to view the severity conditions of a system such a **Warning and above,Debug and above** and so on.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jbo5hwtxuj69v88do6e1.png)

**3. Terminal**
this **Terminal** serves to execute commands for managing and working with the system and for performing tasks that are not supported by other tools provided by the cockpit of the Web Console.
The following figure shows an example of a common command used to collect additional information. Listing the contents of the /var/log directory provides a reminder of log files that may have valuable information. The **id** command is a command to view like uid,gid,and member group. The **ps au** command gives a view of the processes running in the terminal and the user.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dg752vm242ix3myf7pbz.png)
**4. Services**
this service system serves to start, enable, disable and stop services with graphical tools in the Web Console. to access on the first page of the Cockpit Web Console Click **Services** on the navigation bar. To manage the service, click **System Services** at the top of the service start page.
In the example below, select the chronyd.service line to open your service management page.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/v5925s7plid900obsdlq.png)**Click Stop, Restart, or Disallow running (mask)** as appropriate to manage the service.In this view the service is already running.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nfhwh5amdta1x5fobsyv.png)
**5. Network and Firewall**
To manage firewall rules and network interfaces, click **Network** on the navigation bar. the following is an example of how to collect information about network interfaces.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0fwwqymxm4frfj0jhbry.png)Click the desired **Interface** name to access the management page. In this example, the eth0 interface is selected.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gefri29it373i8dauy2a.png)The top part of the management page displays network traffic activity for the selected device. Scroll down to view configuration settings and management options.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/v140qk9on78852ho0016.png)To modify or add configuration options to an interface, click the highlighted links for the desired configuration. In this example, the **IPv4** link shows a single IP address and netmask, 172.25.250.10/24 for the eth0 network interface. To add an additional IP address to the eth0 network interface, click the highlighted link.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qghiynpo2094567zv36s.png)Click + on the right side of the ** Manual** list selection to add an additional IP address. Enter an IP address and network mask in the appropriate fields.click **Apply** to activate the new settings.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/738mb5dt9g2mx9o3hkpn.png)The display automatically switches back to the interface's management page where you can confirm the new IP address.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8w0agl6qt9v9q92ckpqn.png)
##Create New Account##
if you are a privileged user, you can create a new user account in the Web Console.click **Accounts** on the navigation bar to view existing accounts.click **Create New Account** to open the account management page.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k4nu52ec7ictz28t7bum.png)type the information for the new account, then click **Create.**
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/52e2fea6vfrllmd6inpe.png)the view will automatically switch back to the account management page where you can confirm the new user account.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5wtr03u1d7aztlqitzg2.png)
##Conclusion
The Cockpit is an easy to use web console especially for those who are not able to use the CLI that allows you to perform administrative tasks on CentOs servers.