Remote Access with remote.it - SteveCossy/IOT GitHub Wiki

remote.it is a service offering secure remote access to computers using a proxy server which the target machine sets up. In this guide I am considering adding the remote.it service to a 64-bit Raspberry Pi which sets up the proxy server each time it boots.

Remote.it has a downloads page covering all options. We need the section for adding the service to an existing Pi.

For the example in this document, follow the instructions on this page.. Note that the only service you need is ssh.

Once remote.it is installed, you can access it from this page. Click the refresh icon in the top right. If the target Pi is connected to the Internet and running OK, then the 'OFFLINE' status will change to bright blue 'CONNECTED'. Click the blue box then 'Secure Shell Connection'. This will give you some options for connecting to your Pi. Copy the line that is something like: ssh -l pi proxy71.rt3.io -p 36023and paste it into your favourite ssh command line client. The easiest to find on a Windows system is the Windows Command Prompt. Linux and Mac have a native command line. There are numerous other clients that can be downloaded.

I have a remote Pi that uses a USB dongle to connect to the Internet. After sending data the entire system is powered off. I've added a delay to the startup script that enables this, so I have a few minutes to log in. It a user is logged in, the machine doesn't shut down and power off. sleep $LOGINWAIT # give myself some more time to log in if I want to! userList=`users` if [ ${#userList} != "0" ] # More than zero users logged in then       sudo echo date +%y%m%d%H%M $userList Logged in - aborting script >> $StatusLog else       sudo echo date +%y%m%d%H%M Shutting down >> $StatusLog #   sudo poweroff       python3 /home/pi/IOT/LoRaReAd/switchOff.py fi https://github.com/SteveCossy/IOT/blob/master/bash/startup.sh

One function I want is to be able to retrieve data files from the remote machine. To do this, I log in (to stop the target Pi being shut down): ssh -l pi proxy71.rt3.io -p 36023 then from a different Linux machine where I keep my log backups: scp -P 36023 [email protected]:/home/pi/trafficlogs/skinkpi-210117.log /home/cosste/skinkpi/trafficlogs/ You will probably be asked to confirm the identity of the remote machine.

Remote.it provide an excellent Debugging and Support page.

Running remoteit at the command line gives a good summary of options.

Remote.it is started (and can be stopped or disabled) using systemctl: sudo systemctl status remoteit-headless sudo systemctl status it.remote.cli.service

Some other systemctl commands found useful: systemctl --help sudo systemctl list-units