Chapter 5. Managing remote systems in the web console
You can connect to remote systems and manage them in the Red Hat Enterprise Linux web console, enabling you to monitor and administer systems across your network from a single central interface.
For security reasons, use the following network setup of remote systems managed by the web console:
- Configure one system as a bastion host. The bastion host is a system with an opened HTTPS port.
- All other systems communicate through SSH.
With the web interface running on the bastion host, you can reach all other systems through the SSH protocol.
5.1. Connecting to a remote host using SSH from the web console login page Copy linkLink copied to clipboard!
You can connect to a remote system by using the SSH protocol directly from the login page of the RHEL web console. After you log in remotely, connection traffic is encrypted, and you can manage the remote system in the graphical interface of the web console.
Prerequisites
You have installed the RHEL 10 web console.
For instructions, see Installing and enabling the web console.
-
The
cockpit-systempackage is installed on the remote system. -
The
sshdservice runs on the remote system, and the corresponding port is allowed in the firewall.
Procedure
- Open the web console login page.
- Specify the username on the remote host in the User name field.
- Click Other options to reveal the Connect to text field.
Specify the remote host you want to connect to using SSH in the Connect to text field. If you do not specify any port, the web console attempts to connect to port 22 on the specified remote host.
- Click Log in.
5.2. Adding remote hosts to the web console Copy linkLink copied to clipboard!
When logged in to the RHEL web console, you can switch between the local system and multiple remote hosts through the host switcher in the top left corner of the Overview page. You can connect to and manage a remote system after you add its credentials to the host switcher.
Prerequisites
You have installed the RHEL 10 web console.
For instructions, see Installing and enabling the web console.
Procedure
-
In your terminal, open or create the
cockpit.conffile in the/etc/cockpit/directory in a text editor of your preference. Add the following text:
[WebService] AllowMultiHost=yesWarningThe host switcher is deprecated and disabled by default. Due to web technology limitations, this feature cannot be secure. Do not enable the host switcher if you connect to untrusted hosts because all connected systems can make arbitrary changes to the rest of the connected. As a more secure alternative, you can either use the web console login page with the secure limit of one host in a web browser session or the Cockpit Client Flatpak.
- Save the file.
Restart the web console to ensure the changes take effect.
# systemctl try-restart cockpitIn the RHEL web console, click
<username>@<hostname>in the top left corner of the Overview page.
- In the drop-down menu, click .
- In the Add new host dialog box, specify the host you want to add.
Optional: Add the username for the account you want to connect to.
You can use any user account of the remote system. However, if you use the credentials of a user account without administration privileges, you cannot perform administration tasks.
If you use the same credentials as on your local system, the web console authenticates remote systems automatically every time you log in.
ImportantThe web console does not save passwords used to log in to remote systems.
- Optional: Click the Color field to change the color of the system.
- Click .
Verification
-
The new host is listed in the
<username>@<hostname>drop-down menu.
5.3. Enabling SSH login for a new host Copy linkLink copied to clipboard!
You can enable secure SSH login for a new remote host that uses key-based authentication in the RHEL web console.
If you already have an SSH key on your system, the web console uses the existing one; otherwise, it can create a key.
Prerequisites
You have installed the RHEL 10 web console.
For instructions, see Installing and enabling the web console.
You considered security risks and enabled the host switcher.
See Adding remote hosts to the web console for more information.
Procedure
- Log in to the RHEL 10 web console.
In the RHEL web console, click
<username>@<hostname>in the top left corner of the Overview page.
- In the drop-down menu, click .
- In the Add new host dialog box, specify the host you want to add. If you connect to the host for the first time, you must click in the following dialog box.
The password dialog box differs depending on the existence of an SSH key file on the host:
- If you already have the SSH key for the host, select the Authorize SSH key option.
- If you do not have the SSH key, select the Create a new SSH key and authorize it option. The web console creates the key.
- Add and confirm a password for the SSH key.
- Click .
Verification
- Log out.
- Log back in.
- Click in the Not connected to host screen.
- Select SSH key as your authentication option.
- Enter your key password.
- Click .
5.4. Configuring smart-card authentication for SSH logins in the web console Copy linkLink copied to clipboard!
After logging in to a user account on the RHEL web console, you can connect to remote machines by using the SSH protocol. You can use the constrained delegation feature to use SSH without being asked to authenticate again.
In the example procedure, the web console session runs on the myhost.idm.example.com host, and you configure the console to access the remote.idm.example.com host by using SSH on behalf of the authenticated user.
Prerequisites
-
You have obtained an IdM
adminticket-granting ticket (TGT) onmyhost.idm.example.com. -
You have
rootaccess toremote.idm.example.com. - The host that runs the web console is a member of an IdM domain.
Procedure
In the Terminal page, verify that the web console has created a Service for User to Proxy (S4U2proxy) Kerberos ticket in the user session:
$ klist … Valid starting Expires Service principal 05/20/25 09:19:06 05/21/25 09:19:06 HTTP/myhost.idm.example.com@IDM.EXAMPLE.COM …Create a list of the target hosts that the delegation rule can access:
Create a service delegation target:
$ ipa servicedelegationtarget-add cockpit-targetAdd the target host to the delegation target:
$ ipa servicedelegationtarget-add-member cockpit-target \ --principals=host/remote.idm.example.com@IDM.EXAMPLE.COM
Allow
cockpitsessions to access the target host list by creating a service delegation rule and adding the HTTP service Kerberos principal to it:Create a service delegation rule:
$ ipa servicedelegationrule-add cockpit-delegationAdd the web console client to the delegation rule:
$ ipa servicedelegationrule-add-member cockpit-delegation \ --principals=HTTP/myhost.idm.example.com@IDM.EXAMPLE.COMAdd the delegation target to the delegation rule:
$ ipa servicedelegationrule-add-target cockpit-delegation \ --servicedelegationtargets=cockpit-target
Enable Kerberos authentication on the
remote.idm.example.comhost:-
Connect through SSH to
remote.idm.example.comasroot. -
Add the
GSSAPIAuthentication yesline to the/etc/ssh/sshd_configfile.
-
Connect through SSH to
Restart the
sshdservice onremote.idm.example.comso that the changes take effect immediately:$ systemctl try-restart sshd.service
5.5. Using Ansible to configure smart-card authentication for SSH logins in the web console Copy linkLink copied to clipboard!
After logging in to a user account on the RHEL web console, you can connect to remote machines by using the SSH protocol. You can use the servicedelegationrule and servicedelegationtarget Ansible modules to configure the web console for the constrained delegation feature, which enables SSH connections without being asked to authenticate again.
In the example procedure, the web console session runs on the myhost.idm.example.com host and you configure it to access the remote.idm.example.com host by using SSH on behalf of the authenticated user.
Prerequisites
-
You have obtained an IdM
adminticket-granting ticket (TGT) onmyhost.idm.example.com. -
You have
rootaccess toremote.idm.example.com. - The host that runs the web console is a member of an IdM domain.
You have configured your Ansible control node to meet the following requirements:
-
You have installed the
ansible-freeipapackage. -
The example assumes you have created an Ansible inventory file with the fully-qualified domain name (FQDN) of the IdM server in the
~/MyPlaybooks/directory. The example assumes that the
secret.ymlAnsible vault stores the admin password in theipaadmin_passwordvariable.See the
/usr/share/doc/ansible-freeipa/playbooks/servicedelegationtargetand/usr/share/doc/ansible-freeipa/playbooks/servicedelegationruledirectories for example playbooks and theREADME-servicedelegationrule.mdandREADME-servicedelegationtarget.mdfiles in the/usr/share/doc/ansible-freeipa/directory for more information.
-
You have installed the
-
The target node, that is the node on which the
ansible-freeipamodule runs, is part of the IdM domain as an IdM client, server, or replica.
Procedure
Navigate to your
~/MyPlaybooks/directory:$ cd ~/MyPlaybooks/Store your sensitive variables in an encrypted file:
Create the vault:
$ ansible-vault create secret.yml New Vault password: <vault_password> Confirm New Vault password: <vault_password>After the
ansible-vault createcommand opens an editor, enter the sensitive data in the<key>: <value>format:ipaadmin_password: <admin_password>- Save the changes, and close the editor. Ansible encrypts the data in the vault.
In the Terminal page, verify that the web console has created a Service for User to Proxy (S4U2proxy) Kerberos ticket in the user session:
$ klist … Valid starting Expires Service principal 05/20/25 09:19:06 05/21/25 09:19:06 HTTP/myhost.idm.example.com@IDM.EXAMPLE.COM …Create a
web-console-smart-card-ssh.ymlplaybook with the following content:Create a task that ensures the presence of a delegation target:
--- - name: Playbook to create a constrained delegation target hosts: ipaserver vars_files: - /home/user_name/MyPlaybooks/secret.yml tasks: - name: Ensure servicedelegationtarget web-console-delegation-target is present ipaservicedelegationtarget: ipaadmin_password: "{{ ipaadmin_password }}" name: web-console-delegation-targetAdd a task that adds the target host to the delegation target:
- name: Ensure servicedelegationtarget web-console-delegation-target member principal host/remote.idm.example.com@IDM.EXAMPLE.COM is present ipaservicedelegationtarget: ipaadmin_password: "{{ ipaadmin_password }}" name: web-console-delegation-target principal: host/remote.idm.example.com@IDM.EXAMPLE.COM action: memberAdd a task that ensures the presence of a delegation rule:
- name: Ensure servicedelegationrule delegation-rule is present ipaservicedelegationrule: ipaadmin_password: "{{ ipaadmin_password }}" name: web-console-delegation-ruleAdd a task that ensures that the Kerberos principal of the web console client service is a member of the constrained delegation rule:
- name: Ensure the Kerberos principal of the web console client service is added to the servicedelegationrule web-console-delegation-rule ipaservicedelegationrule: ipaadmin_password: "{{ ipaadmin_password }}" name: web-console-delegation-rule principal: HTTP/myhost.idm.example.com action: memberAdd a task that ensures that the constrained delegation rule is associated with the web-console-delegation-target delegation target:
- name: Ensure a constrained delegation rule is associated with a specific delegation target ipaservicedelegationrule: ipaadmin_password: "{{ ipaadmin_password }}" name: web-console-delegation-rule target: web-console-delegation-target action: memberAdd a task that enable Kerberos authentication on
remote.idm.example.com:- name: Enable Kerberos authentication hosts: remote.idm.example.com vars: sshd_config: GSSAPIAuthentication: true roles: - role: rhel-system-roles.sshd
- Save the file.
Run the Ansible playbook. Specify the playbook file, the file storing the password protecting the
secret.ymlfile, and the inventory file:$ ansible-playbook --vault-password-file=password_file -v -i inventory web-console-smart-card-ssh.yml