Bastion Access and Restricted SSH Forwarding

server2 only accepts administration from server1, and its app listens on loopback. Reach it through the bastion without copying a private key anywhere, tunnel to the app on loopback only, and narrow what the bastion will forward.

Skill labintermediate~40 minPro

What you'll do

  • ✓Confirm the direct path is blocked and configure ProxyJump through the bastion
  • ✓Open a local port forward bound to loopback and use it
  • ✓Restrict forwarding on the target with PermitOpen and prove an unauthorised destination is refused
  • ✓Close tunnels and leave nothing listening

Lab outline

  1. 01Reach the private host
  2. 02Forward one port
  3. 03Narrow the forwarding
  4. 04Leave it clean

Before you start

  • SSH Keys and Access Hardening
  • SFTP and Verified File Synchronization

Every lab runs on a real machine of your own in the browser — no installs, nothing to clean up — and checks your work automatically as you go.

← All Linux System Administration labs

Your first machine is
8 seconds away.

Learn by doing on real machines — and give every AI agent one of its own.

Free forever · No credit card · Cancel anytime

Bastion Access and Restricted SSH Forwarding — Linux lab | Kube Labs