Raspberry Pi: Tutorial on the most secure way to connect to your Pi — Cloud Proxy Server

This is a continuation of my series on setting up Raspberry Pi to be a remote jupyter notebook code editor. In the last chapter Raspberry Pi was set up and could be accessed by SSH remotely. But I mentioned that using port forwarding on your home router to access your Pi is extremely dangerous. On raspberry Pi official documentation, it stated that rather than using port forwarding on your local router, there are a number of third-party online port forwarding services available, but without any detail on how to implement it. I hope you will find this article useful in setting one up yourself.

First time Pi user and first time reader? Check out the first and second part here.

Disclaimer: I do not receive any sponsorship from the third-party port forwarding service demonstrated in this article. In fact, I strongly encourage you to try out different service providers after you got the basic idea on how to implement one yourself. I have listed out a few other options at the end of this article. Cheers.

Table of Content

  • What’s third party port forwarding?
  • Basics setup with remote.it
  • What’s next: hosting jupyter notebook server on Raspberry Pi, and access it anywhere remotely

Cloud Proxy Server / Third party port forwarding

While different service providers might have different implementations, the main advantage of using a cloud proxy server is that users arenot required to forward any port from their local router, thus significantly reducting the network’s vulnerability.

Source: https://remote.it/rpi/

Using remote.it (one of the service provider), as an example, instead of opening a port from your home router and await incoming connection (which could be you or hackers), users could set up a VPN (remote.it put it as VPI, which is similar to VPN) between Pi and the cloud proxy server. Whenever users want to access the Pi later, user will actually connect to the cloud proxy server, which will be served to deliver data packages between Pi and users.

Check out more on https://docs.remote.it/peer-to-peer-p2p-vs.-proxy-connections

Set up cloud proxy server with remote.it

Source: https://remote.it/jp/resources/

I choose remote.it as demo because it is completely free, easy to configure and use, well documented and provide some handy features like emailing you whenever Raspberry Pi start-up and shut-down. Another great feature about remote.it is that it does not require users to install any client on their PC. Simply login the web portal anywhere with your Chrome / Safari (Or Internet Explorer you inglorious bastard) and you are good to access your Pi.

At the same time, remote.it has recently updated their package from connectd to remoteit , which obsoletes a lot of existing tutorials (even including the official remoteit youtube video). So I think it would be nice if we could have the most updated tutorial here (as of May 28, 2020)

Step 1: Sign up an account on remote.it

Here you go: https://app.remote.it/auth/#/sign-up

Step 2: Install remoteit on your Raspberry Pi

SSH into your Raspberry Pi (If you want to know how to SSH please check out my part-1 of the series), then run

sudo apt update
sudo apt install remoteit

Once its done, you will see the following output

====================================================================
Continue your device configuration at
http://find.remote.it
or http://raspberrypi.local:29999
or http://192.168.1.243:29999
====================================================================

Step 3: Add your Pi device to remote.it

Make sure ‘ssh’ option is selected here!

First, make sure your local PC is connected to the same wifi (LAN) as the Pi. Then visit http://find.remote.it, and you shall see there is one device discovered. Click Connect , and login with your new account.

You will then be directed to register a new device. In the device registration page, you will be ask to provided a name for the device. After filling in the device name, please make sure that “ssh” service is selected as we wish to ssh into the Pi remotely.

Step 4: Access your Pi anywhere

The setup is now finished! And you are ready to access your Pi anywhere (yes, even on a different lan/wifi!). Simply head to https://app.remote.it/, and login with your account. You shall see your Pi as one of the device on the welcome dashboard.

Landing page after you login https://app.remote.it/

Click the connect dropdown (The Green Button) and select “SSH”. Wait for a few seconds and you should see a pop-up box with an IP address and port number. This is the address for the cloud proxy server.

Now, Open your powershell from Window (if you are Mac/Unix then open your terminal), and simply run the ssh command shown in the pop-up box

And you are IN! Which means that going forward you just need to have a web-browser ready and you can connect to your Pi anywhere you want!

Here is the link to official documentation: https://docs.remote.it/

What’s next: hosting jupyter notebook on Pi, and access it anywhere remotely

What’s great about remote.it is that the SSH connection we demo today is only one of the many TCP-based protocols it supports. On the documentation it also confirms that http/https is also supported, meaning that user can host a jupyter notebook on their raspberry Pi, and configure a Generic TCP connection on remote.it. Then you can visit your own jupyter notebook anywhere! Stay tuned for the next and final chapter of the series!

Appendix: Other proxy service provider

Make great things with raspberry pi.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store