Accessing Raspberry Pi services via the Internet
Installation
For this article, I'm assuming you already have a home network set up. If you have the Raspbian or minimal Raspbian (Minibian) [8] distribution installed on your Rasp Pi, you should look for the necessary weavedconnectd package in the repositories and install it from there (Listing 1, line 2).
Listing 1
Installation
01 ### Installation under Raspbian/Minibian 02 $ sudo apt-get update && sudo apt-get install weavedconnectd 03 ### Manual Installation 04 $ wget https://github.com/weaved/installer/blob/master/Raspbian deb/1.3-02/weavedconnectd-1.3-02.deb 05 $ sudo dpkg -i weavedconnectd-1.3-02.deb 06 $ sudo weavedinstaller
If you're using an Ubuntu-based ARM distribution, such as Ubuntu Mate or Snappy Ubuntu Core, you should first download the package from GitHub and install it via the command line (lines 4 and 5). The next step is to call the Weaved installer (line 6). During the setup process, it asks for your login data and for the Rasp Pi services, which should be accessible from outside the network.
The setup also asks for a name for the service. You should carefully select and remember the name: It will be used later for calling the services. In this example, I selected the name NAS-Pi to avoid any confusion among the multiple Rasp Pis that were put to use. Then, I activated SSH, which does not necessarily have to be attached to the default port 22 (Figure 2).
Connecting
At the end of this procedure, the name of your device will appear when you call the URL http://developer.weaved.com from the web browser. You can now activate the device via a mouse click (Figure 3).
The Weaved web interface then displays a value pair and a command for the command line (Figure 4). You should add both values to an SSH application (e.g., PuTTY). Use the following command-line example in the console:
ssh -l <Login> proxy<No>.yoics.net -p <Port>
Here, you should also substitute your Raspberry Pi username for <Login>
. The number appearing after proxy
and the port number will vary with each login. After entering the password, you can use the Rasp Pi from outside the network just as you would operating inside the network.
In addition to SSH (port 22), HTTP (port 80), and VNC (port 5901), services can be defined on randomly chosen ports. The SSH service established earlier already allows FileZilla and WinSCP to move files.
For example, in FileZilla, this is done by entering the proxy acquired for SSH (proxy<No>.yoics.net) in the server field. You should specify SFTP as the protocol, in which case, the entire URL reads sftp://proxy54.yoics.net. In this example, you would specify the port 32340. WinSCP follows a similar procedure.
« Previous 1 2 3 4 Next »
Buy this article as PDF
Pages: 4
(incl. VAT)