Tuesday, October 14, 2014

Set up SSH tunnel


Tunnel firewalled Elasticsearch port (9200) through SSH

Tunnel service out with access to server host:

ssh -N -f remoteuser@remotehost -L 19200:localhost:9200

Options:

  • -N: Do not execute command (optional, mostly for security)
  • -f: Go into background (otherwise remote prompt comes into terminal)
  • -L: Local port mapping (local port 19200 will tunnel into remote 9200)

SOCKS proxy

ssh -D 8080 -f -C -q -N myuser@remote_ssh_server
-D 8080: Dynamic SOCKS server
-f : Fork into background
-C : Turn on compression
-q : Quiet mode
-N : No commands (required by -f)

No comments: