Difference between revisions of "Main Page/IT/ssh"

From Lewis Consultancy Wiki
< Main Page‎ | IT
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...")
(No difference)

Revision as of 14:52, 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

and that should be it