Cockpit is a powerful web-based GUI that makes managing your Linux servers considerably easier. With this tool, you can run upgrades, check logs, start/stop services, manage container deployments and more.
SEE: 40+ open source and Linux terms you need to know (TechRepublic Premium)
Another feature of Cockpit that makes it even more useful is the ability to link multiple hosts together so you can manage them from one convenient location. Of course, every host you add must have Cockpit installed and running, but this makes it far more efficient to administer those servers from a single location.
I’ll walk you through the process of adding Cockpit-enabled servers to your main host to help make your admin life a bit easier.
What you’ll need
To make this work, you’ll need at least two servers that have Cockpit installed and running. If you’re working with Rocky Linux, AlmaLInux, or RHEL, Cockpit will come pre-installed. The only thing you might have to do is enable the service with the command:
sudo systemctl enable --now cockpit.socket
Once you have it enabled on the machines you want to add, head over to the main server and log into Cockpit.
How to add a server to Cockpit
After logging into Cockpit, click the drop-down in the upper left corner next to the USERNAME@HOSTNAME listing (Figure A—Where USERNAME is the user you’ve logged in with and HOSTNAME is the hostname of the server).
I’m going to add a new host running Rocky Linux. Click Add New Host and then, when prompted (Figure B) type the IP address of the new server and then add the username (one that has privileges enough to use Cockpit).
You can also change the default color for the host. Click Add and then, when prompted (Figure C), click Accept Key and Connect.
If you’re really paranoid, you can always verify the key by logging into the machine to be added and issuing the command:
ssh-keyscan -t ecdsa-sha2-nistp256 localhost|ssh-keygen -lf -
If the key presented in the terminal window matches the key you see in the Cockpit window, it’s safe to continue. You will then be prompted to type the user password for the remote host (Figure D).
If you’d prefer, you can create an SSH key for automatic login. To do this, check the box for Automatic login and then, in the resulting window (Figure E), type and confirm a password for the SSH key.
Once the server has been added, you’ll see it in the list of available servers by clicking the same drop-down used for adding the server (Figure F).
Click the server you want to manage and get to work.
That’s how easy it is to add remote servers to the Cockpit system manager. If you have multiple Linux servers that you manage with Cockpit, consider this a must-do.
Subscribe to TechRepublic’s How To Make Tech Work on YouTube for all the latest tech advice for business pros from Jack Wallen.