Difference between revisions of "Shell remote access through Internet"

From ArmadeusWiki
Jump to: navigation, search
(creation)
 
(serveo.net)
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
Sometimes we want to have our embedded system plug somewhere with Internet access and connect to it from a remote place without having to configure servers/box/NAT/proxy/what you want tricky. This page will explain how to do this with Shell In a Box and serveo.net
+
[[Category:Network]]
 +
[[Category:IoT]]
 +
 
 +
Sometimes we want to have our embedded system plug somewhere with Internet access and connect to it from a remote place without having to configure servers/box/NAT/proxy/"what you want tricky". This page will explain how to do this with ''Shell In a Box'' and ''serveo.net''.
  
 
==Shell In A Box==
 
==Shell In A Box==
Line 35: Line 38:
 
<pre class="apf">
 
<pre class="apf">
 
# ip addr show eth0 | grep inet    (to get IP @ of your board)
 
# ip addr show eth0 | grep inet    (to get IP @ of your board)
# shellinabox
+
 
 +
# shellinaboxd -c /tmp -u root -t -b
 
</pre>
 
</pre>
  
Line 46: Line 50:
 
<pre class="apf">
 
<pre class="apf">
 
# ping google.com
 
# ping google.com
 +
 +
PING google.com (172.217.19.238): 56 data bytes
 +
64 bytes from 172.217.19.238: seq=0 ttl=54 time=34.964 ms
 +
...
 
</pre>
 
</pre>
 
* If not, this tutorial will end up now for you ;-).
 
* If not, this tutorial will end up now for you ;-).
 
* Then ask serveo.net to create a tunnel with a permanent www @ with following command:
 
* Then ask serveo.net to create a tunnel with a permanent www @ with following command:
 
<pre class="apf">
 
<pre class="apf">
# ssh -R -L localhost:4200 toto@serveo.net
+
# ssh -R armadeus-apf28:80:localhost:4200 serveo.net
 +
 
 +
(serveo.net will reply to you with following, confirming you the domain you requested:)
 +
Forwarding HTTP traffic from https://armadeus-apf28.serveo.net
 
</pre>
 
</pre>
  
* Testing: now from a PC outside your local network, you can open a browser and point it to : https://toto.serveo.net
+
* Testing: now from a PC outside your local network, you can open a browser and point it to : https://armadeus-apf28.serveo.net
  
 
* Tada !
 
* Tada !
 +
 +
[[Image:Shell_in_a_box_on_APF28.png]]

Latest revision as of 15:06, 2 August 2019


Sometimes we want to have our embedded system plug somewhere with Internet access and connect to it from a remote place without having to configure servers/box/NAT/proxy/"what you want tricky". This page will explain how to do this with Shell In a Box and serveo.net.

Shell In A Box

  • First we will install this small tool on our system. It is a small web server that allow client to connect to our system with Internet browser, making them think they are using a SSH connection. For more informations: https://code.google.com/archive/p/shellinabox/
  • shellinabox tool is packaged in Buildroot, so all we hav to do is to select it, rebuild our rootfs and reflash it on our system:
$ make menuconfig
...
Target packages  --->
    ...
    Networking applications  --->
        ...
        [*] shellinabox
        ...
$ make
$ cp buildroot/output/images/xxx-rootfs.xxx /tftpboot
BIOS> run update_rootfs
  • then reboot your system and login as usual.
  • to quickly test shellinabox:
# ip addr show eth0 | grep inet    (to get IP @ of your board)

# shellinaboxd -c /tmp -u root -t -b

Then from a browser on your host you can access https://192.168.1.5:4200

serveo.net

  • Previous instructions gave us a way to access our system from the local network. We will now see how to deal with the Internet.
  • serveo.net is a free service (for personnal use) that allow you to create SSH tunnels with WWW access without installing anything on your client (it should at least have a SSH client installed, like any Armadeus SOM).
  • First check you system has Internet access:
# ping google.com

 PING google.com (172.217.19.238): 56 data bytes
 64 bytes from 172.217.19.238: seq=0 ttl=54 time=34.964 ms
 ...
  • If not, this tutorial will end up now for you ;-).
  • Then ask serveo.net to create a tunnel with a permanent www @ with following command:
# ssh -R armadeus-apf28:80:localhost:4200 serveo.net

 (serveo.net will reply to you with following, confirming you the domain you requested:)
 Forwarding HTTP traffic from https://armadeus-apf28.serveo.net
  • Tada !

Shell in a box on APF28.png