
Remote Access to the Raspberry Pi

For remote access on the same network:
-
Find the IP address of the Raspberry Pi
-
Reserve the IP address so that it doesn’t change
-
Type in ‘sudo passwd’ in CLI to change the superuser password to be more secure
-
Type in ‘sudo raspi-config’
-
Go to ‘Change User Password’ to make a more secure password
-
Go to ‘Interfacing Options’
-
Enable SSH for CLI access
-
Enable VNC for GUI access
-
-
Reboot the RPi
-
on the computer, download VNC viewer from https://www.realvnc.com/en/connect/download/viewer/
-
Create a new connection in the VNC viewer by clicking file -> new connection. A screen will pop up for you to enter your Raspberry Pi IP address and password.
​
For remote access on a different network:
​
-
Allow access to your RPi from the internet:
-
Connect the RPi to your router
-
On the router, record your current IP address and DNS server address
-
Reserve the RPi’s DHCP IP address, so it doesn’t change (usually 192.168...)
-
Use port forwarding to point to that IP address
-
Port 22 for SSH (CLI access)
-
Port 5900 for VNC (GUI access)
-
You can enable both
-
-
Setup a Dynamic IP domain because the IP number your ISP gives you may change:
-
Go to noip.com and setup an account. You will need to activate it by email.
-
Remember the new domain name, your account user name, and your noip.com password
-
Set it to the current IP address that you recorded in step A2
-
Setup the Dynamic DNS client on the RPi:
-
‘sudo apt-get update’
-
‘sudo apt-get upgrade’ # makes sure you are on the latest Raspbian version
-
‘sudo apt-get install ddclient libjson-any-perl’
-
just skip through the install questions, we’ll be overwriting them later
-
-
Copy the file ‘ddclient-3.8.3.tar’ to the Raspberry Pi
-
‘tar -xvf ddclient-3.8.3.tar’
-
‘sudo cp -f ddclient-3.8.3/ddclient /usr/sbin/ddclient’
-
‘sudo mkdir /etc/ddclient’
-
‘sudo mv /etc/ddclient.conf /etc/ddclient’
-
‘sudo nano /etc/ddclient/ddclient.conf’
-
use=web, web=checkip.dyndns.com/, web-skip='IP Address'
-
ssl=yes
-
protocol=dyndns2
-
server=dynupdate.no-ip.com
-
login=your_username [from B2]
-
password=your_password [from B2]
-
your.domain.com [from B2]
-
-
‘sudo /etc/init.d/ddclient restart’
-
Look for an IP address update every week:
-
‘sudo nano /etc/default/ddclient’
-
run_daemon="true"
-
run_dhclient="false"
-
run_ipup="false"
-
-
‘sudo service ddclient start’
-
‘sudo nano /etc/cron.weekly/ddclient’
-
#!/bin/sh
-
/usr/sbin/ddclient -force
-
-
‘sudo chmod +x /etc/cron.weekly/ddclient’
-
‘sudo service ddclient status’ # to check that it is working
-
To force a refresh of the IP address, ‘sudo ddclient -daemon=0 -debug -verbose -noquiet’
-
Enable remote access on the Raspberry Pi:
-
‘sudo passwd’ to change the superuser password to be more secure
-
‘sudo raspi-config’
-
Go to ‘Change User Password’ to make a more secure password
-
Go to ‘Interfacing Options’
-
Enable SSH for CLI access
-
Enable VNC for GUI access
-
-
Reboot the RPi
-
On your computer from where you want access the RPi:
-
Download VNC viewer (GUI) or a Terminal Program (CLI)
-
Enter the noip domain name you set up in step B2
-
Log in as user ‘pi’ with your new password (step E2)
![]() |
---|