Created
June 1, 2020 23:11
-
-
Save pooyagolchian/2b47995f355280caa240c35d34c690de to your computer and use it in GitHub Desktop.
Linux Poor Man's VPN with proxychains
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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