Using Teleport as an Upstream SSH Proxy for Network Appliances That Cannot Run the Teleport Agent #68064
pnrao1983
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Overview
This guide covers a validated architecture for proxying SSH access to network appliances — firewalls, routers, switches — that cannot run the Teleport agent and do not support SSH CA trust. FortiGate running FortiOS is the primary example, but the pattern applies to any SSH-capable appliance with a locked-down OS.
Teleport version tested: 18.9.1 (self-hosted, EKS)
Target OS tested: Amazon Linux 2023 with OpenSSH 8.7 (simulating FortiOS constraints)
Why Standard Teleport Enrollment Fails on Network Appliances
Teleport has two standard paths for enrolling SSH nodes:
Agent mode — Install the Teleport binary on the target. The agent registers with the cluster and handles cert-based auth directly.
Agentless OpenSSH mode — No binary needed. Configure
TrustedUserCAKeysin sshd to trust Teleport's CA, then Teleport proxies connections using short-lived certs.Both paths are blocked on FortiOS and most other network appliance operating systems:
TrustedUserCAKeysequivalent. SSH public keys must be configured per admin account directly on the device (rules out agentless mode)Fortinet TAC confirmed this. Reference:
The Solution: SSH ProxyJump with Agent Forwarding
Teleport acts as the identity-aware upstream proxy. The user's SSH agent (carrying a service account keypair) is forwarded through the Teleport proxy to the target device.
What you get from Teleport:
What the target device needs:
authorized_keysThis requires self-hosted Teleport — Cloud does not support proxy recording mode in this configuration.
Setup Guide
Step 1: Generate a dedicated SSH keypair
On the machine where you run
tsh:Step 2: Create a restricted service account on the target device
For a standard Linux target simulating the constraint:
For FortiGate, configure a restricted admin account under
config system adminand set the public key directly on the account. Apply least-privilege admin profile and limit SSH access to the Teleport proxy source IP.Step 3: Register the target as an OpenSSH node in Teleport
Create the node resource with
tctl. Note thatsub_kind: opensshmust be at the YAML top level, not insidespec— if placed insidespecit is silently ignored:Step 4: Generate a host certificate for the target
This allows Teleport's proxy to verify the target's identity:
Copy the generated files to the target and add to
sshd_config:Critical: TrustedUserCAKeys file format
On hardened distros (Amazon Linux 2023, RHEL 8+, and likely others), the
TrustedUserCAKeysfile must contain only the raw public key — nocert-authorityprefix, no trailing options. The standardtctl auth exportoutput includes both and will cause aninvalid formaterror.Export the CA correctly:
The file should contain only:
Also verify the fingerprint of the exported key matches what sshd reports in debug logs. If your cluster has multiple user CAs (e.g. after a rotation),
tctl auth export --type=opensshandtctl auth export --type=usermay return different keys. Check with:Compare against the
CA ED25519 SHA256:...fingerprint shown insshddebug output to confirm you have the right one.Restart sshd after updating the config.
Step 5: Create the Teleport role
Assign the role to the users or access lists that need device access.
Step 6: Load the service key and connect
ssh-add ~/.ssh/network-device-key tsh login --proxy=YOUR_CLUSTER tsh ssh -A netadmin@fortigate-fw-01Step 7: Verify session recording
The session should appear with the device hostname and the connecting user.
Key Gotchas
sub_kind placement —
sub_kind: opensshmust be at the YAML root level alongsidekind,version, andmetadata. If placed insidespec,tctl createsucceeds without error but the field is silently ignored, causingaccess deniedon connection.TrustedUserCAKeys format — The
cert-authorityprefix andclustername=options thattctl auth exportappends are forauthorized_keysfiles, notTrustedUserCAKeys. OpenSSH 8.7+ on hardened distros rejects the options withinvalid format. Strip them withawk '{print $2, $3}'.Multiple user CAs — A cluster that has undergone CA rotation may have more than one user CA.
tctl auth export --type=opensshreturns the active signing CA for the agentless path, which may differ from--type=user. Always fingerprint and compare against the sshd debug output.TeleportOpenSSHServerV2 CRD — If you use the Teleport Kubernetes operator, the
TeleportOpenSSHServerV2CRD may not be installed depending on your cluster version. Usetctl createdirectly as shown above.proxy recording mode —
record_session: default: proxyis intentional and required. The proxy terminates and re-encrypts the session because the target cannot participate in Teleport's cert-based trust chain. This is expected behavior for this architecture.Applicability
This pattern works for any SSH-capable device that does not support CA-based trust:
The Teleport configuration is identical in all cases. The only variable is how each vendor's OS handles service account SSH public key configuration.
References
Beta Was this translation helpful? Give feedback.
All reactions