Connecting To The Raspberry PI via SSH

To remotely access the Raspberry PI through your personal computer, we will access the shell of the raspberry pi through SSH.

To setup ssh on your raspberry pi, look here.

Assuming that you have already setup a name and a password on your rasberry pi, first look up your local ip address using the following command in the terminal.

ifconfig

Make sure your raspberry pi and your computer are connected to the same network.

From your personal computer, open your terminal and enter this command to connect via ssh.

ssh -X yourusername@yourip

for instance

ssh -X aupp@10.30.0.207

input your password and you'll be connected.

Programming Environment (optional)

We'll use jupyter on the Raspberry PI. We host the server on its private ip and access it on your personal pc.

Installing Jupyter

pip install jupyter

Hosting The Server On Your IP

python3 -m jupyter lab . --ip <your_LAN_ip> --port 8888

For example, if your private ip is 10.30.0.207 and you want to host it on port 8888

python3 -m jupyter lab . --ip 10.30.0.207 --port 8888

you'll be given with a link like this:

http://10.30.0.207:8888/tree?token=a0cd659ac70086a9beb5cd3ca4d323ab733ec17c9f031805

Paste it into your personal computer and you'll have access to the files on the rapsberry pi remotely.

Setting up a remote desktop connection using NoMachine

NoMachine is a free remote desktop service for non-commercial and personal use.

Installing NoMachine on the raspberry pi

Install NoMachine on the raspberry pi using their official guide (install the .deb package and use dpkg to install the .deb package)

On the raspberry pi, check that the NoMachine server is running via the following command:

systemctl status nxserver

If it isn't running, start the server

systemctl enable nxserver

Installing NoMachine on your personal computer

Install NoMachine on your personal desktop using their guide (methods differ across different systems).

Once installed, if on linux, navigate to /usr/NX/bin and execute nxplayer to launch the NoMachine player.

/usr/NX/bin/nxserver

Click on your rapsberry pi and login.