Skip to content

Instantly share code, notes, and snippets.

@a-maumau
Last active June 9, 2021 07:00
Show Gist options
  • Save a-maumau/b79e5695734a1c3f4e32de29083dde09 to your computer and use it in GitHub Desktop.
Save a-maumau/b79e5695734a1c3f4e32de29083dde09 to your computer and use it in GitHub Desktop.
Pass through paywall via valid domain remote machine using ssh SOCKS proxy

Intro

This is NOT a way to illegally bypass a paywall.
This is for some people who have a access to university/organization account of some paywall pages (e.g., https://ieeexplore.ieee.org).
Also, this method requires a access of ssh login to some machines which has a valid domain.

<your_machine> -> <remote_machine> -> <website>

Basically, you need 2 steps.

  1. enable ssh SOCKS proxy
  2. configure to use the proxy

setup

ssh config

Set a ssh config for our convenient.
Use Dynamicforward option.
You can use any port what you want, and also you can use other options what you want. This time, we will set the proxy to use port 8080.

This is a minimal configuration, write in ~/.ssh/config.

Host socks_proxy
	HostName        <your.server.address>
	User            <user_name>
	DynamicForward  8080
	IdentityFile    ~/.ssh/<your_key>

Enable SOCKS proxy via ssh

In the terminal,

# to enable the SOCKS proxy
# with `-f` the command will run in background
# with the above configuration, SOCKS proxy will open in port 8080
ssh -N -f socks_proxy


# to disable the SOCKS proxy
# without `-f` option, use ctrl+c to kill the running process on you terminal
# with `-f` option, if you want to kill the process, search for the command, and kill it
# which is like
ps aux | grep 'ssh -N -f socks_proxy' | grep -v grep | awk '{ print "kill -9", $2 }' | sh

Use SOCKS proxy

Use the OS default network manager (or some might can do in a browser) for setting the SOCKS proxy, and use localhost:8080. After setting, you can now access via remote machine's domain.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment