My university has contracts with a bunch of scientific publishers so that we can freely download papers through our university network. In order to download the papers from home, we will need to tunnel to the server in the lab at the university. I’m using the Proxy Switch plugin for Chrome (I will not mention how to use Proxy Switch here). I also set up a script to establish a tunneling on login in my Mac.
-
Create a file name
tunnel.bash
and save it to a directory of your preference (mine is~/bin
). Add the tunneling command to this bash file.ssh -fN -D <port> -i ~/.ssh/id_rsa <user_name>@<your.bastion.server>
- Open Automator app in Mac Applications
- In Library, search for
Run Shell Script
- Drag and Drop the
Run Shell Script
to the right pane -
Input the comment to execute the
tunnel.bash
bash file abovesh ~/bin/tunnel.bash
- Click Run, and check if the tunnel is established
- Save the automator (file name might be
start_tunneling
) to a directory of your preference (again, mine is~/bin
) - Go to
System Settings/General/Login Items
, add the automator saved in step 7 to the Open at Login list - Restart to see if it works.