{"id":118,"date":"2015-09-27T21:38:13","date_gmt":"2015-09-27T18:38:13","guid":{"rendered":"http:\/\/small-service.com\/?p=118"},"modified":"2018-07-27T12:31:52","modified_gmt":"2018-07-27T09:31:52","slug":"ssh-tunneling","status":"publish","type":"post","link":"https:\/\/small-service.com\/?p=118","title":{"rendered":"ssh tunneling"},"content":{"rendered":"<p>For some reason at some time you need tunnel to your home, work, server etc..<br \/>\nand the easiest way to build it &#8211; is ssh. There are a lot of manuals in internet how to do it, but here I will keep my useful examples with description<br \/>\n<!--more--><\/p>\n<ul>\n<li><strong>local port forwarding:<\/strong><br \/>\n        <code>ssh -2 -f -N -L local_port:127.0.0.1:remote_port user@host<\/code><\/p>\n<ul style=\"list-style-type: none;\">\n<li>2 &#8211; Forces ssh to try protocol version 2 only<\/li>\n<li>f &#8211; Requests ssh to go to background just before command execution<\/li>\n<li>N &#8211; Requests ssh to go to background just before command execution<\/li>\n<li>L &#8211; Specifies that the given port on the local (client) host is to be forwarded to the given host and port on the remote side.<\/li>\n<\/ul>\n<\/li>\n<p><\/p>\n<li><strong>remote port forwarding:<\/strong><br \/>\n        <code>ssh -4 -N -f -R \\*:remote_port:127.0.0.1:local_port user@server<\/code><\/p>\n<ul style=\"list-style-type: none;\">\n<li>R &#8211; Specifies that the given port on the remote (server) host is to be forwarded to the given host and port on the local side.<\/li>\n<li>\\* &#8211; specify remote server listen on all interface<\/li>\n<li>4 &#8211; Forces ssh to use IPv4 addresses only<\/li>\n<\/ul>\n<\/li>\n<p><\/p>\n<li><strong>ssh vpn tunnel<\/strong><br \/>\nvery good manual written on ubuntu help page:\u00a0<a href=\"https:\/\/help.ubuntu.com\/community\/SSH_VPN\">ssh_vpn tunnel<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>For some reason at some time you need tunnel to your home, work, server etc.. and the easiest way to build it &#8211; is ssh. There are a lot of manuals in internet how to do it, but here I will keep my useful examples with description<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[7],"tags":[60,59,62,61],"_links":{"self":[{"href":"https:\/\/small-service.com\/index.php?rest_route=\/wp\/v2\/posts\/118"}],"collection":[{"href":"https:\/\/small-service.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/small-service.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/small-service.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/small-service.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=118"}],"version-history":[{"count":32,"href":"https:\/\/small-service.com\/index.php?rest_route=\/wp\/v2\/posts\/118\/revisions"}],"predecessor-version":[{"id":312,"href":"https:\/\/small-service.com\/index.php?rest_route=\/wp\/v2\/posts\/118\/revisions\/312"}],"wp:attachment":[{"href":"https:\/\/small-service.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=118"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/small-service.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=118"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/small-service.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=118"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}