DOCUMENTATION

TCP tunnels

Give a vendor or a colleague one TCP service inside your network (Redis, Oracle, a management console, an SMB share) through a plain ssh -L port forward on Captivo's jump host, with no VPN. The session is never recorded, and this page says exactly what is logged instead.

What a TCP tunnel is, and when to use it

A TCP tunnel resource points at one host:port that your connector can reach. The user runs an ssh -L command from the portal; ssh listens on a port of the user's own computer, and every connection the user's own application makes to that port travels through Captivo's SSH jump host and the connector to the service. The application then talks its own protocol, signs in the way it always does, and Captivo carries the bytes without looking inside.

Use a TCP tunnel forUse something else for
The long tail: Oracle, a vendor's own client talking to a licence server, a switch or storage web console on :8443, a Redis you want to reach from a desktop tool, an SMB share, a Kubernetes API for a tool that cannot use the kubeconfig flow.A shell or desktop that should be recorded: see Own RDP and SSH apps. PostgreSQL, MySQL, SQL Server, Redis or MongoDB with a query log: see Database access. A cluster with request logging: see Kubernetes.
A tunnel is the one resource type where Captivo cannot show what happened inside the session. Use it when the audit trail of who, when, how long and how much is enough, and prefer a recorded type whenever the service has one.

Define a tunnel resource

Open Infrastructure → Resources, add a resource and choose the TCP tunnel type (tag TCP). The type card is greyed out while the workspace's gateway capability is off. The form has these fields:

FieldWhat to enterExample
Resource nameWhat people see in My access (up to 48 characters).Cache (Redis)
ConnectorThe connector, or connector group, that can reach the service. A group is used for failover; only members that run a recent enough version carry the tunnel. See Connectors.hq-connector
Internal addressThe service as host:port, as the connector sees it. The port is required: a tunnel carries exactly one service. For an IPv6 literal the form wraps the host in brackets.10.0.0.2:6379
DescriptionOptional, up to 120 characters, shown in the portal.Redis cache, vendor Acme support only
  • There is no credential to save and no public address: the form says users reach it through an ssh port forward on Captivo's jump host. Your application signs in to the service itself, so keep the service's own accounts tight.
  • The Session rules step shows a fixed Not recorded row instead of the recording switches. On a tunnel there is no Record sessions, keystroke, watermark, clipboard or file transfer setting, because none of them can apply.
  • Two red warnings can appear in that step: the Policy page requires recording (see below), or the connector runs a version older than 2.39.0 (update it first).
  • Then give people access the usual way, with a grant (see Vendor access and Resources). Without an active grant the resource shows no working Connect button.

How a vendor opens the tunnel

  1. Sign in to the portal and, in My access, click Connect on the tunnel resource. A dialog titled Tunnel to <name> opens.
  2. Optionally change Port on your computer. By default it is the service's own port, or the service port plus 10000 when that port is below 1024 (so 445 becomes 10445, because only an administrator may listen on ports below 1024). The browser remembers your choice per resource.
  3. Copy the command and run it in a terminal within two minutes. The dialog counts the time down; after that it offers Get a new command.
  4. Leave that window open. Point the application at localhost:<port on your computer>, exactly as the dialog's last line says.
  5. To finish, press Ctrl+C (or Ctrl+D) in the window, or close it. That ends the tunnel and every connection through it.

The command the dialog shows has this shape (the 12-character code in front of the @ is the short-lived ticket; the jump host is your console's address, port 2222):

bash
ssh -L 6379:10.0.0.2:6379 -o ExitOnForwardFailure=yes -p 2222 k7Qm2xP9aB4c@acme.cloud.captivo.io

Read it left to right: -L 6379:10.0.0.2:6379 is "listen on local port 6379, forward to 10.0.0.2:6379"; ExitOnForwardFailure=yes makes ssh stop at once if the local port is taken instead of sitting open and forwarding nothing; -p 2222 is left out when the jump host listens on 22. The first time, ssh asks whether to trust the jump host; the dialog prints its fingerprint to compare. Do not edit the host and port after -L: the jump host sends every connection to the resource's own service whatever the command asks for, so an edited command reaches nothing else. Remote forwards (-R) are refused.

On Cloud the jump host is your workspace address (for example acme.cloud.captivo.io) on port 2222. On your own server the jump host is the SSH listener of the data plane: it is set with SSH_ADDR, and the host and port shown in the command come from SSH_PUBLIC_HOST and SSH_PUBLIC_PORT (default: the console's host and 2222). Make sure that port is reachable from your users; the dialog says so when tunnels are not set up on the service.

Worked examples

A Redis cache from a desktop tool

Resource Cache (Redis), internal address 10.0.0.2:6379. The vendor runs the portal's command, then:

bash
# terminal 1: the tunnel (leave it open)
ssh -L 6379:10.0.0.2:6379 -o ExitOnForwardFailure=yes -p 2222 k7Qm2xP9aB4c@acme.cloud.captivo.io

# terminal 2: the vendor's own tool, pointed at the local end
redis-cli -h 127.0.0.1 -p 6379 -a "$REDIS_PASSWORD" ping

A management console on 8443

Resource Storage array console, internal address san01.corp.example:8443. The command forwards to the service name, which the connector resolves on your network:

bash
ssh -L 8443:san01.corp.example:8443 -o ExitOnForwardFailure=yes -p 2222 Xt3nR8wQ5vLz@acme.cloud.captivo.io
# then browse to https://localhost:8443 (the console's certificate name will not match localhost)

A file share on port 445, with a chosen local port

Resource Finance share, internal address fs01.corp.example:445. Because 445 is below 1024 the dialog suggests 10445:

bash
ssh -L 10445:fs01.corp.example:445 -o ExitOnForwardFailure=yes -p 2222 Hb6dY2sNc9Pq@acme.cloud.captivo.io

# a Linux/macOS client that accepts a port
smbclient //127.0.0.1/finance -p 10445 -U vendor
The built-in file sharing client of an operating system usually insists on port 445 and a local SMB service may already own it. Test your client with a non-standard port before you promise a vendor this route; if it cannot do it, a recorded remote desktop or SSH resource is the better fit.

One tunnel serves any number of connections to the same service at once (a database tool that opens several sessions works). A second service needs a second resource and its own command.

Never recorded

A TCP tunnel session is never recorded and can never be watched live. The bytes belong to the user's own application and may be encrypted end to end; Captivo does not decrypt, replay or keep them. There is no keystroke log, no video and no query log. In Infrastructure → Live sessions a tunnel appears as TCP TUNNEL with the note "TCP tunnel · not recorded" and no thumbnail to watch. The same "not recorded" chip appears on the resource form and in the user's My access card.

If your compliance rule is "every session is recorded", set recording to required on the Policy page: tunnels then refuse to open (details below), which is the intended safeguard. For the recording features of the other types see Recording and monitoring.

Policies that apply

  • Grants. Everything a grant says applies: validity window, hours ("Outside the grant's hours"), approval, revocation and the disabled-account check. The tunnel is checked when it opens and every minute after. When the grant ends, the tunnel ends with it and the window shows that your access ended.
  • IP allowlist. The network the user connects from must be on the allowlist if you use one ("Network not on the IP allowlist"); the check uses the address of the ssh connection.
  • Recording = required. With recording set to required on Infrastructure → Policy, a tunnel cannot be opened. The form warns "Blocked: the Policy requires recording", and users see a disabled Connect button. Set recording back to optional or off to allow tunnels. See Policies.
  • Tickets. If you gate grants on tickets (ServiceNow, Jira, HTTPS), the work note for a tunnel reads "through a TCP tunnel (not recorded)" and carries no recordings link. See Access reviews and tickets.
  • Not applicable: watermark, clipboard, file transfer and keystroke settings, and the moderator (four eyes) rule, which needs a recorded session to watch.

What the audit log and live sessions show

WhereEntry
Audit, when the first connection goes throughMethod SSH, decision allow, reason session_open native_tcp, shown as "Session opened · TCP tunnel", with the service host and the user's client address.
Audit, when the tunnel endssession_close <duration>, for example "Session closed 42m", with the bytes sent from the service to the user (bytes out). One SSH connection is one session however many connections the app made through it.
Audit, refusalsA denied row whose reason ends in "· TCP tunnel", for example "Grant expired · TCP tunnel" or "Not allowed in the user's own app · TCP tunnel".
Live sessionsA TCP TUNNEL row while the window is open. An admin can end it there; the user's window then prints that the tunnel was ended.
Session historyThe session is listed under the user's own-app (native) sessions, with its duration.

There is no row per connection or per command: what the application did, which files it read and which queries it ran are not known to Captivo. Pair the tunnel with logging on the service itself when you need that.

Limits

  • TCP only, one service (host:port) per resource. No UDP, no port ranges, no reverse forwards.
  • The connector must run 2.39.0 or later (the version that brought raw TCP relaying). Older ones leave the Connect button disabled; update them under Infrastructure → Connectors.
  • The command works for two minutes. A tunnel that is already open stays open after that; a new tunnel needs a new command, and each click on Connect makes a new one.
  • The ssh connection must reach the jump host, port 2222 by default. Networks that block outbound 2222 cannot use tunnels, native SSH or recorded native SSH; ask your network team to allow it.
  • The user needs an OpenSSH-compatible client. The dialog notes that on Windows the command works in PowerShell and Windows Terminal, where OpenSSH is built in.
  • The local end listens on the user's own computer, so anyone else who can reach that port on that machine can use the tunnel while it is open. Remind users to keep the default bind and close the window when done.

Common problems

SymptomCause and fix
ssh stops with "Address already in use" or "Could not request local forwarding"Another program owns that local port (often a service of the same kind on the user's machine). Type another number in Port on your computer, get the new command and point the app at it.
The message "this SSH command has expired or was already replaced"The ticket is older than two minutes or was never registered. Click Connect again and run the new command right away.
Connect is greyed out in My accessThe grant is not active, the Policy requires recording, or the resource's connector is older than 2.39.0. The button's tooltip names the last two.
The tunnel opens but the app says connection refused or closedThe connector cannot reach host:port (wrong port, firewall between the connector and the service, name that does not resolve there). Test from the connector's machine, and check the address in the resource. See Connector offline if the connector itself is down.
The window prints that the tunnel was endedAn admin ended it in Live sessions, or the access ended (grant over, revoked, outside hours, network not allowed). Check the denied or closed row in the audit log.
The command cannot connect to port 2222 at allA firewall between the user and the jump host blocks outbound 2222. On your own server also check that SSH_ADDR is on and the port is published.

Related: Own RDP and SSH apps (the same jump host, with recording), Database access, Kubernetes, Vendor access.

For product-wide problems: The connector shows offline · The app does not open · Cannot sign in with a passkey

Was this article helpful?