From aa31b0d09264333b27f6d4cd58c92d66c147c84a Mon Sep 17 00:00:00 2001 From: sipp11 Date: Wed, 4 Feb 2015 04:00:49 +0700 Subject: [PATCH] new post: reserve ssh --- _posts/2015-02-04-reverse-ssh.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 _posts/2015-02-04-reverse-ssh.md diff --git a/_posts/2015-02-04-reverse-ssh.md b/_posts/2015-02-04-reverse-ssh.md new file mode 100644 index 0000000..34f5abf --- /dev/null +++ b/_posts/2015-02-04-reverse-ssh.md @@ -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Ă ! \ No newline at end of file