At work, we have a captive portal that non-domain-joined machines must authenticate to at least once a day in order to use the internet. Our firewall lets you set exceptions to that rule, but it’s cumbersome and doesn’t always work.
This poses a problem when setting up a new Raspberry Pi, because Raspbian Jessie Lite doesn’t have lynx installed by default, and you can’t easily use cURL to log in (because of session tokens and such). The solution is to proxy the internet connection from the Pi to the computer and authenticate on the computer
This’ll be a short post, mostly for my own reference later, but I’ll be using PuTTY for this.
- Connect to the Pi over SSH. Go into the connection settings for PuTTY. Expand Connection > SSH and click on Tunnels.
- For the source port, type 1080. Leave destination blank, but set the radio buttons to “Dynamic” and “Auto”. Click “Add”
- Open up Internet Explorer. Go to Tools > Internet Options > Connections > LAN Settings
- Tick “Use a Proxy”. Clear out the address and port, and click “Advanced”
- Untick “Use the same proxy server for all protocols”
- Under the Socks section, set the address to 127.0.0.1 and the port to 1080
- In Internet Explorer, try and load a website. Authenticate to the captive portal
- Back in PuTTY, connect to your Pi and check that the internet is working by doing something like installing a package, wget-ting a file and so forth.
Success!