Difference between revisions of "Main Page/IT/ssh"
From Lewis Consultancy Wiki
Jump to navigationJump to search (Created page with "=Set up a revserse tunnel to bypass NAT to a remote machine= Useful to log into a remote machine (remote) with account (remoteaccount) that is behind a NAT firewall. Create a...") |
|||
Line 17: | Line 17: | ||
</pre> | </pre> | ||
− | and that should be it | + | should present a login for the remote machine and that should be it! |
Latest revision as of 14:53, 4 November 2015
Set up a revserse tunnel to bypass NAT to a remote machine
Useful to log into a remote machine (remote) with account (remoteaccount) that is behind a NAT firewall.
Create an account on a machine on the Internet (middle.some.place) which is available from both sides and set a password:
useradd -s /bin/bash middleuser passwd middleuser
From remote machine
ssh -R 10002:localhost:22 middleuser@middle.some.place
The remote user will log into the middle machine. The terminal must stay open for the duration of the connection.
if you're logged into the middle.some.place.... you can then do:
ssh remoteaccount@localhost -P 10002
should present a login for the remote machine and that should be it!