Skip to content

Instantly share code, notes, and snippets.

@mmoscosa
Created January 21, 2013 15:31
Show Gist options
  • Save mmoscosa/4586861 to your computer and use it in GitHub Desktop.
Save mmoscosa/4586861 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