ssh_reverse_tunneling
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| ssh_reverse_tunneling [2015/12/07 10:51] – created admin | ssh_reverse_tunneling [2015/12/19 14:59] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | SSH reverse tunneling. | + | =====SSH reverse tunneling===== |
| First make sure, you have passwordless auth on the systems. use ssh-copy-id for that. | First make sure, you have passwordless auth on the systems. use ssh-copy-id for that. | ||
| - | Dest | NAT | Source | + | ====Dest | NAT | Source==== |
| - | on the Dest Host: ssh -f -N -R 10000: | + | < |
| - | on the Source Host: ssh localhost -p 10000 | + | on the Dest Host: |
| - | Problem with that solution is, that you always have to make sure that the tunnel from Dest to Source is in place. You can do that by a cronjob for example. | + | ssh -f -N -R 10000: |
| - | but you may prefer to use autossh! | + | |
| + | on the Source Host: | ||
| + | |||
| + | ssh localhost -p 10000 | ||
| + | </ | ||
| + | |||
| + | Problem with that solution is, that you always have to make sure that the tunnel from Dest to Source is in place. You can do that by a cronjob for example. But you may want to prefer to use autossh! | ||
| + | |||
| + | < | ||
| autossh -f -N -M 10984 -o " | autossh -f -N -M 10984 -o " | ||
| + | </ | ||
| - | Dest | NAT | Middle | Source | + | ====Dest | NAT | Middle | Source==== |
| If destination isn't always on, eg your laptop at home, you may want to use a middleman host | If destination isn't always on, eg your laptop at home, you may want to use a middleman host | ||
| - | on the Dest Host: ssh -f -N -R 10000: | + | < |
| - | on the Source Host: ssh middleuser@middle | + | on the Dest Host: |
| + | |||
| + | ssh -f -N -R 10000: | ||
| + | |||
| + | on the Source Host: | ||
| + | |||
| + | ssh middleuser@middle | ||
| ssh -p 10000 destuser@127.0.0.1 | ssh -p 10000 destuser@127.0.0.1 | ||
| + | </ | ||
| - | you may want to put that in your / | + | you may want to put that in your / |
| + | < | ||
| autossh -f -N -M 10984 -o " | autossh -f -N -M 10984 -o " | ||
| + | </ | ||
| - | note the & at the end, forgetting it may hang up your box at boot! | + | note the "&" |
ssh_reverse_tunneling.1449485484.txt.gz · Last modified: (external edit)
