🔑SSH Tunnel
Also known as SSH Port Forwarding, Local Port Forwarding, ssh -L
A way to send one more link through SSH. It reaches a private service.
Think of it like
Think of it like a secret hall between two homes. You walk through, and no one outside sees.
Example
Emma's database only works from inside her server. She opens a tunnel to it. Her laptop's app then uses port 8080.
Why it matters
You can keep a database off the web and still reach it yourself.
Definition
Example code
bash
ssh -L 8080:localhost:5432 emma@203.0.113.10Common mistake
Key takeaways
- 1Inside SSH. One login carries both.
- 2Local port in. Pick a port on your side.
- 3Private stays private. Nothing new is opened.