RT Cunningham

Blogging For As Long As I'm Able

Remote Services on My Raspberry Pi 400

Tagged with computers, linux, nemo, phone, raspberry pi, ssh, vnc, vpn on April 14, 2024

remote services Ever since I decided to use my Raspberry Pi 400 (“Pi” for short) for a future remote connection, I’ve been trying to figure out ways to exploit it for other things. I installed Nextcloud on it and almost immediately uninstalled it. It replaces services I don’t need replaced, and I don’t need a file server.

The services I’m now using on it are SSH, VPN, and VNC. I had to use “raspi-config” to enable SSH, since I had no need for it previously. I’m also using the Pi for storing backups, replacing the only thing I was using Google Drive for on my laptop computer. Although I could have installed everything directly on the Pi, I chose instead to work with SSH through my terminal.

VNC

I discovered that RealVNC offers three cloud connections for Raspberry Pi computers, after I went through the trouble of setting up a dynamic DNS service. The dynamic DNS service was a good idea anyway because I hate memorizing and typing out IP addresses. I now allow cloud connections, but not direct connections.

Although my account is protected by two-factor authentication, I don’t like having services exposed when I don’t need them. I disabled the VNC service, so I have to start it manually when I want to use it. Stopping is done manually as well. These are the commands I use, which I use the aliases of “vncstart” and “vncstop” for:

sudo systemctl start vncserver-x11-serviced
sudo systemctl stop vncserver-x11-serviced

I won’t need to use VNC very often, if I even use it at all. The service will remain off until I do.

I was tempted to disable the desktop environment, using “raspi-config”, but it only uses around 200 megabytes of memory.

VPN

While the SSH and VNC software comes with Raspberry Pi OS, there isn’t any VPN software included. Using the tutorial, “Build Your Own Raspberry Pi VPN Server”, I installed OpenVPN instead of WireGuard. Then I created two profiles, one for my laptop computer and one for my phone.

I used the Nemo file manager’s option to “Connect to Server” using SSH, mounting the Pi’s file system. I copied the “.opvn” files to my laptop computer and then used Linux Mint’s Warpinator application to transfer the appropriate one to my phone.

With Linux Mint’s Network Manager, all I had to do was to click on it, select “Network Connections”, click on the “+” button at the bottom of the dialog box, scroll down and click “Import a saved VPN configuration”.

With my Android phone, I had to install “OpenVPN Connect” from the Google Play store and then import the “.opvn” file I received from my laptop computer. To make sure the VPN worked, I switched my phone to mobile. Then I switched on the VPN client. The mobile IP address matched the Wi-Fi IP address, which meant it worked. I have to remember to turn it on if I use public Wi-Fi somewhere.

I have a NordVPN subscription that will expire next year, which I’m not going to renew.

Backups

I have a cron job updating the Internet IP address for the Pi at Duck DNS every five minutes. I have a cron job on my laptop computer syncing files to the Pi once an hour, using my Duck DNS subdomain name.

The only thing I’m using Google Drive for is photo and video backups on my phone. That’s all my wife, Josie, uses hers for as well. Neither of us takes that many photos, and we rarely make videos. Our daughter-in-law, Cathy, however, seems to be constantly taking photos and making videos. Her husband, my son Jon, pays about $100 a year for two terabytes of space with Google One.

Is there anything I’ve missed?

Image by Raspberry Pi

← Previous ArticleNext Article →