Accessing Journals via an SSH proxy

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.

  1. Open a terminal and type:

    ssh -D9050 you@campus.machine.edu
    
  2. Leave the terminal open.

  3. 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

    1. Check Manual proxy configuration

    2. Type 127.0.0.1 into the SOCKS host field, and 9050 into the port field.

    3. Use SOCKSv5

    4. 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.

Tunneling SSH over an SSH proxy

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:

  1. 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).

  2. Edit ~/.ssh/config and add the following:

    Host github.com
        ProxyCommand nc -x localhost:9050 %h %p
    
  3. 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.

🗫 Comments

  • Anonymous
    Toggle Proxy

    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
    SSH Tunnel

    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
    proxy site list

    jay (2017-02-06 07:33:11 EST)

    Nice post

  • Vasant
    Support

    Vasant (2017-06-22 01:23:27 EDT)

    Awesome knowledge in this post how to access the network remotely using ssh proxy.

📮 Leave a comment (Spammers beware: All comments are moderated)

Sorry. There was an error submitting your comment. Please try again, or contact me if the problem persists.
Sending comment; please wait.
Thanks. Your comment was successfully submitted. It will appear here shortly if it isn't spam.