Different ways to enable SSH server on Raspbian Stretch

When you have an SSH server running on your operating system, you will be able configure it remotely. Since the SSH server is such a convenient tool, Raspbian Stretch comes with an SSH server.

When you are looking for a way to configure your Raspberry Pi without attaching a keyboard to it, enabling SSH server on Raspbian Stretch is a viable way.

Given that, this post discusses some ways for us to enable SSH server on Raspbian Stretch.

Enabling SSH server on Raspbian Stretch at the first run

Undeniably, the best way to enable SSH server on Raspbian Stretch is when it runs for the first time. In order to do so, create a file named ssh in the root directory of your microSD card right after you install Raspbian Stretch. For example, this is how to setup Raspbian Stretch Lite with SSH server enabled on your microSD card.

Enabling SSH server on Raspbian Stretch via the windowing system

Even if you did not enable the SSH server on Raspbian Stretch at the first run, there are still chances for you to enable it.

When you have a HDMI monitor and a mouse connected to your Raspberry Pi, you can enable SSH server via the windowing system.

First, click on the Raspberry Pi icon at the top left corner and navigate to Preferences -> Raspberry Pi Configuration:

Raspbian Stretch 20181113 with Raspberry Pi Configuration highlighted

After you had done so, the Raspberry Pi Configuration program will appear:

Raspbian Stretch 20181113 with Raspberry Pi Configuration program with System tab selected

Next, click on the Interfaces tab and you will see the interfacing options for your Raspberry Pi. Given that, click on the Enable option for SSH:

Enabling SSH with Raspberry Pi Configuration program on Raspbian Stretch 20181113

After you click Ok, the SSH server will be enabled on your Raspbian Stretch.

Enabling SSH server on Raspbian Stretch via raspi-config

When you have a keyboard, a HDMI monitor and a mouse and a HDMI monitor connected to your Raspberry Pi, you can also use raspi-config to enable SSH server.

First, open a Terminal window by clicking on the highlighted icon at the top:

Raspbian Stretch 20181113 desktop with a terminal window

Once the terminal window had started, type the following command in the terminal window:

sudo raspi-config

Raspbian Stretch 20181113 terminal window with sudo raspi-config

After raspi-config loads in your terminal, go through the following screens to enable SSH server on your Raspbian:

raspi-config on Raspbian Stretch 20181113 with Interfacing Options selected

raspi-config on Raspbian Stretch 20181113 with SSH selected

raspi-config on Raspbian Stretch 20181113 with Yes selected for confirmation to enable SSH server

raspi-config on Raspbian Stretch 20181113 with confirmation message that SSH server had been enabled

After you had gone through the above screens, the SSH server on your Raspbian Stretch will be enabled.

About Clivant

Clivant a.k.a Chai Heng enjoys composing software and building systems to serve people. He owns techcoil.com and hopes that whatever he had written and built so far had benefited people. All views expressed belongs to him and are not representative of the company that he works/worked for.