SSH (Secure Shell) is a protocol for accessing remote machines over the network. With this technology we can connect our Raspberry Pi to our Android smartphone or tablet to control it. Thanks to SSH we will have access to the RPI console from anywhere...
The procedure is not at all complicated and can offer us many alternatives, such as controlling our Raspberry Pi remotely via our mobile phone wherever we are.
What do we need?
- Raspberry Pi. (Buy it in our shop)
- Have an Internet connection to connect the Raspberry Pi.
- An Android mobile device (smartphone or tablet PC).
- ConnectBot App for Android.
We start with the Raspberry Pi already assembled and configured, as well as connected to a WiFi or wired network so that it has access to the Internet.
The first thing we are going to do is enable SSH on our Rasperry Pi and for this we access the Raspbian OS terminal and write the following line:
Now, after pressing INTRO to execute the above command, the configuration window of Raspbian OS. Within it we must go to the eighth option, that is, Advanced Options we will access it. Once inside, we move to the fourth option, that is to say, SSH and finally we enable SSH Server (enable). Well, we have already enabled the SSH service on the Raspberry Pi.
The next step is to get to know our IP addressbecause it is necessary to access remotely to our Raspberry Pi. If we do not know it, which is the most normal, we can get it with the following procedure that I explain. First we access the terminal and type this:
Now we are presented with a series of data that will probably sound a bit like Greek to us. If we look in the field wlan0 (if you have a wireless network) or eth0 (in the case of Ethernet cable), we will see that a field appears called inet addr:XXX.XXX.X.X.Xwhere X is a numeric digit. For example, 192.168.1.3 would be a hypothetical IP address. Make a note of it as you will need it for later steps.
We have finished with our miniPC board and now we are going to set up our Android device. The first thing to do is to access Google Play and download the application ConnectBotwhich is free of charge.
Once the application is installed, we run it and the first thing we will see is a series of screens explaining how it works and providing some information about the app. We have to click on Next, Next... to get to the main screen.
Once inside, we will see that at the bottom of the application there is a field that says user@host:port. At user type in your Raspberry Pi user name (if you don't remember it, when you open the terminal it will appear in the PROMTi.e. the standard text name@raspberrypi ~$ which appears), followed by the @ and the host, in which we must enter the IP address that we had previously obtained from our Raspberry Pi. Note that if the Raspberry Pi changes network you must repeat the procedure to find out the new address, as this depends on your connection. Finally, in port the default port is included which is usually the 22. In other words, in the end it will look something like this (in my case):
And now it will ask for the password or password of our Raspbian session. After entering it we will have access via SSH to the miniPC from anywhere and using this simple app, enjoy it!
If you want to have all our Raspberry Pi tutorials at hand, don't forget to save this link.
Buy - Raspberry Pi components and accessories
More information - Raspberry Pi, how to set up and configure it step by step