Main:Cockpit Client

Jump to: navigation, search
Cockpit Client as an alternative to the Webserver, SSH instead of HTTPS

Cockpit Client

To manage a system through Cockpit usually requires to run a webserver on the to be managed machine and the admin connects through HTTPS with their browser. There's another way of connecting to Cockpit through SSH and without the webserver up and running all the time. This is the Cockpit Client.

It is available through Flathub but the client is a simple shell script and part of the cockpit-ws package which needs to be installed on the admin's computer. Instead of the target host the webserver will be started locally along with a browser and connects through SSH to the cockpit-bridge on the target machine.

Requirements

Package cockpit-ws needs to be installed on the admin's computer. Relevant cockpit modules need to be installed on the target host, at least cockpit-bridge and cockpit-system must be present. SSH needs to be available and ideally you have distributed SSH keys.

How to use it?

Open a console on your machine and start the client to login as a regular user with something like

user $ /usr/lib/cockpit-desktop / myuser@remotehost >/dev/null 2>&1

(myuser@remotehost) Password:

Enter the remote user's password.

Or login as root user

user $ /usr/lib/cockpit-desktop / root@remotehost >/dev/null 2>&1

Enter passphrase for key '/home/myuser/.ssh/id_rsa':

Enter the key passphrase.

Note that many recent Linux installations such as Tumbleweed wouldn't allow password based root login so you'd need to add the user's SSH key to root's authorized_keys first. The >/dev/null 2>&1 redirect is kind of ugly but the client is very chatty and floods the console so without you may easily miss the password/passphrase entry.

The cockpit-client then fires up a browser along with a local webserver to give you the usual user experience while the actual remote connection is through SSH. How cool is that?

Tip: you can configure which browser to use by setting the $BROWSER variable before.

See also

Related articles

External links