Skip to content

Instantly share code, notes, and snippets.

@mulderu
Created August 31, 2017 07:15
Show Gist options
  • Save mulderu/f220b097a4f03b2577f0bad7f2450606 to your computer and use it in GitHub Desktop.
Save mulderu/f220b097a4f03b2577f0bad7f2450606 to your computer and use it in GitHub Desktop.
reverse ssh, ssh forwarding
# reverse ssh tunneling
# simple way
# ref from : https://www.howtoforge.com/reverse-ssh-tunneling
#
# env-summary
# target : 192.168.5.10 (internal ip in firewall)
# ssh-gateway : 100.100.100.10 (static ip in public access)
#
# step 1) login to ssh-gateway from target(target is your final destination)
ssh -R 19999:localhost:22 mulder@100.100.100.10
# okay... established connection and keep connection, don't logout
#
# step 2) you can login to ssh-gateway from anyware (keep connection step1)
#
ssh mulder@100.100.100.10
#
# step 3) go to target host (to internal host) from gateway-host
ssh -p 19999 localhost
#
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment