Types of Port Forwarding
Netcatty supports three types of SSH port forwarding:Local Forwarding
Forward a local port to a remote destination through the SSH server.Use case: Access a remote database or web service from your local machine.
Remote Forwarding
Forward a remote port on the SSH server to a local destination.Use case: Expose a local dev server to the remote network for testing.
Dynamic Forwarding
Create a SOCKS proxy for dynamic application-level forwarding.Use case: Route browser traffic through the SSH server as a VPN-like proxy.
Creating Port Forwards
From Port Forwarding Panel
- Open Port Forwarding panel (toolbar or
⌘+P/Ctrl+P) - Click Add Rule
- Configure the forward:
- Type: Local, Remote, or Dynamic
- Local Port: Port on your machine
- Remote Host: Destination hostname
- Remote Port: Destination port
- Click Start to activate
From Host Configuration
Configure persistent port forwards in host settings:Local Port Forwarding
Forward a local port to a remote destination:Configuration
Set to
"local" for local port forwardingPort on your local machine to listen on (e.g.,
8080)Destination hostname as seen from the SSH server (e.g.,
localhost, internal-db)Port on the remote destination (e.g.,
3306, 80)Automatically start this forward when connecting to the host
Example: Access Remote MySQL
Scenario: MySQL runs oninternal-db:3306 in the remote network, not accessible from your machine.
Solution: Create a local forward:
localhost:3306 on your machine, traffic routes through SSH to internal-db:3306.
Example: Access Remote Web App
Scenario: Internal web app onapp-server:8080 not accessible from your network.
Configuration:
http://localhost:8080 in your browser.
Remote Port Forwarding
Expose a local port to the remote network:Configuration
Set to
"remote" for remote port forwardingPort on the SSH server to listen on (e.g.,
8080)Local hostname (usually
localhost)Port on your local machine (e.g.,
3000)Example: Expose Local Dev Server
Scenario: You’re developing a web app onlocalhost:3000 and need to demo it to a colleague on the remote network.
Solution: Create a remote forward:
ssh.example.com:8080, which tunnels to your localhost:3000.
Example: Expose Local Database
Scenario: Remote app needs to connect to a database on your local machine. Configuration:localhost:5432 on the SSH server, which routes to your local PostgreSQL.
Dynamic Port Forwarding (SOCKS Proxy)
Create a SOCKS proxy for dynamic traffic routing:Configuration
Set to
"dynamic" for SOCKS proxyLocal port for SOCKS proxy (e.g.,
1080)Example: Browser Proxy
Scenario: Route browser traffic through the SSH server to access geo-restricted content or bypass firewalls. Configuration:localhost:1080.
- Firefox
- Chrome/Edge
- System-wide (macOS)
- Open Settings → Network Settings
- Select Manual proxy configuration
- Set SOCKS Host:
localhost, Port:1080 - Select SOCKS v5
- Check Proxy DNS when using SOCKS v5
- Click OK
Example: CLI Tools via Proxy
Route command-line tools through the SOCKS proxy:Managing Port Forwards
Port Forwarding Panel
Access the panel:- Click Port Forwarding in the toolbar
- Or press
⌘+P(macOS) /Ctrl+P(Windows/Linux)
| Column | Description |
|---|---|
| Type | Local, Remote, or Dynamic |
| Local Port | Port on your machine |
| Remote | Destination (host:port) |
| Status | Active, Stopped, or Error |
| Auto-start | Whether it starts automatically |
Actions
- Start/Stop
- Edit
- Delete
Click the Start or Stop button to control the forward.Active forwards show a green indicator and “Active” status.
Auto-Start Forwards
Configure forwards to start automatically when connecting:autoStart: true:
- Connect to the host
- Netcatty automatically starts the forward
- The forward remains active until you disconnect
autoStart (or false), you must manually start forwards from the panel.
Common Use Cases
Access Internal Database
Access Internal Database
Problem: Database on internal network, not accessible from your machine.Solution: Local forward from your machine to the database.Connect:
psql -h localhost -p 5432Expose Local Dev Server
Expose Local Dev Server
Problem: Need to share local development server with remote team.Solution: Remote forward from SSH server to your local port.Team accesses:
http://ssh-server:8080Bypass Firewall Restrictions
Bypass Firewall Restrictions
Problem: Corporate firewall blocks certain websites or services.Solution: Dynamic SOCKS proxy through an external SSH server.Configure browser to use
localhost:1080 as SOCKS5 proxy.Multi-Hop Port Forward
Multi-Hop Port Forward
Problem: Need to access a service through multiple jump hosts.Solution: Combine host chaining with port forwarding.
- Configure jump host chain
- Add local forward on the final host
- Traffic routes through all hops to the destination
Troubleshooting
Port Already in Use
Port Already in Use
Error:
Address already in use or EADDRINUSECause: Another process is using the local port.Solutions:- Find and stop the conflicting process:
- Choose a different local port (e.g.,
3307instead of3306)
Connection Refused to Remote Host
Connection Refused to Remote Host
Error:
Connection refused when forwarding startsCause: Remote destination is not accessible from the SSH server.Solutions:- Verify the remote service is running:
telnet remoteHost remotePort - Check firewall on the SSH server allows access to the destination
- Ensure the remote hostname resolves from the SSH server
Remote Forward Not Accessible
Remote Forward Not Accessible
Problem: Remote forward is active but not reachable from remote network.Cause: SSH server’s Restart SSH:
GatewayPorts is not configured.Solution: Enable GatewayPorts in /etc/ssh/sshd_config on the SSH server:sudo systemctl restart sshdSOCKS Proxy Not Working
SOCKS Proxy Not Working
Problem: Applications can’t connect through SOCKS proxy.Cause: Application not configured or DNS not proxied.Solutions:
- Verify application supports SOCKS5 proxy
- Enable “Proxy DNS” or “Remote DNS” in proxy settings
- Test with
curl --socks5 localhost:1080 https://ifconfig.me
Permission Denied (< 1024)
Permission Denied (< 1024)
Problem: Can’t bind to ports below 1024 (e.g., 80, 443).Cause: Privileged ports require admin access on some systems.Solution: Use a higher port number (e.g.,
8080 instead of 80) or run with elevated privileges (not recommended).Best Practices
Use High Ports
Prefer ports above 1024 to avoid permission issues. For example, use
3307 instead of 3306 if the standard port is unavailable.Enable Auto-Start
Configure
autoStart: true for forwards you use regularly to save manual setup time.Document Your Forwards
Add descriptive labels to port forwards in host notes so you remember what each one is for.
Close When Done
Stop forwards when not in use to free ports and reduce security exposure.
Security Considerations
Related Topics
SSH Connections
Learn about SSH connection options and configuration
Jump Hosts
Combine port forwarding with jump host chains
Host Configuration
Configure persistent port forwards in host settings
Troubleshooting
Solve common port forwarding issues
