If you installed any of the Raspbian versions from late 2016 onwards, then SSH is disabled by default. The reason behind this decision was to improve security. Since all Raspbian images come with a user “pi” and the default password “raspberry,” it was easy for hackers to use this in their favour.
However, you can easily enable SSH on Raspberry Pi even if you do not have a monitor and keyboard connected. We will explain two possible ways to enable SSH on Raspbian. Read through the guide and choose the method that you prefer.
Enabling SSH with raspi-config
To enable SSH using the raspi-config tool:
1. Open the terminal on your Raspberry Pi and run the tool by typing:
A BIOS-looking raspi-config tool loads.
2. Use the arrows on your keyboard to select Interfacing Options.
3. Select the P2 SSH option on the list.
4. Select <Yes> on the “Would you like the SSH server to be enabled?” prompt.
5. Hit Enter on the “The SSH server is enabled” confirmation box.
6. Navigate down and select Finish to close the raspi-config.
You can close the terminal window. Your device is now ready to accept SSH connections.
Use systemctl to Enable SSH
The 2nd option to enable SSH on Raspberry Pi is to start the
systemctl service from your terminal.
To do so, load the terminal and run these two commands:
sudo systemctl enable ssh
sudo systemctl start ssh
The ssh service is now both enabled and started.