sipp11
10 years ago
1 changed files with 28 additions and 0 deletions
@ -0,0 +1,28 @@
|
||||
--- |
||||
layout: post |
||||
title: "reverse ssh" |
||||
author: |
||||
display_name: sipp11 |
||||
login: sipp11 |
||||
email: sipp11@gmail.com |
||||
url: '' |
||||
author_login: sipp11 |
||||
author_email: sipp11@gmail.com |
||||
date: Feb 4, 2015 |
||||
tags: |
||||
- ssh |
||||
- nat |
||||
--- |
||||
There are times when your machine is behind NAT and you couldn't access easily. Unless you have VPN tunneling, it would be tricky. However, reverse `ssh` might be a handy tool. |
||||
|
||||
| Host A | ----> NAT ---> | Host B | |
||||
|
||||
For above case, you can clearly see that B can access A easily, but reversely, it's not w/o port forwarding blah blah blah. As a result, you can just do reverse `ssh` by start `ssh` from _Host B_ to _Host A_ with command |
||||
|
||||
$ ssh -NR 8888:localhost:22 user@host-a |
||||
|
||||
Then at _Host A_, you can just `ssh` via port 8888. |
||||
|
||||
$ ssh user@localhost -p 8888 |
||||
|
||||
Violà! |
Loading…
Reference in new issue