IntroductionLast week I released a guide to setting up the Raspberry PI 2 Model B. Of course, as my age is kicking in, it obviously slipped my mind that I had already released another guide showing how to do the same thing back in March 2015. At least they both show how to do it in different ways.
The new guide simply shows how to install the latest version of Raspbian whereas the guide back in March showed how to install NOOBs.
In this guide I am also covering a bit of old ground but it is updated for the Raspberry PI 2.
Today's tutorial will show you how to connect to the Raspberry PI command line using Linux, Windows and Android.
Turn On The Raspberry PI SSH Server
The first step is to turn on the Raspberry PI. Hopefully you should see the Raspbian screen as shown above.
If your Raspberry PI boots straight to the command line type startx.
Click the menu in the top left of the screen, select preferences and then Raspberry PI Configuration.
The Raspberry PI Configuration settings screen will appear.
There are four tabs:
Take a note of the hostname on the system tab (or remember it if you can)
Also take a note of the auto login user (i.e. auto login as 'pi')
Click on the Interfaces tab.
The SSH option is the 2nd item down on the list. Make sure the "Enabled" radio button is selected.
If asked to do so reboot the Raspberry PI.
Connect Raspberry PI To The Internet
You will need to make sure the Raspberry PI is connected to a network. If you are at home connecting the Raspberry PI to the internet will achieve this aim.
Click on the network icon in the panel as shown in the image above and choose a wireless network to connect to. You will need to enter your wireless network's security key.
If your Raspberry PI is connected via ethernet cable you don't need to do this as it should already be connected.
SSH To The Raspberry PI 2 From LinuxTo connect to the Raspberry PI 2 from a computer running Linux such as Ubuntu, Mint, Elementary, Debian, Fedora etc open up a terminal window.
To connect to the Raspberry PI 2 enter the following command:
In the above command replace the word pi with the name of the user you use to connect to the Raspberry PI 2 and the hostname of your Raspberry PI 2.
A message may appear asking whether you want to continue. If it does type yes.
You will now be asked for your Raspberry PI password.
At this point you will now be logged in to the Raspberry PI from the command line and you can run command line software and scripts.
SSH To The Raspberry PI 2 From Windows 10Windows is supposed to be easier than Linux isn't it? Actually in this case it is a little bit more difficult.
Within Linux all you have to do is open a terminal and type ssh pi@raspberrypi. In Windows there isn't a default ssh client.
There is also the problem that it is more difficult to find the Raspberry PI or its IP address on the network.
The method I am going to show isn't the most efficient but it is the easiest.
First of all on your Raspberry PI open a terminal window. You can do this by clicking the 3rd icon on the panel along from the menu button. (the little computer symbol next to the file manager).
Now within the terminal type the following commands:
sudo apt-get update
sudo apt-get install samba
sudo reboot now
Wait for the Raspberry PI to reboot.
It is now time to get around to installing a tool for connecting via SSH to the Raspberry PI.
Open the Windows 10 Store (It is the little shopping bag icon on the panel).
Choose "SSH" as the type and type "raspberrypi" into the host (or your Raspberry PI's hostname that you wrote down earlier).
Enter "pi" as the username (or your Raspberry PI's username that you wrote down earlier).
Leave the authentication method as "Password".
SSH To The Raspberry PI From Android
Open the ConnectBot app.
Press the button to bring up the menu on your tablet or phone and select "settings".
Click on "Emulation Mode":
The options for emulation mode are as follows:
In the ssh box at the bottom type pi@raspberrypi
You will be asked if you want to continue due to the authenticity of the host not being established, Click "Yes".
Enter the Raspberry PI password.
You will now be connected via ssh to the PI.