Skip to content
Snippets Groups Projects
Verified Commit eebce0a0 authored by Qiyang Sun's avatar Qiyang Sun :speech_balloon:
Browse files

Initial commit

parents
No related branches found
No related tags found
No related merge requests found
#+title: Pseudo VPN -- Connect to University Network Using SSH + SOCKS
For UNIX only (Linux, macOS, BSD, etc.)
* Configure
Edit ~connect~ and set your University id.
* Run script
#+BEGIN_SRC sh
chmod 0755 connect
./connect
#+END_SRC
* Edit Settings
Either edit your browser's proxy settings or edit your operating system's
network settings.
For Firefox, go to Settings > General > Network Settings > Settings... > Manual
proxy configuration > SOCKS Host (~localhost~), Port (~2333~ or as in script) >
OK.
For macOS, go to System Settings > Wi-Fi (or your network interface) >
Details... > Proxies > SOCKS proxy > Server (~localhost~), Port (~2333~ or as in
script) > OK.
* Finish
To stop, use Ctrl-C to send SIGINT. The script will kill ssh.
connect 0 → 100755
#!/bin/bash
############################
# CONFIGURATIONS
# local port
p=2333
# university id
sotonid='abc1d23'
# host
dn='uglogin.ecs.soton.ac.uk'
############################
printf '\e[8;12;40t' # 40x12 window
echo -e "\033[44;37m" # fancy colour
clear
echo "+--------------------------------------+"
echo "| |"
echo "| Connecting to the University of |"
echo "| Southampton network, local port $p |"
ssh $sotonid@$dn -D $p -N &
pid=$!
echo "| PID is $pid |"
echo "| |"
echo "| C-c to terminate |"
echo "| |"
echo "+--------------------------------------+"
cleanup() {
clear
echo "+--------------------------------------+"
echo "| |"
echo "| Killing the ssh process (pid $pid) |"
echo "| |"
kill $pid && echo "| Success |" || echo "| Error |"
echo "| |"
echo "+--------------------------------------+"
echo
echo
echo
}
trap cleanup SIGINT
tail -f /dev/null
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment