2014-03-03
Most universities have IP based authentication for access to Journals and index sites (MathSciNet, Web of Knowledge, etc.) If you’re off campus, they usually provide some VPN client (e.g. Cisco) which is quite painful to work with. However, if you have ssh access to a machine on campus, you can access journals very easily.
This method can also be used to access Gmail from China, or any site that is firewalled from the region you are currently in, provided you have ssh
access to a host from which the site is not firewalled.
This should also work on Macs.
Open a terminal and type:
ssh -D9050 you@campus.machine.edu
Leave the terminal open.
Open a browser and set it to use localhost:9050
as a SOCKS proxy.
In FireFox go to Preferences / Advanced / Network / Settings (as of 2014-03-03) and
Check Manual proxy configuration
Type 127.0.0.1
into the SOCKS host field, and 9050
into the port field.
Use SOCKSv5
Check Remote DNS
That’s it.
Now accessing any site from your browser will make the request appear to come from your campus computer.
Once you’re done with your access to the restricted resources, exit the ssh
connection, and reset your browsers proxy settings to NONE.
Recently (2014-12-22) I found github firewalled from my current location (India).
While the above easily allowed me to access the website from my browser, I couldn’t directly access any github hosted repositories.
Turns out that you can tell ssh
to use a proxy to use a site quite easily:
Install a version of netcat
that support proxies (on Debian systems, install the netcat-openbsd
package; the netcat-traditional
package does not have proxy support, and won’t work in this situation).
Edit ~/.ssh/config
and add the following:
Host github.com ProxyCommand nc -x localhost:9050 %h %p
As before ssh -D 9050 ...
and leave the terminal open.
Now ssh
connections to this host will use the proxy and circumvent the firewall.
This means you can git pull
happily from your github repositories.
When you’re done, close the terminal window with the ssh connection.
Anonymous (2014-03-23 01:58:17)
Once your proxies are set up the firefox addon Toggle Proxy allows you to toggle between them painlessly.
Sachin (2014-09-09 19:22:01)
As an alternative to the SOCKS proxy, you could set up an SSH tunnel:
ssh you@campus.machine.edu -L <port>:paywalledjournal.com:<port>
(With <port>
for HTTP access usually being 80.)
jay (2017-02-06 07:33:11 EST)
Nice post
Vasant (2017-06-22 01:23:27 EDT)
Awesome knowledge in this post how to access the network remotely using ssh proxy.