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 board 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
- Waveshare launches two Raspberry Pi 400 + 7″ or 13.3″ touchscreen bundles
- Motorized microscope with HQ camera for Raspberry Pi and HTML interface (Python)
- Drive a Nema 17 stepper motor with the RpiMotorLib Python library for A4988
- Open an HTML page when starting Raspberry Pi OS with Chromium Browser in full screen (kiosk mode)
- Pi Imager and the configuration wizard simplify the installation of Raspberry Pi OS (old Raspbian)