Enabling SSH

Secure Shell (SSH) is a feature of Linux that allows you to effectively open a terminal session on your Raspberry Pi from the command line of your host computer.

Recent versions of Rasbpian do not enable SSH access by default.  You can use an empty boot file or raspi-config, which you first saw back in Lesson 2

Using a blank boot file

For truly headless setups, if you can't ssh into your Pi you can't turn on ssh!

It's a bit of conundrum! But you can easily get around it by using a trick in Raspbian. To do so, we simply create a file called ssh. This file does not exist by default and needs to be created. It can be empty. The system looks for it at boot time and will enable ssh if it is there. It is then deleted. So just create a new file and save it as ssh to the boot folder. If you plug the SD card into your computer, just put that ssh file directly in the SD card director's root directory

Using Raspi-Config

In order to do this, open LX Terminal on your Pi and enter the following command to start Raspi Config:

sudo raspi-config

Scroll down to the “ssh” option, it might be under Interfaces or Advanced (they move it around)

Hit the Enter key and then select “Enable”

A script will run and then you will see the following as confirmation:

You will need to reboot your Pi to make the change permanent

Last updated on 2017-08-15 at 08.21.37 PM Published on 2012-12-20 at 08.18.17 AM