As I mentioned before our college network has this squid proxy which makes us spend more time configuring our tools to bypass it than doing any actual work. My goal this time was to get ssh working behind the proxy.
Most git repositories provide ssh links. So to get git working I needed to get ssh working first. A simple
nmap showed that there are 4 ports open on the proxy server one of them being the ssh port: 22. So I guessed I only needed to tunnel the ssh request using http connect. But turns they have tunneling blocked for port 22.
Solution, as always TOR. I configured ssh to use the tor socket and volla every thing was working including git. So here goes the few steps to get ssh working with TOR:
1. Install connect-proxy:
2. Add config file for ssh to work with connect:
Create a file
~/.ssh/config and put the following inside it
9050 is the default tor port, change it if yours is different.
This should be enough to get ssh working through tor. If you are prompted for a socks5 password then follow the next step.
3. Set socks5 password for tor:
/etc/torsocks.conf file and add the following:
And also add the
SOCKS5_PASSWORD environment variable( in
4. Get the git:// protocol working with tor:
Create a file
~/.torgit and put the following there
And add the
GIT_PROXY_COMMAND environment variable ( in
Yup thats all there is to it..