Local port forwarding
Local port forwarding
A client on your Mac connects to a local listener. SSH carries the stream to the server, which opens the remote target. Responses travel back through the same tunnel.
Reach a remote service through a local port on your Mac.
SSH SERVER
YOUR MAC
Port mapping
Encrypted SSH
Client on Mac
Database app
Local listener
127.0.0.1:15432
SSH server
Your trusted host
Remote target
127.0.0.1:5432
Dashed: port mapping. Solid: service access. Replies return through the same tunnel.
The target’s loopback address refers to the SSH server, not your Mac.