CHEERSNetworkClimate & health

Home / Resources / Weather station

CHEERS technical resources · WindChaser

Setting Up the Communication with a Remote Server

WindChaser technical documentation: Setting Up the Communication with a Remote Server. Original instructions, component references and source limitations.

Original documentation: Min Tai Yap and Julian Walker · © 2025. Migrated to CHEERS on 3 December 2026. This is working documentation; unresolved source gaps remain visible.

Technical manual
On this page

In order to transmit the data to a remote server, we use the SCP protocol. To set up the connection, both the remote server and the Raspi have to be configured. Note that these are quite general steps for setting up a secure SCP communication. This doesn’t resemble our configuration on our remote servers and, for security reasons, we will not specify our configuration.

Setup on the Remote Server

We assume that your remote server is running on a Debian-based distribution. As a first step, install the OpenSSH server tools by

sudo apt update
sudo apt install openssh-server -y

and check if SSH is running

sudo systemctl status ssh

If you have just installed openssh-server, it is usually the case that the above status check will show the service to be inactive and disabled. If this is the case, execute

sudo systemctl start ssh
sudo systemctl start enable

Afterwards, check if the service is indeed running by executing the status check from above again. Next, disable SSH password authentification for better security. To do that, open the SSH deamon configuration file

sudo nano /etc/ssh/sshd_config

and add these lines to the config file if not already added

PermitRootLogin no
PasswordAuthentication no
AllowUsers username

to disable the password login and enable login only through the user username which must exist on the remote server (we also disable login as root user for security reasons). Note that adding these lines to the end of the file overwrites any previously existing configurations, so make sure they are in line with any other configuration on your remote server or adapt these configurations / the configuration for communication with the weather station. After changing these configurations, restart the SSH server by

sudo systemctl restart ssh

Next, create an ssh directory in the users home folder and set its access rights to the user

mkdir -p ~/.ssh
chmod 700 ~/.ssh

and create an authorized_keys file in the .ssh folder, in which you paste the public SSH key created by the sender

nano ~/.ssh/authorized_keys

Note that at this point in the setup, you may have not created a public SSH key yet. See below in the subsection Setup on the Raspberry Pi how to create the SSH key and directly send the public key to the remote server in case you don’t want . Optionally, you may also want to change the port the SSH server listens on for a slightly better protection against bot attacks. To do so, open the SSH daemon configuration file again

sudo nano /etc/ssh/sshd_config

and add the line

Port port

where port is the desired port your SSH server listens on. Note that if your server is located within a local network behind a router, this doesn’t affect security, as it does not change the external SSH port. If you are using a firewall on your server, you must also configure it to allow for SSH. For instance, if you are using ufw (uncomplicated firewall), allow SSH connections by

sudo ufw allow port/tcp
sudo ufw enable

where you replace port by the port specified in sshd_config. If it is the case that your server is located within a local network, you also need to setup port forwarding to be able to communicate via SCP. For that purpose, first determine the local ip address of your server, which should be static. For that purpose, execute

ip a | grep inet

and search for the ip address of the network interface with which the server is connected to the internet. Now log in to your router admin panel, which can be usually accessed under 192.168.1.1 and locate the Port Forwarding settings. There, forward an external port of your choice to the specified SSH port of your server under the previously specified local ip address. If you haven’t changed the SSH port in sshd_config, the port under which your SSH server listens to should remain 22 by default. Lastly, it is also important that you know the static global ip address of your server or the router your server is connected to. For that purpose, you can for example execute

curl -s https://api64.ipify.org

but there are also plenty of other web-based services to figure out your global IP address.

Setup on the Raspberry Pi

Head to your Raspi and create an SSH key pair. To do so, run

ssh-keygen -t rsa -b 4096 -f ~/path_to_folder/sv2_rsa

where you replace path_to_folder with the desired location. We recommend not using a passphrase. Next, copy the public key to the remote server’s authorized_keys by executing

ssh-copy-id -i ~/path_to_folder/sv2_rsa.pub -p port user@ip

where you replace port with the configured SSH port of your remote server, user with the corresponding user on your remote server, and ip with the public IP address of your remote server or your remote server’s network. If, for some reason, ssh-copy-id is not available, you can also manually paste the public key into the authorized_keys file by either executing

cat ~/path_to_folder/sv2_rsa.pub | ssh -p port user@ip "mkdir -p ~/.ssh && cat >> ~/.ssh/authorized_keys"

or pasting the public key into the authorized_keys by transferring it on a USB stick or etc.

Verifying the Successful SSH and SCP Connection

Finally, verify that everything works by sending a file from the Raspi to the remote server. First, create a small text file

nano /home/pi/verify.txt

and write some text of your choice. Then execute

scp -P port -i /path_to_folder/sv2_rsa /home/pi/verify.txt user@ip:/path_to_target_folder

where you replace port by the SSH port of your remote server, path_to_folder with the path to your public SSH key, user with the user on your remote server, ip with the global ip address of your remote server, and path_to_target_folder with the desired target directory on your remote server. Verify that the file has indeed been transmitted to your remote server and delete both files on your Raspi and the remote server.