Skip to content

Instantly share code, notes, and snippets.

@Rio517
Created March 11, 2013 20:30
Show Gist options
  • Save Rio517/5137459 to your computer and use it in GitHub Desktop.
Save Rio517/5137459 to your computer and use it in GitHub Desktop.
Generic local tunnel to web url
desc "Start Reverse SSH Tunnel"
task :start do
ssh_username = "rails"
ssh_host = "managedmachine.com"
ssh_port = 22
tunnel_listener_port = 9999
local_listner_port = 8000
exec "ssh -p #{ssh_port} -nNT -g -R *:#{tunnel_listener_port}:0.0.0.0:#{local_listner_port} #{ssh_username}@#{ssh_host}"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment