Remote port forwarding - Public connections to my laptop on any network:
------------------------------------------------------------------------
ssh -R ${remote}:${local} remote
Initiated by the remote machine.
Example:
1.) Run this on your Mac
ssh -R *:2020:localhost:22 -i awskey.pem ec2-user@ec2-xx-xx-xxx-xxx.us-west-2.compute.amazonaws.com
2.) Then on AWS machine to access your Mac:
ssh macuser@localhost -p 2020
Local port forwarding:
-------------------------------------------------
ssh -L ${local}:${remote} remote
Initiated by the local machine.
3.) Dynamic port forwarding, SOCKS 5 proxy using '-D' flag
Original link:
https://vimeo.com/54505525