{"id":4263,"date":"2013-11-09T21:44:30","date_gmt":"2013-11-10T01:44:30","guid":{"rendered":"http:\/\/www.dr-chuck.com\/csev-blog\/?p=4263"},"modified":"2014-11-05T12:32:17","modified_gmt":"2014-11-05T16:32:17","slug":"using-ssh-tunnel-to-make-my-desktop-appear-to-have-a-real-internet-address","status":"publish","type":"post","link":"https:\/\/www.dr-chuck.com\/csev-blog\/2013\/11\/using-ssh-tunnel-to-make-my-desktop-appear-to-have-a-real-internet-address\/","title":{"rendered":"Using SSH Tunnel to make my Laptop Appear to have a Real Internet Address"},"content":{"rendered":"<p>Sometimes I need to have a development version of a Sakai running with a real IP address on the real Internet.  For example to run the IMS Learning Tools Interoperability certification I need to have my Sakai accept web service callbacks form the IMS server.<\/p>\n<p>One way to do it is to run an Amazon EC2 instance but this is a pain.  I need to login a bunch of times to get all the windows I want and I cannot use any desktop apps.  And I need a big EC2 instance and need to install a bunch of stuff &#8211; yada yada &#8211; and I have all that stuff already on my desktop.<\/p>\n<p>So here is the procedure.<\/p>\n<p>First make the smallest possible Amazon EC2 Instance.   Make sure to open port 8080 on your instance.  Log in to the instance and edit the sshd configuration file:<\/p>\n<p><code>sudo vi \/etc\/ssh\/sshd_config <\/code><\/p>\n<p>Add or uncomment a line that says this:<\/p>\n<p><code>GatewayPorts yes<\/code><\/p>\n<p>Then restart sshd<\/p>\n<p><code>sudo \/etc\/init.d\/ssh restart<\/code><\/p>\n<p>Then log out of the server and set up your SSH tunnel:<\/p>\n<p><code> ssh -i .ssh\/zzz.pem -R 8080:localhost:8080 ubuntu@ec2-23-22-200-200.compute-1.amazonaws.com<br \/>\n<\/code><br \/>\nYou can double check that your server is accepting connections from the outside world:<\/p>\n<p><code>netstat -ntl<\/p>\n<p>Active Internet connections (only servers)<br \/>\nProto Recv-Q Send-Q Local Address           Foreign Address         State<br \/>\ntcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN<br \/>\ntcp        0      0 0.0.0.0:8080            <b>0.0.0.0:*<\/b>               LISTEN<br \/>\ntcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN<br \/>\ntcp6       0      0 :::22                   :::*                    LISTEN<\/code><\/p>\n<p>In Sakai, you add the following to your sakai.properties:<\/p>\n<p><code>serverUrl=http:\/\/ec2-23-22-200-200.compute-1.amazonaws.com:8080<br \/>\n<\/code><br \/>\nOnce your Sakai is up you should be able to navigate to<\/p>\n<p><code>http:\/\/ec2-23-22-200-200.compute-1.amazonaws.com:8080\/portal<\/code><\/p>\n<p>And viola &#8211; everything is running on your laptop but the server is on the internet with a real address.<\/p>\n<p><strong>Update: What you need to do for DigitalOcean<\/strong><\/p>\n<p>Blog Post: <a href=\"https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-set-up-ssh-tunneling-on-a-vps\" target=\"_blank\">https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-set-up-ssh-tunneling-on-a-vps<\/a><\/p>\n<p>Sakai Setting:<\/p>\n<p><code>serverUrl=http:\/\/do1.dr-chuck.com:8080<br \/>\n<\/code><\/p>\n<p>Code to restart SSHD:<\/p>\n<p><code>service ssh restart<\/code><\/p>\n<p>SSH Call:<\/p>\n<p><code>ssh  root@do1.dr-chuck.com -R 8080:localhost:8080<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Sometimes I need to have a development version of a Sakai running with a real IP address on the real Internet. For example to run the IMS Learning Tools Interoperability certification I need to have my Sakai accept web service callbacks form the IMS server. One way to do it is to run an Amazon [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-4263","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/posts\/4263","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/comments?post=4263"}],"version-history":[{"count":7,"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/posts\/4263\/revisions"}],"predecessor-version":[{"id":4618,"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/posts\/4263\/revisions\/4618"}],"wp:attachment":[{"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/media?parent=4263"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/categories?post=4263"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/tags?post=4263"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}