DEV Community

Cover image for Remotely Control Raspberry Pi via SSH
Shilleh
Shilleh

Posted on

Remotely Control Raspberry Pi via SSH

In this tutorial, you will be learning how to SSH into your Raspberry Pi from your local computer. SSH (Secure Shell), is a popular network protocol you can utilize to access a command line interface remotely on another computer via a network, thereby granting you access to control that computer and interact with it without having to plug it into a monitor or a keyboard, which can be incredibly useful for the Raspberry Pi at times where you do not feel like using peripherals. Thankfully it is very easy to set up and we will be doing this setup on a Raspberry Pi and a Mac.

Before reading the remainder, be sure to subscribe and support the channel if you have not!

Subscribe:

Youtube

Support:

https://www.buymeacoffee.com/mmshilleh

Remember you can purchase Raspberry Pi accessories at ShillehTek!

https://shillehtek.com/collections/all

Step 1-) Make sure your Pi and Computer are Connected

Your Raspberry Pi and Computer should be connected to the same local network or connected via ethernet. I am using wireless in this example just because I do not have an ethernet.

Step 2-) Enable SSH on Pi

Once you are logged in go to your Raspberry Pi Configuration as follows:

Image description

Image description

You can enable SSH by selecting the toggle item, and then clicking okay. Ignore the I2C one, you do not need that. Click OK and restart your Raspberry Pi; you can do this by opening the command line and typing 'sudo reboot'.

Step 3-) Get the SSH information you need.

You will need the IP address, username, and password of your system to SSH from your local computer.

First to get the IP address we open the command line on our Raspberry Pi and type the command 'ifconfig', which shows us the following.

Image description

Image description

You want to copy the IP Address by the inet value in the wlan0 section, mine is masked here for security purposes.

Next type the command 'whoami' in the command line as follows:

Image description

You will need this username later on. Of course, you will also need the password you use to login to the Pi itself.

Step 4-) Local Computer

On your Mac, you can open a Terminal window and now type the following command similar to mine.

Image description

ssh followed by your username@IP-Address

Type enter and it will prompt you for your password, and then ask if you want to enable RSA fingerprint, type yes.

Once that is done you should have access to your Raspberry Pi system remotely! It is very quick and secure to set this up and can be incredibly useful. Hope you got it to work.

Conclusion
Do not forget to subscribe and follow our blog on ShillehTek for the latest updates. Hope you enjoyed the tutorial let me know if you have any questions, please!

Top comments (0)