How to manage Linux machine using Web Console - The Tech Influences

1

In today's post we will tell you how we access our Linux system with the help of web console


We do this because RedHat is a CLI based operating system and there are some things we don't understand so we use the web console


How to manage Linux machine using Web Console


To access through web console you need to follow some steps mentioned below


Here you have to install some packages first and then enable the services

[root@redhat-1 ~]# [root@redhat-1 ~]# sudo dnf install cockpit

Updating Subscription Management repositories. This system is registered with an entitlement server, but is not receiving updates. You can use subscription-manager to assign subscriptions. Red Hat Enterprise Linux 9 for x86_64 - BaseOS (RPMs) 2.2 kB/s | 4.1 kB 00:01 Red Hat Enterprise Linux 9 for x86_64 - BaseOS (RPMs) 848 kB/s | 13 MB 00:15 Red Hat Enterprise Linux 9 for x86_64 - AppStream (RPMs) 3.1 kB/s | 4.5 kB 00:01 Red Hat Enterprise Linux 9 for x86_64 - AppStream (RPMs) 1.0 MB/s | 22 MB 00:22 Last metadata expiration check: 0:00:02 ago on Saturday 08 July 2023 01:55:25 AM. Package cockpit-276.1-1.el9.x86_64 is already installed. Dependencies resolved. ======================================================================================================================================================== Package Architecture Version Repository Size ======================================================================================================================================================== Upgrading: cockpit x86_64 286.1-1.el9 rhel-9-for-x86_64-baseos-rpms 44 k Transaction Summary ======================================================================================================================================================== Upgrade 1 Package Total download size: 44 k Is this ok [y/N]: y Downloading Packages: cockpit-286.1-1.el9.x86_64.rpm 43 kB/s | 44 kB 00:01 -------------------------------------------------------------------------------------------------------------------------------------------------------- Total 42 kB/s | 44 kB 00:01 Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Preparing : 1/1 Upgrading : cockpit-286.1-1.el9.x86_64 1/2 Cleanup : cockpit-276.1-1.el9.x86_64 2/2 Running scriptlet: cockpit-276.1-1.el9.x86_64 2/2 Verifying : cockpit-286.1-1.el9.x86_64 1/2 Verifying : cockpit-276.1-1.el9.x86_64 2/2 Installed products updated. Upgraded: cockpit-286.1-1.el9.x86_64 Complete!
Here you can see that your Cockpit package has been successfully installed

If you want to check whether cockpit package is already installed in your system then you can check with this command
[root@redhat-1 ~]# rpm -qa | grep cockpit
cockpit-bridge-276.1-1.el9.x86_64
cockpit-system-276.1-1.el9.noarch
cockpit-storaged-276.1-1.el9.noarch
subscription-manager-cockpit-4-1.el9.noarch
cockpit-packagekit-276.1-1.el9.noarch
cockpit-ws-276.1-1.el9.x86_64
cockpit-podman-53-1.el9.noarch
cockpit-286.1-1.el9.x86_64
[root@redhat-1 ~]#
Once Cockpit package installed successfully, you can start, enable and verify the service and running process using the following commands.
[root@redhat-1 ~]# systemctl start cockpit.socket
[root@redhat-1 ~]# systemctl enable cockpit.socket
Created symlink /etc/systemd/system/sockets.target.wants/cockpit.socket → /usr/lib/systemd/system/cockpit.socket.
[root@redhat-1 ~]#
Your Cockpit Package has been start and enabled successfully.

If you want to see the status of your cockpit package whether your service is started or not then you can see with this command.
[root@redhat-1 ~]# systemctl status cockpit.socket
● cockpit.socket - Cockpit Web Service Socket
     Loaded: loaded (/usr/lib/systemd/system/cockpit.socket; enabled; vendor preset: disabled)
     Active: active (listening) since Sat 2023-07-08 02:08:24 IST; 4min 57s ago
      Until: Sat 2023-07-08 02:08:24 IST; 4min 57s ago
   Triggers: ● cockpit.service
       Docs: man:cockpit-ws(8)
     Listen: [::]:9090 (Stream)
      Tasks: 0 (limit: 10756)
     Memory: 1.0M
        CPU: 19ms
     CGroup: /system.slice/cockpit.socket

Jul 08 02:08:24 redhat-1 systemd[1]: Starting Cockpit Web Service Socket...
Jul 08 02:08:24 redhat-1 systemd[1]: Listening on Cockpit Web Service Socket.
[root@redhat-1 ~]#
To access Cockpit web console, you need to allow the services in the firewall.
[root@redhat-1 ~]# firewall-cmd --add-service cockpit
Warning: ALREADY_ENABLED: 'cockpit' already in 'public'
success
[root@redhat-1 ~]# firewall-cmd --add-service cockpit --perm
Warning: ALREADY_ENABLED: cockpit
success
[root@redhat-1 ~]#
Now by default, Cockpit accepts connection on port TCP port 9090. use the ss command to view open port:
[root@redhat-1 ~]# sudo ss -tulpn | grep :9090
tcp   LISTEN 0      4096               *:9090             *:*    users:(("systemd",pid=1,fd=287))
[root@redhat-1 ~]#
Now open your browser and type IP address and port number of your Linux Machine something like this.
192.168.199.107:9090
Now the login page of Redhat will come, here you have to enter your user id and password of Linux machine.

After login, you can see here there is an option of all the services which you can easily manage.

Now if you want to disable its services then you can do it with the help of this command
[root@redhat-1 ~]# systemctl stop cockpit.socket
[root@redhat-1 ~]# systemctl disable cockpit.socket
Removed "/etc/systemd/system/sockets.target.wants/cockpit.socket".
[root@redhat-1 ~]#
Note:- Now you can access this web console services from anywhere on the same network but you have to access this web console services from another network then you can access using public IP, and port forwarding has to be enabled from the router.


If you have any problem in this or do not understand, then you can contact me.

Post a Comment

1Comments
Post a Comment