Port forwarding
Local forwarding
Open a service that only your server can reach, such as a database, as if it were running on your Mac.
Example
Your PostgreSQL database runs on db-server and only accepts connections from the server itself. You want to open it in a database app on your Mac.
- In Port Forwarding, click New Forwarding and choose Local.
- Connect via host:
db-server. - Listen on this Mac:
127.0.0.1, port5433. - Destination:
127.0.0.1, port5432. - Click Save & Connect.
Now point your database app to localhost:5433.
Good to know
- The destination is seen from the server.
127.0.0.1means the server itself; you can also enter another machine in the server’s network. - Pick a listening port that isn’t already used on your Mac.
If you’re used to the command line
This does the same as:
ssh -L 5433:127.0.0.1:5432 user@db-server
-Lmeans a local tunnel5433is the port in Listen on this Mac127.0.0.1:5432is the Destinationuser@db-serveris the host in Connect via Host
You don’t need to run this command: Termbit sets everything up for you.