https://gist.github.com/allen-munsch/63c2071103cbb04cbd82d10a47baf67e
nano /etc/ssh/sshd_config
PermitTunnel yes
service ssh restart
ssh -C -N your-host.com -vvv -D 8001
sudo ss -tulpn | grep 8001
# assumes 1 default profile "*.default"
if [[ "$OSTYPE" == "darwin"* ]]; then
export FFPROFILE=/Users/$USER/Library/Application\ Support/Firefox/Profiles/*.default/
else
export FFPROFILE=$HOME/.mozilla/firefox/profiles/*.default
fi
export CURRENTIP=$(curl ifconfig.co)
echo current $CURRENTIP
sed -i 's/user_pref("network.proxy.socks", ".*");/user_pref("network.proxy.socks", "localhost");/g' $FFPROFILE/prefs.js
sed -i 's/user_pref("network.proxy.socks_port", .*);/user_pref("network.proxy.socks_port", 8500);/g' $FFPROFILE/prefs.js
sed -i 's/user_pref("network.proxy.type", .*);/user_pref("network.proxy.type", 1);/g' $FFPROFILE/prefs.js
sed -i 's/user_pref("network.proxy.no_proxies_on", .*);/user_pref("network.proxy.no_proxies_on", "localhost, 127.0.0.1");/g' $FFPROFILE/prefs.js
sed -i 's/user_pref("network.proxy.socks_remote_dns", .*);/user_pref("network.proxy.socks_remote_dns", true);/g' $FFPROFILE/prefs.js
export PROXYIP=$(curl ifconfig.co -x localhost:8001)
echo proxy $PROXYIP
if [[ "$OSTYPE" == "darwin"* ]]; then
export FFPROFILE=/Users/$USER/Library/Application\ Support/Firefox/Profiles/*.default/
else
export FFPROFILE=$HOME/.mozilla/firefox/profiles/*.default
fi
sed -i 's/user_pref("network.proxy.type", .*);/user_pref("network.proxy.type", 0);/g' $FFPROFILE/prefs.js
Host your-host.com
User root
IdentityFile ~/.ssh/your-host.rsa