Raspberry Pi

How to access Raspberry Pi on PC through SSH

If accessing the Raspberry Pi from a PC is possible, then why would you need to acquire a full desktop for your Raspberry Pi device, you certainly want to save your money. You will need to think out of the box and using Raspberry Pi on just a single monitor won’t be a cheaper option when you have a PC where you can access the Raspberry Pi device using SSH.

SSH is a network protocol which allows you to remotely access your device terminal session from another device terminal. But does it really look like a simple process to just plug in the device with your PC, enabling the SSH and it will work for you. No, you will need to go through several steps in order to access the Raspberry Pi over SSH.

How to access Raspberry Pi through SSH

In this tutorial, we will show you how the process of accessing Raspberry Pi over SSH is done and it will become easy for you when you have done it once. There are two main methods you will need to undertake to access Raspberry Pi through SSH.

Creating an SSH file on boot

You can create an SSH file after preparing your SD card to boot into your Raspberry Pi device. To do it, place the SD card into the card reader and then put the card into the PC.

Step 1: Create an empty text file with the name “ssh”.

Step 2: Next, go to the “View” option and checkbox the “File Extension” option.

Step 3: Rename the ssh.txt file by removing the .txt extension, press enter and click on the “Yes” option.

As soon as you click it, your ssh file with no extension is created into your SD card.

Enabling the SSH from the Menu option of Raspberry Pi

If you have set up your Raspberry Pi desktop and you want to access the device from your PC then you should enable the SSH through the below given steps.

Step 1: Open the “Raspberry Pi Configuration” which you will find in the “Preferences” option.

Step 2: In the “Interfaces” option, enable the SSH there and then select OK”.

Step 3: Now reboot your Raspberry Pi device and your SSH will be enabled successfully.

Accessing Raspberry Pi from PC desktop

After creating or enabling the SSH, you will also need to do the following steps to access the Raspberry Pi on your PC desktop.

Step 1: After the reboot, you will need to find your device IP address and to do that open the terminal of your Raspberry Pi device and enter the below mentioned command in the terminal and it will provide you the IP address of your device.

$ hostname -I

Step 2: Open an SSH client on your PC and it is better to use PuTTY for that purpose. Open it, and add the hostname as “192.168.43.96”, Port 22, Connection type as SSH and click on “Open” to run it.

Step 3: Click on the “Accept” option.

Step 4: Now login as username “pi” and press enter.

Step 5: Enter raspberry pi login password. If you have not set the password yet, you will go with the default password as “raspberry”.

After entering the password, you will then be able to access the terminal of your Raspberry Pi device on PuTTY.

Step 6: In order to view the Raspberry Pi desktop, you will need to install a VNC server on Raspberry Pi and to do it, you will have to use the below mentioned command in the PuTTY terminal.

$ sudo apt-get install realvnc-vnc-server

Step 7: Go to the Raspberry Pi configuration using the below mentioned command.

$ sudo raspi-config

When you press enter, the Raspberry Pi configuration will open on PuTTY.

Step 8: Go to the “Interface Options”.

Step 9: Select the “VNC” option.

Step 10: Enable it by choosing the “Yes” option and it will enable the VNC on Raspberry Pi device.

Step 11: Now you will need to install a VNC viewer on PC and after successful installation , open the VNC viewer and enter the Host IP address of Raspberry Pi.

Step 12: When you press enter, you will see the login window of Raspberry Pi and you will need to enter username as “pi” and password which you have set during the initialization phase. If you haven’t set the password, then you can go with the default password and then select the “OK” option.

Step 13: After a few seconds, your Raspberry Pi desktop screen will appear on your VNC viewer.

Conclusion

Now, you have finally succeeded in finding a way to access your Raspberry Pi device on your PC screen through SSH even if you don’t have money to purchase a separate monitor, keyboard or mouse to set up a complete desktop for your device. You can easily enjoy the Raspberry Pi desktop anywhere at any time and for that you will just need to follow the above two methods to enable the SSH on Raspberry Pi device and the rest of the procedures will be done in a few minutes.

About the author

Awais Khan

I'm an Engineer and an academic researcher by profession. My interest for Raspberry Pi, embedded systems and blogging has brought me here to share my knowledge with others.