How to Access Raspberry Pi from PC

There are a few different types of accessing Raspberry Pi remotely. In this post I’ll introduce the following types:

  • SSH – Command-line
  • Samba (SMB) – File
  • VNC – Desktop

SSH

The first remote access you want to set up is command-line access. It is relatively easy to set up and all other remote access can be set up through this command-line.
That means you can remove keyboard, mouse and monitor from Raspberry Pi after this, and you can also copy/paste text from your PC.

Enable SSH

In order for Raspberry Pi to accept SSH, the SSH must be enabled.

  1. Start Raspberry Pi
  2. Open Raspberry Pi Configuration
  3. Edit Host Name (Your Pi Name)
  4. Enable SSH

Setup PuTTY

You also need a software on your PC in order to remote connect via SSH. PuTTY is one of them.

  1. Download PuTTY https://www.putty.org/
  2. Setup PuTTY
  3. Enter Host Name (Your Pi Name)
  4. Open SSH session

Now you can continue to configure the Raspberry Pi from your PC via SSH.

Samba

Samba allows you to share files between your PC and Raspberry Pi. This means you can edit files on a Pi using software on your PC. It also gives you an easy way to make a backup. (Next post about SD card backup)

  1. Install Samba to the Raspberry Pi
sudo apt-get install samba samba-common-bin

2. Select “Yes” to use WINS settings from DHCP
3. Edit smb.conf to add a shared folder

sudo nano /etc/samba/smb.conf

Add the following code at the bottom (replace “raspi0” with your Pi name) and save.

[RasPi0]
   comment = Raspi0  
   path = /home/pi            
   guest ok = no
   browseable = Yes
   writeable = Yes
   only guest = no
   create mask = 0777
   directory mask = 0777
   public = no

4. Set password for the “pi” user to access shared folder

sudo smbpasswd -a pi

5. Restart both the Raspberry Pi and the PC
6. Test access from PC by opening //Your Pi Name

You should be able to see files in Raspberry Pi similar to below.

I suggest restarting Raspberry Pi, PC and also your Router if you have any issue connecting before changing configurations.

VNC

VNC provides remote desktop access to your Raspberry Pi from your PC (or other devices) at home or even over the internet.

Although, most of the tasks can be done in command-line through SSH, you really feel a full control with VNC and no longer require a monitor connected to your Pi.

VNC can also be used as an easy way to remote access/control application with visual elements such as dashboards, buttons and video stream without having to setup a web server.

VNC can be enabled in the same way as SSH using on Raspberry Pi configuration:

  1. Start Raspberry Pi
  2. Open Raspberry Pi Configuration
  3. Enable VNC

Alternatively, you can use the command-line version of Raspberry Pi Configuration via SSH.

Now you need the VNC Viewer on your PC

4. Download VNC Viewer https://www.realvnc.com/en/connect/download/viewer/
5. Setup VNC Viewer
6. Use your Pi Name and connect

Again I suggest restarting Raspberry Pi, PC and also your Router if you have any issue connecting before changing configurations.

Other Tutorials
High-level Steps: Prepare a Micro SD Card Download Raspbian ImageFlash the SD CardStart Raspberry Pi and Configure Find Raspberry Pi ...
There are a few different types of accessing Raspberry Pi remotely. In this post I'll introduce the following types: SSH ...
When you experimenting with Raspberry Pi, you often wish to go back to a "clean" working state, especially after messing ...
Raspberry Pi itself already has a lot of potential but with Camera, it makes even more interesting. You can easily ...
OpenCV is an Open Source Computer Vision and Machine Learning software library.With a bit of Python programming, you can turn ...
Having a database comes in handy in some Raspberry Pi projects. SQLite gives you a lightweight database with Structured Query ...
LCD Screen is a much more effective way to communicate the current status with a user, compare to beeping sound ...
Although there are few options for wired audio out from Raspberry Pi, a wireless Bluetooth speaker may be useful for ...
Don't you love robotic voice coming out from Raspberry Pi?Pico Text-to-Speech engine will give Raspberry Pi ability to speak without ...
Raspberry Pi Zero has HDMI, Bluetooth and USB for potential Audio Outputs but it is missing PWM audio output compared ...