Skip to content

Port Forwarding Manager

PhanTerm provides a built-in port forwarding manager, helping you securely pierce through internal networks to access restricted services via SSH tunnels, without leaving the TUI to memorize complex ssh -L command line parameters.

  • Local Forward: Maps a port on your local computer to an address in the remote internal network. For example, mapping local 8080 to a remote database at 127.0.0.1:3306.
  • Remote Forward: Maps a port on the remote server to an address on your local area network. For example, allowing the remote server to access an API service in your local development environment.
  • Dynamic Forward (SOCKS5): Opens a local SOCKS5 proxy port. All traffic directed to this proxy is forwarded through the remote server. This is highly suitable for cross-domain network testing.

When you are in Terminal Mode or Normal Mode, press F to summon the port forwarding panel in the center of the screen.

  1. Add a New Rule: Press a while in the panel.
    • Use Ctrl+T to toggle the tunnel type quickly (Local/Remote/Dynamic).
    • Press Tab to jump between input boxes and fill in the corresponding port numbers.
    • Press Enter to submit, and the tunnel will be established in the background immediately.
  2. Delete a Rule: Select a rule you no longer need from the list and press d to delete it and instantly free up the port.

All configured port forwarding rules are automatically persisted in your local configuration (connections.yaml), bound to the current host definition.

The next time you reconnect to this server, PhanTerm will silently and automatically restore all previously saved forwarding tunnels in the background, truly achieving a “configure once, worry-free forever” experience.