Today, I ran into a situation where I (temporarily) needed access from external to one of our test machines running a web GUI on a special port. As the external access was only possible via ssh on port 22, one of my peers pointed me to the ssh tunnel feature which instantly worked like a charm. The basic command pattern is:
ssh -L localport:localhost:remoteport user@remotehost.com
So, e.g.
ssh -L 80:localhost:8080 john@remotehost.com
would create me a tunnel from the remote host's port 8080 to my local macbook's port 80, so I can simply point the Safari browser to localhost, and I am there!