Skip to content

Instantly share code, notes, and snippets.

@lyoshenka
Created September 12, 2013 14:04
Show Gist options
  • Save lyoshenka/6537948 to your computer and use it in GitHub Desktop.
Save lyoshenka/6537948 to your computer and use it in GitHub Desktop.
Tunnel HTTP(s) over SSH
#!/bin/bash
# -f = daemonize, -q = quiet, -N = no command, just tunnel, -L = what port to forward, -i = ssh key
# sudo is only necessary when tunneling privileged ports
sudo ssh -f -N -q -L 80:localhost:80 user@host -i ~/.ssh/id_rsa
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment