Establish a SSH tunnel to access a remote server behind firewall

  • To start the tunnel (running background):
    for example:
    ssh -L localhost:3389: -N -f -M -S /tmp/ssh-tunnel.3389
    The command above starts the ssh tunnel (and keeps the ssh process running background.) After the tunnel is established, you can access the remote server port( via local port(localhost:3389).
  • To stop the tunnel (running background):
    for example:
    ssh -S /tmp/ssh-tunnel.3389 -O exit

No comments:

Post a Comment