With a secure SSH connection, it is very easy to connect from a command line to a Raspberry Pi from another computer and even from a smartphone or tablet. By activating the secure SSH connection, you can access from any computer in your network and leave your Pi quietly in its box. Having an SSH connection is really handy, not to say mandatory if you want to program with Node-RED (add new packages without having to turn on the screen …), perform maintenance operations of a Home Automation server, update the linux distribution … quietly from your sofa.
Enable SSH connection on Raspbian
The easiest way to enable the SSH connection on Raspbian is to open the Raspberry Pi Configuration Utility found in Menu -> Preferences
In the interfaces tab, enable SSH
Restart the Pi for the change to take effect.
Once restarted, open a Terminal and run the ifconfig command. Locate the ip address of your Pi according to the connection you are using. If you are on WiFi, it is on the second line next to wlan0.
Access SSH from Mac OS X or Linux
On Mac OS X (or Linux), open a Terminal and run
If you have not changed the default password for the ft user, enter raspberry.
Another solution is to use the name of Raspberry which is automatically published on the local network (mDNS name) at startup by Raspbian. By default the name is raspberrypi.
The ssh command will be
Accessing SSH from Windows
To access your Pi from Windows, the simplest and use Putty, which is open-source and free. It is available here. This is a very simple program that does not require any. By default, the SSH connection uses port 22.
Impossible to connect
Changing the distribution is as simple as changing the SD card and restarting the Raspberry Pi. Yes, but Pi is probably going to keep the same IP address. In this case, the SSH connection will be refused because the authentication key is different (it is generated on the first connection). No problem, just go to the SSH installation directory and delete the known_hosts file.
On Mac OS X or Linux, it is located in the ~/.ssh directory
Then, to delete it, run the following command in the Terminal. Without the sudo, the command will be refused.
sudo rm known_hosts
On Windows, it’s a little more complicated. The key is stored differently depending on the software used. Putty, for example, stores the key in the registry under HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\SshHostKeys. To remove it, run regedit then make a search to locate it then right click (delete) to delete it.
From an iPhone or iPad
There are dozens of customers for iPhone and iPad. ITerminal is simple and does the job very well. It is funded by advertisements that are not too intrusive (just in a banner at the bottom of the screen). It keeps the list of the last servers to which you have connected. A tap on a line and the connection is done automatically, it’s pretty nice to use.
From an Android device
- New Raspberry Pi 3 Model B+ 2018 @1.4GHz, Gigabit Ethernet, Ethernet POE Daughter Card, Flash Sale at $49.99 on Gearbest
- Retrogaming Retropie Mini Console on Raspberry Pi 3 with 3.5 ” HDMI LCD Touch Screen
- #Test LCD 3.5” HDMI touch screen (via GPIO) with acrylic case for Raspberry Pi 3 under Raspbian (480×320 to 1920×1080 pixels)
- Install the Pixel Desktop on Raspbian Stretch Lite. 10 essential software for the Raspberry Pi 3
- Configure VNC on Raspbian to remotely access the Pixel desktop of the Raspberry Pi
- Make a DIY Recalbox or Retropie retro gaming arcade with joystick and 8 buttons for less than €85