Skip to content

Instantly share code, notes, and snippets.

@pooyagolchian
Created June 1, 2020 23:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pooyagolchian/2b47995f355280caa240c35d34c690de to your computer and use it in GitHub Desktop.
Save pooyagolchian/2b47995f355280caa240c35d34c690de to your computer and use it in GitHub Desktop.
Linux Poor Man's VPN with proxychains
#!/bin/sh
# SET VARIABLE
NET_SERVICE="Wi-Fi"
PORT=1080
SERVER=admin@example.com
PID=`pgrep -f ${PORT}`
if pgrep -f ${PORT} >/dev/null
then
echo "Ssh process in running with pid" ${PID}
sudo kill -9 ${PID}
echo "Kill ssh process with PID" ${PID}
else
echo "Ssh process not found"
fi
ssh -D ${PORT} -f -C -q -N ${SERVER}
echo "Connect to server"
PID=`pgrep -f ${PORT}`
echo "Ssh runs on PORT "${PORT}" and PID "${PID}". socks proxy set on Wi-Fi"
echo "Change proxychain4 socks5 port /etc/proxychains.conf"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment