SSH from hades to earth.server.com with the -R flag. I’ll assume that you’re the root user on hades and that tech will need the root user ID to help you with the system. With the -R flag, you’ll forward instructions of port 2222 on earth.server.com to port 22 on hades. This is how you set up an SSH tunnel. Note that only SSH traffic can come into hades: You’re not putting hades out on the Internet naked.
You can do this with the following syntax:
# ssh -R 2222:localhost:22 email@example.com
Once you are into hades.server.com, you just need to stay logged in and enter a command like:
firstname.lastname@example.org:~$ while [ 1 ]; do date; sleep 300; done
to keep the machine busy and minimize the window.
Now instruct your friends to SSH as “username” into earth.server.com without using any special SSH flags. You’ll have to give them your password:
root@hades:~# ssh email@example.com .
BTW no need
Once user is on the hades.server.com, they can SSH to earth using the following command:
firstname.lastname@example.org:~$: ssh -p 2222 root@localhost
ssh -R 2222:localhost:22 email@example.com
while [ 1 ]; do date; sleep 300; done
ssh -p 2222 root@localhost
and we can log in into earth.somedomain.com :))