You need to reach a database on a private subnet from your laptop through a bastion. How?
BeginnerScenarioNetworking, SSH and remote access
Answer
Situation read → SSH jump host plus local port forwarding.
What I'd do →
ssh -J [email protected] -L 5433:db.internal:5432 [email protected] -N
psql -h localhost -p 5433 -U app
Or permanently in ~/.ssh/config:
Host app01
HostName app01.internal
User ops
ProxyJump bastion.example.com
LocalForward 5433 db.internal:5432
Why → -J/ProxyJump tunnels the SSH connection through the bastion end-to-end; -L forwards a local port to the target.
Interview tip → Mention that in AWS you'd often use SSM Session Manager port forwarding instead of a bastion.
More on Networking, SSH and remote access
A key belonging to a departed engineer may be in `authorized_keys` on 300 servers. How do you rotate SSH keys across the fleet?IntermediateYour security team wants SSH hardened on all servers. What changes do you make?BeginnerA new server needs a static IP, gateway and DNS on RHEL 9. How do you configure it persistently?BeginnerYou're changing the network config of a remote server over SSH and could lose access. How do you protect yourself?IntermediateA web server should accept HTTP/HTTPS from anywhere but SSH only from the office. Configure the firewall.BeginnerYour app servers need to reach the internet for updates but must not be reachable from it. How do you set it up on a Linux gateway?Intermediate