[LINUX] Easy verification series on Katacoda "Installing and using Cockpit"

In this article, I will explain how to easily try "Cockpit", which is software for managing Linux with GUI, on a learning service called "Katacoda".

Target audience of this article People who don't have a Linux environment at hand but want to try Cockpit

What is Cockpit A UI tool that allows you to monitor Linux single and multiple systems through a web browser. There are many types of functions used to monitor Linux, and the CLI is often used to see the details.

https://cockpit-project.org/running.html image.png

This time, we are focusing on the procedure to easily implement the same function on Katacoda, so please check separately what you can do with Cockpit and how to use it.

What is Katacoda? Currently, it is a free learning demo environment for open source software provided by O'Reilly. You can also access major Linux distributions and recently popular Docker, Kubernetes, Ansible, etc. from your browser to learn. ![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/680306/fa154f20-9394-4f34-68e4-c0a67f76146c.png)

Flow to access Cockpit on Katacoda 1. Create an account and log in to use Linux with Katacoda (free of charge) 2. Rent a CentOS environment and change the root password to any password 3. Install the package "Cockpit" 4. Start "Cockpit" in CentOS 5. Use a browser to access CentOS and log in

1. Create an account and log in to use Linux with Katacoda (free) Go to [Katacoda](https://www.katacoda.com/) and create an account. (Upper right in the figure) ![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/680306/d85c7294-1429-f270-9dd2-13214b45f665.png)

2. Rent a CentOS environment and change the root password to any password On the top page of [Katacoda](https://www.katacoda.com/), the menu of available lab environments is displayed as an icon. Since we will be using CentOS this time, select "Linux & Operating Systems". ![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/680306/8e7e4a28-0383-be21-2c55-28f5b8ef7b69.png)

Select "Learn CentOS" in the middle. image.png

Select "Playground" on the left. image.png

On the next page, click "Start" and the CLI screen will appear as shown below. First, set the root administrator password here.

passwd 

image.png The warning is due to the use of weak security strings. This time it's for learning purposes, so you can set a temporary one that is easy for you to understand.

3. Install package "cockpit" Then install "cockpit" with the yum command.
yum install cockpit (User manually approves Yes response to installation)
Or
yum -y install cokpit (Automatically responds Yes to the installation)

image.png

The installation was completed in a few seconds. image.png

4. Start "cockpit" in CentOS ``` #Start cockpit service(Automatic startup is also implemented when the system starts) systemctl start --now cockpit

#Check the startup status of the cockpit service systemctl status cockpit

 Active was confirmed in green letters. Cockpit is now working.
 ![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/680306/daefc4ca-8411-8d29-d84a-0e2accde9b84.png)

 Originally, it is also necessary to open the firewall port here. For Cockpit, TCP 9090 must be Open.
 However, since firewalld is not running in the Katakoda environment, it is possible to use Cockpit without setting it.
 If you want to check the procedure for opening the firewall port, refer to the [Cokpit](https://cockpit-project.org/running.html) page for the firewall port opening command for each distribution. Please give me.

 <H2> 5. Use a browser to access CentOS and log in </ H2>
 There is a "+" icon at the top of the CLI screen in Katacoda.
 Click here to display a menu that allows you to access the Linux.
 ![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/680306/dc351cc0-b105-5aaf-2837-487e7858309f.png)

 Select the third "Select port to view on Host 1" from the top.
 ![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/680306/0fa404ab-ed67-1a88-6b12-f5a57c73b138.png)

 Enter the default port number 9090 used by Cockpit in the port specification field below, and then click "Display Port".
 ![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/680306/61172eb0-0c99-6790-1107-a54b305f10e9.png)

 I was able to start Cockpit on the browser.
 Enter the following information to log in. (User name root / password value set earlier)
 ![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/680306/5176f191-e9e1-078e-8bc7-8a6e1879bad0.png)


 After logging in, you can check the information about the Linux OS graphically as follows.
 Performance charts Graphs also move in real time, which is interesting.
 ![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/680306/eefe34a8-d567-e173-c6cd-a1fa71bd0191.png)

 <H2> Bonus: Log collection is also possible on katacoda </ H2>

#Install Sosreport(Be sure to carry out because it is not installed on CentOS on Katacoda environment) yum install sos

 After performing the above work, you can get the log from the log collection tab.
 ![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/680306/387a41f0-4b73-63c6-d895-b403df04d6ee.png)
 I was able to get the file in tar.xz format from CentOS in Katacoda. Of course, it can be decompressed.
 ![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/680306/1a1996bf-4e46-c915-2146-87b94478d172.png)


Recommended Posts

Easy verification series on Katacoda "Installing and using Cockpit"
Notes on installing Python3 and using pip on Windows7
About installing Pwntools and Python2 series
Notes on using post-receive and post-merge
Notes on installing Python using PyEnv
Easy and easy IoT life using Micropython!
Easy introduction of python3 series and OpenCV3
Difference between using and import on shield language
[Note] Installing Python 3.6 + α on Windows and RHEL
Installing TensorFlow on Windows Easy for Python beginners