SSH Tunneling for Fun and Profit

First, to test, set up temporary Python http server on the remote host:

[user@remotehost ~]$ mkdir tmp && cd tmp
[user@remotehost tmp]$ echo "HELLO WORLD" > index.html
[user@remotehost tmp]$ python -m http.server 8080 # python3
Serving HTTP on 0.0.0.0 port 8080 ...
[user@remotehost tmp]$ python -m SimpleHTTPServer 8080 #python2
Serving HTTP on 0.0.0.0 port 8080 ...

Then on the localhost use ssh to set up a tunnel. Here port 8081 on the local machine will tunnel through to 8080 on the remote host:

user@localhost ~ $ ssh -p 443 -f user@remotehost.com -L 8081:127.0.0.1:8080 -N
user@remotehost.com's password: 

Test the tunnel with telnet on local machine.

user@localhost ~ $ telnet 127.0.0.1 8081
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
GET /

HELLO WORLD
Connection closed by foreign host.