Servers and cloud

Reach a server's private port from your machine (SSH tunnel)

Open a database or admin page that only listens on the server, as if it were on your own computer.

Fill these in once
  1. Open the tunnel
    Terminal
    ssh -N -L 5433:localhost:5432 ubuntu@203.0.113.10

    Leave it running. Press Ctrl + C to close it.

Check it worked

  1. In a second terminal, check the tunnel is open
    Terminal
    nc -vz localhost 5433

    Then point your app or database tool at localhost and that port.

  1. Open the tunnel
    Terminal · Ubuntu / Debian
    ssh -N -L 5433:localhost:5432 ubuntu@203.0.113.10

    Leave it running. Press Ctrl + C to close it.

Check it worked

  1. In a second terminal, check the tunnel is open
    Terminal · Ubuntu / Debian
    nc -vz localhost 5433

    Then point your app or database tool at localhost and that port.

  1. Open the tunnel
    PowerShell
    ssh -N -L 5433:localhost:5432 ubuntu@203.0.113.10

    Leave it running. Press Ctrl + C to close it.

Check it worked

  1. In a second window, check the tunnel is open
    PowerShell
    Test-NetConnection localhost -Port 5433

    Then point your app or database tool at localhost and that port.