Assume you have a local machine behind NAT and there is a relay machine that has a public IP address. You want to have access to the local computer from anywhere.
Getting Started
Create SSH from Local to the Relay Machine
Log into the relay machine and then pick any arbitrary available port up. Here we use port 10022:
Then from anywhere on the Internet, first ssh to the relay computer and then within the terminal of relay machine ssh to the local machine:
Connect to the Local Machine from the Relay Machine