Sick Gaming
Fedora - Cockpit and the evolution of the Web User Interface - Printable Version

+- Sick Gaming (https://www.sickgaming.net)
+-- Forum: Computers (https://www.sickgaming.net/forum-86.html)
+--- Forum: Linux, FreeBSD, and Unix types (https://www.sickgaming.net/forum-88.html)
+--- Thread: Fedora - Cockpit and the evolution of the Web User Interface (/thread-91860.html)



Fedora - Cockpit and the evolution of the Web User Interface - xSicKxBot - 09-08-2019

Cockpit and the evolution of the Web User Interface

<div style="margin: 5px 5% 10px 5%;"><img src="https://www.sickgaming.net/blog/wp-content/uploads/2019/08/cockpit-and-the-evolution-of-the-web-user-interface.png" width="1027" height="670" title="" alt="" /></div><div><p>Over 3 years ago the Fedora Magazine published an article entitled <a href="https://fedoramagazine.org/cockpit-overview/">Cockpit: an overview</a>. Since then, the interface has see some eye-catching changes. Today’s Cockpit is cleaner and the larger fonts makes better use of screen real-estate.</p>
<p>This article will go over some of the changes made to the UI. It will also explore some of the general tools available in the web interface to simplify those monotonous sysadmin tasks.</p>
<h2>Cockpit installation</h2>
<p>Cockpit can be installed using the <strong>dnf install cockpit</strong> command. This provides a minimal setup providing the basic tools required to use the interface.</p>
<p>Another option is to install the Headless Management group. This will install additional packages used to extend the usability of Cockpit. It includes extensions for NetworkManager, software packages, disk, and SELinux management.</p>
<p>Run the following commands to enable the web service on boot and open the firewall port:</p>
<pre class="wp-block-preformatted">$ <strong>sudo systemctl enable --now cockpit.socket</strong>
Created symlink /etc/systemd/system/sockets.target.wants/cockpit.socket -&gt; /usr/lib/systemd/system/cockpit.socket $ <strong>sudo firewall-cmd --permanent --add-service cockpit</strong>
success
$ <strong>sudo firewall-cmd --reload</strong>
success</pre>
<h2>Logging into the web interface</h2>
<p>To access the web interface, open your favourite browser and enter the server’s domain name or IP in the address bar followed by the service port (9090). Because Cockpit uses HTTPS, the installation will create a self-signed certificate to encrypt passwords and other sensitive data. You can safely accept this certificate, or request a CA certificate from your sysadmin or a trusted source.</p>
<p>Once the certificate is accepted, the new and improved login screen will appear. Long-time users will notice the username and password fields have been moved to the top. In addition, the white background behind the credential fields immediately grabs the user’s attention.</p>
<figure class="wp-block-image"><img src="https://www.sickgaming.net/blog/wp-content/uploads/2019/08/cockpit-and-the-evolution-of-the-web-user-interface.png" alt="" class="wp-image-29139" /></figure>
<p>A feature added to the login screen since the previous article is logging in with <strong>sudo</strong> privileges — if your account is a member of the wheel group. Check the box beside <em>Reuse my password for privileged tasks</em> to elevate your rights.</p>
<p>Another edition to the login screen is the option to connect to remote servers also running the Cockpit web service. Click <em>Other Options</em> and enter the host name or IP address of the remote machine to manage it from your local browser.</p>
<h2>Home view</h2>
<p>Right off the bat we get a basic overview of common system information. This includes the make and model of the machine, the operating system, if the system is up-to-date, and more.</p>
<figure class="wp-block-image"><img src="https://www.sickgaming.net/blog/wp-content/uploads/2019/08/cockpit-and-the-evolution-of-the-web-user-interface-31.png" alt="" class="wp-image-29137" /></figure>
<p>Clicking the make/model of the system displays hardware information such as the BIOS/Firmware. It also includes details about the components as seen with <strong>lspci</strong>.</p>
<figure class="wp-block-image"><img src="https://www.sickgaming.net/blog/wp-content/uploads/2019/08/cockpit-and-the-evolution-of-the-web-user-interface.gif" alt="" class="wp-image-29138" /></figure>
<p>Clicking on any of the options to the right will display the details of that device. For example, the <em>% of CPU cores</em> option reveals details on how much is used by the user and the kernel. In addition, the <em>Memory &amp; Swap</em> graph displays how much of the system’s memory is used, how much is cached, and how much of the swap partition active. The <em>Disk I/O</em> and <em>Network Traffic</em> graphs are linked to the Storage and Networking sections of Cockpit. These topics will be revisited in an upcoming article that explores the system tools in detail.</p>
<h3>Secure Shell Keys and authentication</h3>
<p>Because security is a key factor for sysadmins, Cockpit now has the option to view the machine’s MD5 and SHA256 key fingerprints. Clicking the <strong>Show fingerprints</strong> options reveals the server’s ECDSA, ED25519, and RSA fingerprint keys.</p>
<figure class="wp-block-image"><img src="https://www.sickgaming.net/blog/wp-content/uploads/2019/08/cockpit-and-the-evolution-of-the-web-user-interface-32.png" alt="" class="wp-image-29136" /></figure>
<p>You can also add your own keys by clicking on your username in the top-right corner and selecting <strong>Authentication</strong>. Click on <strong>Add keys</strong> to validate the machine on other systems. You can also revoke your privileges in the Cockpit web service by clicking on the <strong>X</strong> button to the right.</p>
<figure class="wp-block-image"><img src="https://www.sickgaming.net/blog/wp-content/uploads/2019/08/cockpit-and-the-evolution-of-the-web-user-interface-33.png" alt="" class="wp-image-29135" /></figure>
<h3>Changing the host name and joining a domain</h3>
<p>Changing the host name is a one-click solution from the home page. Click the host name currently displayed, and enter the new name in the <em>Change Host Name</em> box. One of the latest features is the option to provide a <em>Pretty name</em>.</p>
<p>Another feature added to Cockpit is the ability to connect to a directory server. Click <em>Join a domain</em> and a pop-up will appear requesting the domain address or name, organization unit (optional), and the domain admin’s credentials. The Domain Membership group provides all the packages required to join an LDAP server including FreeIPA, and the popular Active Directory.</p>
<p>To opt-out, click on the domain name followed by <em>Leave Domain</em>. A warning will appear explaining the changes that will occur once the system is no longer on the domain. To confirm click the red <em>Leave Domain</em> button.</p>
<figure class="wp-block-image"><img src="https://www.sickgaming.net/blog/wp-content/uploads/2019/08/cockpit-and-the-evolution-of-the-web-user-interface-17.gif" alt="" class="wp-image-29134" /></figure>
<h3>Configuring NTP and system date and time</h3>
<p>Using the command-line and editing config files definitely takes the cake when it comes to maximum tweaking. However, there are times when something more straightforward would suffice. With Cockpit, you have the option to set the system’s date and time manually or automatically using NTP. Once synchronized, the information icon on the right turns from red to blue. The icon will disappear if you manually set the date and time.</p>
<p>To change the timezone, type the continent and a list of cities will populate beneath.</p>
<figure class="wp-block-image"><img src="https://www.sickgaming.net/blog/wp-content/uploads/2019/08/cockpit-and-the-evolution-of-the-web-user-interface-34.png" alt="" class="wp-image-29133" /></figure>
<h3>Shutting down and restarting</h3>
<p>You can easily shutdown and restart the server right from home screen in Cockpit. You can also delay the shutdown/reboot and send a message to warn users.</p>
<figure class="wp-block-image"><img src="https://www.sickgaming.net/blog/wp-content/uploads/2019/08/cockpit-and-the-evolution-of-the-web-user-interface-18.gif" alt="" class="wp-image-29132" /></figure>
<h3>Configuring the performance profile</h3>
<p>If the <em>tuned</em> and <em>tuned-utils</em> packages are installed, performance profiles can be changed from the main screen. By default it is set to a recommended profile. However, if the purpose of the server requires more performance, we can change the profile from Cockpit to suit those needs.</p>
<figure class="wp-block-image"><img src="https://www.sickgaming.net/blog/wp-content/uploads/2019/08/cockpit-and-the-evolution-of-the-web-user-interface-19.gif" alt="" class="wp-image-29131" /></figure>
<h2>Terminal web console</h2>
<p>A Linux sysadmin’s toolbox would be useless without access to a terminal. This allows admins to fine-tune the server beyond what’s available in Cockpit. With the addition of themes, admins can quickly adjust the text and background colours to suit their preference. </p>
<p>Also, if you type <strong>exit</strong> by mistake, click the <em>Reset</em> button in the top-right corner<em>. </em>This will provide a fresh screen with a flashing cursor.</p>
<figure class="wp-block-image"><img src="https://www.sickgaming.net/blog/wp-content/uploads/2019/08/cockpit-and-the-evolution-of-the-web-user-interface-20.gif" alt="" class="wp-image-29130" /></figure>
<h2>Adding a remote server and the Dashboard overlay</h2>
<p>The Headless Management group includes the Dashboard module (<strong>cockpit-dashboard</strong>). This provides an overview the of the CPU, memory, network, and disk performance in a real-time graph. Remote servers can also be added and managed through the same interface.</p>
<p>For example, to add a remote computer in Dashboard, click the <strong>+</strong> button. Enter the name or IP address of the server and select the colour of your choice. This helps to differentiate the stats of the servers in the graph. To switch between servers, click on the host name (as seen in the screen-cast below). To remove a server from the list, click the check-mark icon, then click the red trash icon. The example below demonstrates how Cockpit manages a remote machine named <em>server02.local.lan</em>. </p>
<figure class="wp-block-image"><img src="https://www.sickgaming.net/blog/wp-content/uploads/2019/08/cockpit-and-the-evolution-of-the-web-user-interface-21.gif" alt="" class="wp-image-29129" /></figure>
<h2>Documentation and finding help</h2>
<p>As always, the <em>man</em> pages are a great place to find documentation. A simple search in the command-line results with pages pertaining to different aspects of using and configuring the web service.</p>
<pre class="wp-block-preformatted">$ <strong>man -k cockpit</strong>
cockpit (1) - Cockpit
cockpit-bridge (1) - Cockpit Host Bridge
cockpit-desktop (1) - Cockpit Desktop integration
cockpit-ws (8) - Cockpit web service
cockpit.conf (5) - Cockpit configuration file</pre>
<p>The Fedora repository also has a package called <strong>cockpit-doc</strong>. The package’s description explains it best:</p>
<blockquote class="wp-block-quote">
<p>The Cockpit Deployment and Developer Guide shows sysadmins how to deploy Cockpit on their machines as well as helps developers who want to embed or extend Cockpit.</p>
</blockquote>
<p>For more documentation visit <a href="https://cockpit-project.org/external/source/HACKING">https://cockpit-project.org/external/source/HACKING</a> </p>
<h2>Conclusion</h2>
<p>This article only touches upon some of the main functions available in Cockpit. Managing storage devices, networking, user account, and software control will be covered in an upcoming article. In addition, optional extensions such as the 389 directory service, and the <em>cockpit-ostree</em> module used to handle packages in Fedora Silverblue.</p>
<p>The options continue to grow as more users adopt Cockpit. The interface is ideal for admins who want a light-weight interface to control their server(s).</p>
<p>What do you think about Cockpit? Share your experience and ideas in the comments below.</p>
</div>


https://www.sickgaming.net/blog/2019/08/16/cockpit-and-the-evolution-of-the-web-user-interface/