Skip to content

Instantly share code, notes, and snippets.

@bsormagec
Forked from mmoscosa/sshProxy
Created February 28, 2016 13:33
Show Gist options
  • Select an option

  • Save bsormagec/cae8301095431c617fb4 to your computer and use it in GitHub Desktop.

Select an option

Save bsormagec/cae8301095431c617fb4 to your computer and use it in GitHub Desktop.
Script to open a SSH proxy Tunneling using Socks
#!/bin/bash
if [[ -n $(ps -fe | grep 'ssh -f -D 2001 {username}@{username}.com -p 7822 -N' | grep -v grep | awk '{print $2}') ]]; then
kill $(ps -fe | grep 'ssh -f -D 2001 {username}@{username}.com -p 7822 -N' | grep -v grep | awk '{print $2}')
ssh -f -D 2001 {username}@{username}.com -p 7822 -N
else
ssh -f -D 2001 {username}@{domain}.com -p 7822 -N
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment