SSH Port Forwarding
1. Local Port Forwarding
ssh -L <local_port>:<destination_host>:<remote_port> <user>@<ssh_server>ssh -L 5050:188.171.10.8:4040 user@bastion.hostssh -L 5432:db1.host:5432 user@remote.host
# Connect locally: psql -h 127.0.0.1 -p 5432ssh -L 5901:127.0.0.1:5901 -N -f user@remote.host2. Remote Port Forwarding
3. Dynamic Port Forwarding (SOCKS Proxy)
Real-World DevOps Examples
1. Access AWS RDS or Azure SQL via Bastion
2. Forward Kubernetes Dashboard securely
3. Share a local web app with a remote team
Best Practices
References
Last updated