ssh through a proxy (Squid, etc)
If you are somewhere where the only way of connecting to the outside world is through a proxy, then to get ssh to work, here’s what to do:
Compile it (gcc connect.c -o connect), and put connect somewhere in your path. That page says /usr/local/bin, but you probably don’t have permissions to that, anyway. You can do mkdir -p ~/bin && mv connect ~/bin and add a line export PATH=$PATH:~/bin to ~/.bashrc or ~/.bash_profile (or both), and restart the terminal, or start a new one.
Edit the file ~/.ssh/config (create it if it doesn’t exist) and add the two lines
Host * ProxyCommand connect -H proxyusername@proxyname:3128 %h %p
Replace proxyusername by the username for the proxy, and proxyname by the location of the proxy, and 3128 by the port number (it’s usually 3128 for Squid).
If it is a low-security thing and the password is already well-known (guest account?), then might as well put the password in the above .bash… files, to save the hassle of typing it each time:
Then ssh should work as usual: ssh username@hostname , etc.