top of page

Remote Access to the Raspberry Pi

For remote access on the same network:

 

  1. Find the IP address of the Raspberry Pi

  2. Reserve the IP address so that it doesn’t change

  3. Type in ‘sudo passwd’ in CLI to change the superuser password to be more secure

  4. Type in ‘sudo raspi-config’

  5. Go to ‘Change User Password’ to make a more secure password

  6. Go to ‘Interfacing Options’

    1. Enable SSH for CLI access

    2. Enable VNC for GUI access

  7. Reboot the RPi

  8. on the computer, download VNC viewer from https://www.realvnc.com/en/connect/download/viewer/

  9. 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:

​

  1. Allow access to your RPi from the internet:

  2. Connect the RPi to your router

  3. On the router, record your current IP address and DNS server address

  4. Reserve the RPi’s DHCP IP address, so it doesn’t change (usually 192.168...)

  5. Use port forwarding to point to that IP address

    1. Port 22 for SSH (CLI access)

    2. Port 5900 for VNC (GUI access)

    3. You can enable both

 

  1. Setup a Dynamic IP domain because the IP number your ISP gives you may change:

  2. Go to noip.com and setup an account.  You will need to activate it by email.

  3. Remember the new domain name, your account user name, and your noip.com password

  4. Set it to the current IP address that you recorded in step A2

 

  1. Setup the Dynamic DNS client on the RPi:

  2. ‘sudo apt-get update’

  3. ‘sudo apt-get upgrade’                              # makes sure you are on the latest Raspbian version

  4. ‘sudo apt-get install ddclient libjson-any-perl’

    1. just skip through the install questions, we’ll be overwriting them later

  5. Copy the file ‘ddclient-3.8.3.tar’ to the Raspberry Pi

  6. ‘tar -xvf ddclient-3.8.3.tar’

  7. ‘sudo cp -f ddclient-3.8.3/ddclient /usr/sbin/ddclient’

  8. ‘sudo mkdir /etc/ddclient’

  9. ‘sudo mv /etc/ddclient.conf /etc/ddclient’

  10. ‘sudo nano /etc/ddclient/ddclient.conf’

    1. use=web, web=checkip.dyndns.com/, web-skip='IP Address'

    2. ssl=yes

    3. protocol=dyndns2

    4. server=dynupdate.no-ip.com

    5. login=your_username  [from B2]

    6. password=your_password  [from B2]

    7. your.domain.com  [from B2]

  11. ‘sudo /etc/init.d/ddclient restart’

 

  1. Look for an IP address update every week:

  2. ‘sudo nano /etc/default/ddclient’

    1. run_daemon="true"

    2. run_dhclient="false"

    3. run_ipup="false"

  3. ‘sudo service ddclient start’

  4. ‘sudo nano /etc/cron.weekly/ddclient’

    1. #!/bin/sh

    2. /usr/sbin/ddclient -force 

  5. ‘sudo chmod +x /etc/cron.weekly/ddclient’

  6. ‘sudo service ddclient status’                   # to check that it is working

  7. To force a refresh of the IP address, ‘sudo ddclient -daemon=0 -debug -verbose -noquiet’

 

  1. Enable remote access on the Raspberry Pi:

  2. ‘sudo passwd’ to change the superuser password to be more secure

  3. ‘sudo raspi-config’

  4. Go to ‘Change User Password’ to make a more secure password

  5. Go to ‘Interfacing Options’

    1. Enable SSH for CLI access

    2. Enable VNC for GUI access

  6. Reboot the RPi

 

  1. On your computer from where you want access the RPi:

  2. Download VNC viewer (GUI) or a Terminal Program (CLI)

  3. Enter the noip domain name you set up in step B2

  4. Log in as user ‘pi’ with your new password (step E2)

Remote Access

© 2017 by Prompt Box.

  • Facebook - Grey Circle
  • LinkedIn - Grey Circle
  • Google+ - Grey Circle
bottom of page