SSH Terminal and VNC Screen
An application of a portal can open a terminal (SSH) or a remote screen (VNC) on a machine behind the gateway asset, right in the browser. It works like the remote desktop (RDP) application, with the differences below.
In short
Add an application with an ssh://host or vnc://host upstream to a
portal that is already served. SSH checks the target's host key, signs in
with a password, a key or a short-lived certificate, and transfers files
over SFTP. VNC has no identity to check and no file transfer, so use it
only on the same network segment as the gateway asset.
RDP, SSH and VNC compared
| RDP | SSH | VNC | |
|---|---|---|---|
| Upstream | rdp://host |
ssh://host |
vnc://host |
| Default port | 3389 | 22 | 5900, or 5900 plus the display number (display :1 is vnc://host:5901) |
| Settings group in the editor | Remote desktop (RDP) | Terminal (SSH) | Remote screen (VNC) |
| Sign-in the application can store | Username, Domain, Password | Username, Password, or Private key with Key passphrase, or a short-lived certificate | Password; a Username only for a server that asks for one, such as Apple's Screen Sharing |
| Identity check of the target | Certificate fingerprints, or trust on first use | Host keys, or trust on first use | None: a VNC server has no identity to verify, and most do not encrypt the session |
| File transfer | Drive named XplicitTrust in the session | SFTP into the account's home directory; guacctl --download <file> |
None |
| Recording | Yes | Yes, and a searchable transcript | Yes |
| Needs a current agent | Yes | Yes | An agent version that supports VNC |
All three are described in Remote desktop settings; recordings in Sessions and recording.
Before you start
You need the same as for a remote desktop: a portal that is served, a current agent on its gateway asset that can download guacd, and a path from the gateway asset to the target.
-
SSH: the gateway asset reaches the target's SSH port, 22. Check on the gateway asset:
timeout 3 bash -c '</dev/tcp/192.168.1.31/22' && echo reachable -
VNC: the gateway asset reaches the VNC port, 5900 or 5900 plus the display number:
timeout 3 bash -c '</dev/tcp/192.168.1.32/5900' && echo reachableA VNC server cannot prove its identity, and most do not encrypt the session. Use VNC only where the gateway asset sits in the same network segment as the target; see VNC targets. The gateway asset needs an agent version that supports VNC; saving a VNC application for an older one is refused.
Publish a terminal (SSH)
- Open the portal, choose Edit and, on the Applications tab, Add
application. Use the upstream
ssh://192.168.1.31, for example under the path prefix/terminal, and the trust levelidentityortunnel. - The application shows the Terminal (SSH) settings. To sign in with a key, paste the private key into Private key and enter its Key passphrase; the key is checked when you save. To store nothing at all, use a short-lived certificate; see SSH certificates. Without a stored account, the page asks for the Linux username and password.
- Save, and make sure a policy grants the portal.
- Open
https://<hostname>/terminal/, sign in at your identity provider, and the terminal opens in the browser. -
Pin the host key. The portal's detail page shows the server's host key under Remote desktop targets. Compare it on the server with the key of the same type, usually ECDSA:
ssh-keygen -lf /etc/ssh/ssh_host_ecdsa_key.pubThe
SHA256:…value must be the one the detail page shows. If it is, choose Pin. See Target identity. -
With File upload and File download on, files go over SFTP into the account's home directory;
guacctl --download <file>in the terminal sends a file to the browser.
Publish a remote screen (VNC)
- Add an application with the upstream
vnc://192.168.1.32, for example under the path prefix/panel, and the trust levelidentityortunnel. - The application shows the Remote screen (VNC) settings. Store the VNC password; leave Username empty unless the server asks for one, as Apple's Screen Sharing does. Without a stored password, the page asks for whatever the VNC server wants once the connection is up.
- Save, and make sure a policy grants the portal.
- Open
https://<hostname>/panel/. There is no key to compare. The portal's detail page shows the security types the server offers instead; when it shows a warning fornone, set a password on the server. - VNC has no file transfer.
Verify
Open the application as a user the policy grants. The terminal or screen opens
in the browser tab. Close the tab, and look in the event log for
web_app_desktop_session_started and web_app_desktop_session_ended, which
name the user, the target and the account. A session of an SSH application that
signs in with a certificate also carries ssh_certificate_id.
If it doesn't work
| What you see | Where to look |
|---|---|
| The session ends with The connection failed. | The gateway asset cannot reach the target, or the target refused the account. With a certificate: check TrustedUserCAKeys on the target. |
| The agent of the gateway asset does not support VNC applications yet; update it. | Update the agent. |
| Reachable, and lets anyone in without a password (VNC) | Set a password on the VNC server. |
| Anything else | Portal messages and troubleshooting |
Next
- Remote maintenance by an outside vendor
- Record the sessions; an SSH recording also gets a text transcript. See Sessions and recording.
- Sign in with short-lived certificates instead of stored passwords or keys: SSH certificates.
See also
- Concept: Agentless Access
- Guide: Publish a remote desktop
- Reference: Remote desktop settings, Using a portal