Skip to content

Instantly share code, notes, and snippets.

@ifnull
Created July 16, 2014 00:08
Show Gist options
  • Save ifnull/dc4f95aa5ea8985a6579 to your computer and use it in GitHub Desktop.
Save ifnull/dc4f95aa5ea8985a6579 to your computer and use it in GitHub Desktop.
SSH tunneling for web admin access to Solr

Introduction

You have SSH access to a server and need to access a web admin (or any protocol) on a non-public port.

For example, you want to access a Solr admin on port 8983 but the server's firewall only allows port 80 and 22. Rather than opening a port in the server's firewall we can just create a SSH tunnel.

Setup

Create tunnel

The following will bind the tunnel to port 1234 on your local machine. This is the port you will use to connect your proxy.

ssh -D 1234 -N -vvv www.website.com
  • 1234 can be any port, just be sure that any change to this port number is reflected Network Panel

Set Network Preferences

open /System/Library/PreferencePanes/Network.prefPane

NetworkPref

Usage

All of the remote server's ports should now be accessable as if they were local. For example, you can now access Solr via the following:

http://127.0.0.1:8983/solr/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment