Info Security Memo
  • Blog
  • Sitemap
    • Categories
  • Contact
  • About
  • Resources
  • Tools
  • 51sec.org

Build Confidence

Focusing on Information Security 

Info Security Notes

Remote Access Raspberry Pi from Anywhere

10/29/2015

0 Comments

 
After installed Raspberry Pi in your environment with Internet connection with my previous post, next step for Pi lover is how to configure your Pi so you can control it from anywhere you go. 
  • Raspberry Pi 2 Model B Basic Configuration 1
  • Raspberry Pi 2 Model B Basic Configuration 2
From the research by Google, I found there are two websites providing free service to remote access your Pi from anywhere through Internet.

1. Weaved, Inc.

Weaved provides your Raspberry any TCP based service you want to make available remotely – securely and without port forwarding!• SSH on port 22• Web (http) on port 80• WebIOPI on port 8000 (Raspberry Pi only)• VNC on port 5901• Custom TCP service on any port you like

Multiple services can be installed on same box, also there is free iOS app which can set up your Pi to send you push notifications.

The homepage says it adds the power of remote connections & mobile to your Raspberry Pi in as little as 15 minutes. 

1.1 Manually Installation Procedure



pi@raspberrypi ~ $ wget https://github.com/weaved/installer/raw/master/binaries/weaved-nixinstaller_1.2.13.bin
--2015-10-06 12:45:16--  https://github.com/weaved/installer/raw/master/binaries/weaved-nixinstaller_1.2.13.bin
Resolving github.com (github.com)... 192.30.252.129
Connecting to github.com (github.com)|192.30.252.129|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://raw.githubusercontent.com/weaved/installer/master/binaries/weaved-nixinstaller_1.2.13.bin [following]
--2015-10-06 12:45:19--  https://raw.githubusercontent.com/weaved/installer/master/binaries/weaved-nixinstaller_1.2.13.bin
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 199.27.76.133
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|199.27.76.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 303036 (296K) [application/octet-stream]
Saving to: `weaved-nixinstaller_1.2.13.bin'

100%[=============================>] 303,036      665K/s   in 0.4s  

2015-10-06 12:45:23 (665 KB/s) - `weaved-nixinstaller_1.2.13.bin' saved [303036/303036]

pi@raspberrypi ~ $ chmod +x weaved-nixinstaller_1.2.13.bin
pi@raspberrypi ~ $ ./weaved-nixinstaller_1.2.13.bin
Extracting Weaved Software into /home/pi
Finished extracting

You are running installer script Version: v1.2.13
Last modified on February 26, 2015, by Mike Young.

Now launching the Weaved connectd daemon installer...
.
We have detected an arm7l processor.
Is this a Raspberry Pi 2? [y/n] y
Detected platform type: pi
Using /var/log/syslog for your log file

Checking for compatibility with Weaved's network...

Checking if DNS works ... .[OK]

Checking TCP connectivity to weaved.com...<oip=192.168.2.250> [OK]

Send to 174.36.235.146:5960 [] [mip=216.165.201.211] [oport=59612 mport=59612] [no remap] [preserve port] [OK]

Congratulations! Your network is compatible with Weaved services.


*********** Protocol Selection Menu ***********
*                                             *
*    1) SSH on default port 22                *
*    2) Web (HTTP) on default port 80         *
*    3) WebIOPi on default port 8000          *
*    4) VNC on default port 5901              *
*    5) Custom (TCP)                          *
*                                             *
***********************************************

Please select from the above options (1-5):
1
You have selected: 1.

The default port for SSH is 22.
Would you like to continue with the default port assignment? [y/n] y
We will install Weaved services for the following:

Protocol: ssh
Port #: 22
Service name: Weavedssh22



Please enter your Weaved Username (email address):
[email protected]

Now, please enter your password:
Copied notify.sh to /usr/bin
Copied notify_Weavedssh22.sh to /usr/bin
Copied weavedConnectd to /usr/bin
startweaved.sh copied to /usr/bin
no crontab for root
no crontab for root




Your device UID has been successfully provisioned as: 80:00:00:05:46:00:52:0F.

Pre-registration of UID: 80:00:00:05:46:00:52:0F successful.


We will now register your device with the Weaved backend services.
Please provide an alias for your device:
jrasp
Your device will be called jrasp.

Registering Weaved services for Weavedssh22 ................


Starting Weavedssh22...
WeavedConnectd built Feb 26 2015 at 10:53:39 Now Starting Up
   Version 2.11 - (c)2015 Weaved, Inc. All Rights Reserved
   Built with UPNP NATPMP ALIGN BCASTER MALLOC_POOL LINUX RESOLVE BIGBUF pool=262144
   Weaved Development Kit Version based on    Rasberry Pi Version
config file /etc/weaved/services/Weavedssh22.conf
Starting up as daemon
PID file specifed as /var/run/Weavedssh22.pid
setting web config port to dest_server_port 80




**************************************************************************
CONGRATULATIONS! You are now registered with Weaved.
Your registration information is as follows:

Device alias:
jrasp

Device UID:
80:00:00:05:46:00:52:0F

Device secret:


The alias, Device UID and Device secret are kept in the License File:
/etc/weaved/services/Weavedssh22.conf

If you delete this License File, you will have to re-run the installer.

**************************************************************************


Starting and stopping your service can be done by typing:
"sudo /usr/bin/Weavedssh22.sh start|stop|restart"
pi@raspberrypi ~ $






By click your device name, Weaved website will give you a new host name and ports for you to do remote connection from anywhere on Internet.



1.2 use apt-get to do auto installation

sudo apt-get update
sudo apt-get install weavedconnectd
sudo weavedinstaller
.
//after entered required information, it will list all registed services
// You will be prompted a menu to choose what you intend to do
=========================================================
Protocol        Port    Service         Weaved Name
=========================================================
TCP             3389    xrdp            xrdp-pi
SSH             22      sshd            jrasp-ssh


********************** Main Menu ************************
*                                                       *
*       1) Attach/reinstall Weaved to a Service         *
*       2) Remove Weaved attachment from a Service      *
*       3) Exit                                         *
*                                                       *
*********************************************************

Please select from the above options (1-3):



2. Dataplicity

If your Raspberry Pi is connected to the internet, you can access it via Dataplicity from anywhere through Internet. You can even connect to devices behind firewalls without needing complex network configurations. Dataplicity connects using client-initiated HTTPS, so it's safe, encrypted and you don't need to make specific firewall exceptions. Dataplicity's homepage says only 60 seconds you can have your Pi to be ready for controlling from anywhere. Of course, it will take longer than 60 seconds but you will not wait more than 5 minutes. Here are all outputs with my test:


login as: pi
[email protected]'s password:
Linux raspberrypi 3.18.7-v7+ #755 SMP PREEMPT Thu Feb 12 17:20:48 GMT 2015 armv7                                                                                                                       l

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Sat Oct 10 10:18:58 2015 from 192.168.2.120
pi@raspberrypi ~ $ curl -s https://dataplicity.com/1c7196e9.sh | sudo sh
Welcome to the Dataplicity Shell Quick Install
This may take up to 15 minutes on some systems, but often < 30 seconds

 [step 1 of 5] updating system...
Selecting previously unselected package python-medusa.
(Reading database ... 77461 files and directories currently installed.)
Unpacking python-medusa (from .../python-medusa_1%3a0.5.4-7_all.deb) ...
Selecting previously unselected package python-pkg-resources.
Unpacking python-pkg-resources (from .../python-pkg-resources_0.6.24-1_all.deb)                                                                                                                        ...
Selecting previously unselected package python-meld3.
Unpacking python-meld3 (from .../python-meld3_0.6.5-3.1_armhf.deb) ...
Selecting previously unselected package supervisor.
Unpacking supervisor (from .../supervisor_3.0a8-1.1+deb7u1_all.deb) ...
Setting up python-medusa (1:0.5.4-7) ...
Setting up python-pkg-resources (0.6.24-1) ...
Setting up python-meld3 (0.6.5-3.1) ...
Setting up supervisor (3.0a8-1.1+deb7u1) ...
Starting supervisor: supervisord.
Processing triggers for python-support ...
Selecting previously unselected package libossp-uuid16.
(Reading database ... 77687 files and directories currently installed.)
Unpacking libossp-uuid16 (from .../libossp-uuid16_1.6.2-1.3_armhf.deb) ...
Selecting previously unselected package uuid.
Unpacking uuid (from .../uuid_1.6.2-1.3_armhf.deb) ...
Processing triggers for man-db ...
Setting up libossp-uuid16 (1.6.2-1.3) ...
Setting up uuid (1.6.2-1.3) ...
Preconfiguring packages ...
(Reading database ... 77701 files and directories currently installed.)
Preparing to replace libssl1.0.0:armhf 1.0.1e-2+rvt+deb7u14 (using .../libssl1.0                                                                                                                       .0_1.0.1e-2+rvt+deb7u17_armhf.deb) ...
Unpacking replacement libssl1.0.0:armhf ...
Preparing to replace libexpat1:armhf 2.1.0-1+deb7u1 (using .../libexpat1_2.1.0-1                                                                                                                       +deb7u2_armhf.deb) ...
Unpacking replacement libexpat1:armhf ...
Selecting previously unselected package libexpat1-dev.
Unpacking libexpat1-dev (from .../libexpat1-dev_2.1.0-1+deb7u2_armhf.deb) ...
Selecting previously unselected package libssl-dev.
Unpacking libssl-dev (from .../libssl-dev_1.0.1e-2+rvt+deb7u17_armhf.deb) ...
Selecting previously unselected package libssl-doc.
Unpacking libssl-doc (from .../libssl-doc_1.0.1e-2+rvt+deb7u17_all.deb) ...
Selecting previously unselected package python2.7-dev.
Unpacking python2.7-dev (from .../python2.7-dev_2.7.3-6+deb7u2_armhf.deb) ...
Selecting previously unselected package python-dev.
Unpacking python-dev (from .../python-dev_2.7.3-4+deb7u1_all.deb) ...
Processing triggers for man-db ...
Setting up libssl1.0.0:armhf (1.0.1e-2+rvt+deb7u17) ...
Setting up libexpat1:armhf (2.1.0-1+deb7u2) ...
Setting up libexpat1-dev (2.1.0-1+deb7u2) ...
Setting up libssl-dev (1.0.1e-2+rvt+deb7u17) ...
Setting up libssl-doc (1.0.1e-2+rvt+deb7u17) ...
Setting up python2.7-dev (2.7.3-6+deb7u2) ...
Setting up python-dev (2.7.3-4+deb7u1) ...
 [step 2 of 5] installing Dataplicity Core...
id: dataplicity: No such user
/tmp/tmpYpFshT/pip.zip/pip/_vendor/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriatly and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
/tmp/tmpYpFshT/pip.zip/pip/_vendor/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriatly and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
  python-psutil
0 upgraded, 1 newly installed, 0 to remove and 93 not upgraded.
Need to get 54.4 kB of archives.
After this operation, 264 kB of additional disk space will be used.
Get:1 http://mirrordirector.raspbian.org/raspbian/ wheezy/main python-psutil armhf 0.5.1-1 [54.4 kB]
Fetched 54.4 kB in 10s (5,203 B/s)
Selecting previously unselected package python-psutil.
(Reading database ... 79253 files and directories currently installed.)
Unpacking python-psutil (from .../python-psutil_0.5.1-1_armhf.deb) ...
Setting up python-psutil (0.5.1-1) ...
Processing triggers for python-support ...
 [step 3 of 5] installing Dataplicity...
 [step 4 of 5] registering device 'raspberrypi'...
 [step 5 of 5] starting service...

Dataplicity Shell is now installed!
Your device will be online in a few seconds
Visit https://dataplicity.com/devices/ to manage your device

pi@raspberrypi ~ $ Restarting supervisor: supervisord.



After installed the Dataplicity package, you can log in to Dataplicity, select the device you want and access your remote shell. It's that simple! 

Your devices page at Dataplicity Site before installed package




Your Raspberry device shows in the Your devices page


Just click your device name, your browser will show you your Raspberry session. 








Reference:



  • Weaved Inc
  • Dataplicity
  • Element 14 Community



0 Comments



Leave a Reply.

    Categories

    All
    Architecture
    Blog
    Checkpoint
    Cisco
    Cloud
    CyberArk
    F5
    Fortigate
    Guardium
    Juniper
    Linux
    Network
    Others
    Palo Alto
    Qualys
    Raspberry Pi
    Security
    SIEM
    Software
    Vmware
    VPN
    Wireless

    Archives

    March 2024
    February 2024
    January 2024
    December 2023
    November 2023
    October 2023
    September 2023
    August 2023
    July 2023
    June 2023
    May 2023
    April 2023
    March 2023
    February 2023
    January 2023
    December 2022
    November 2022
    October 2022
    September 2022
    August 2022
    July 2022
    June 2022
    May 2022
    April 2022
    March 2022
    February 2022
    January 2022
    December 2021
    November 2021
    October 2021
    September 2021
    August 2021
    July 2021
    June 2021
    May 2021
    April 2021
    March 2021
    February 2021
    January 2021
    December 2020
    November 2020
    October 2020
    September 2020
    August 2020
    July 2020
    October 2019
    September 2019
    June 2019
    July 2018
    May 2018
    December 2017
    August 2017
    April 2017
    March 2017
    January 2017
    December 2016
    November 2016
    October 2016
    September 2016
    August 2016
    July 2016
    June 2016
    May 2016
    April 2016
    March 2016
    February 2016
    January 2016
    December 2015
    November 2015
    October 2015
    September 2015
    August 2015
    July 2015
    June 2015
    May 2015
    April 2015
    March 2015

    Print Page:

    RSS Feed

    Email Subscribe
Powered by Create your own unique website with customizable templates.
  • Blog
  • Sitemap
    • Categories
  • Contact
  • About
  • Resources
  • Tools
  • 51sec.org