SSH protocol can be very useful if we want to remote control our Raspberry Pi. I am using a Raspberry Pi A+ board in this video but you can use any Raspberry Pi board you like.
Want to learn to code?
👨💻 Check my new YouTube channel: https://bit.ly/3tku2n0
So far, when we wanted to use our Raspberry Pi, we were using a keyboard, a mouse and a monitor via the HDMI port, or a touch screen like this one. The second method is easier and portable. I have prepared a detailed tutorial on that touch screen display a few weeks ago, you can check it out. But if we want an even easier solution, we can use our desktop computer, or laptop, or even our cell phone to remotely control the Raspberry Pi. Check this out, I am running a terminal on my Android cell phone and I can execute commands on my Raspberry Pi. I will now run a simple program I wrote in order to light up this LED. Cool, isn't it? But very useful as well! Let's see how we can achieve that!
Secure Shell or SSH is a cryptographic network protocol to allow remote login to other network services to operate securely over an unsecured network. Using SSH we can remotely log in to a system and execute commands. In this case, the system we want to login to, is the Raspberry Pi. SSH protocol allows us to gain access to the command line of the Raspberry Pi from another computer, but only on the same network. Let's now see how to setup our systems in order to achieve that.
SHH is built into the Raspbian distribution that we are using, so all we have to do is to setup the network connection for our Raspberry Pi board. I am using a Raspberry Pi A+ today, but you can use any Raspberry Pi board you like. I replaced the big WiFi dongle I was using so far, with this tiny and cheap one I got from Gearbest.com. It is working fine and it is plug and play, there is no need to install anything at all. It makes things more compact. You can find a link for it in the description of the video. All we have to do now, is to boot our Raspberry Pi once and set up the WiFi password. Next we have to run the command sudo ifconfig in order to get the IP address of our Raspberry Pi. Note this address as we are going to need it. In my case the address is this 192.168.1.44. Most routers, assign a different IP address each time we connect our Raspberry Pi board to the network. So, we have to make the IP address of the Raspberry Pi a static one. In order to achieve that I logged in my routers settings page, and defined that I want my Raspberry Pi board to have a specific IP address, 192.168.1.44. Check your Router settings and see how to set your Raspberry Pi to have a static IP.