{"id":80,"date":"2009-10-19T13:57:30","date_gmt":"2009-10-19T19:57:30","guid":{"rendered":"http:\/\/benincosa.com\/blog\/?p=80"},"modified":"2014-11-19T11:26:56","modified_gmt":"2014-11-19T17:26:56","slug":"redir-and-ssh-forwarding","status":"publish","type":"post","link":"https:\/\/benincosa.com\/?p=80","title":{"rendered":"redir and ssh forwarding"},"content":{"rendered":"<p>Here&#8217;s the situation:<\/p>\n<p>You have a machine called skull that has access to the internet.\u00a0 However, no one can come into skull from the outside.<\/p>\n<p>You also have a machine that is on a private network with skull called bones.<\/p>\n<p>Finally, you have a third machine out on the internet named benincosa.com that you want to have access bones.<\/p>\n<p>To make this happen, you use an SSH backdoor plus redir to set it up.\u00a0 Here&#8217;s how its done:<\/p>\n<p>1. \u00a0Download redir. \u00a0I get it for RHEL5 here:<\/p>\n<p><a href=\"http:\/\/rpmfind.net\/\/linux\/RPM\/epel\/5\/x86_64\/redir-2.2.1-5.el5.x86_64.html\">http:\/\/rpmfind.net\/\/linux\/RPM\/epel\/5\/x86_64\/redir-2.2.1-5.el5.x86_64.html<\/a><\/p>\n<p>For other OS:<\/p>\n<p><a href=\"http:\/\/rpmfind.net\/linux\/rpm2html\/search.php?query=redir\">http:\/\/rpmfind.net\/linux\/rpm2html\/search.php?query=redir<\/a><\/p>\n<p>2.\u00a0 On skull:\u00a0 ssh -R 2222:localhost:22 benincosa.com<\/p>\n<p>3.\u00a0 On skull:\u00a0 redir &#8211;lport=2222 &#8211;cport=22 &#8211;caddr=bones<\/p>\n<p>4.\u00a0 Now from anywhere:\u00a0 ssh -p 2222 benincosa.com and enter the passwd for bones and you will magically find yourself on bones.<\/p>\n<p>That is how it is done my friends.<\/p>\n<p>Another case:<\/p>\n<p>from internal firewall machine:<\/p>\n<p>ssh -R 2222:localhost:22 vallard@benincosa.com<\/p>\n<p>On Benincosa.org run:<\/p>\n<p>redir &#8211;lport=2223 &#8211;cport=2222 &#8211;caddr=127.0.0.1<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here&#8217;s the situation: You have a machine called skull that has access to the internet.\u00a0 However, no one can come into skull from the outside. You also have a machine that is on a private network with skull called bones. Finally, you have a third machine out on the internet named benincosa.com that you want&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[920],"tags":[],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/benincosa.com\/index.php?rest_route=\/wp\/v2\/posts\/80"}],"collection":[{"href":"https:\/\/benincosa.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/benincosa.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/benincosa.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/benincosa.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=80"}],"version-history":[{"count":5,"href":"https:\/\/benincosa.com\/index.php?rest_route=\/wp\/v2\/posts\/80\/revisions"}],"predecessor-version":[{"id":2842,"href":"https:\/\/benincosa.com\/index.php?rest_route=\/wp\/v2\/posts\/80\/revisions\/2842"}],"wp:attachment":[{"href":"https:\/\/benincosa.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=80"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/benincosa.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=80"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/benincosa.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=80"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}