linux – ssh connection refused on Raspberry Pi
Apparently, the SSH server on Raspbian is now disabled by default. If there is no server listening for connections, it will not accept them. You can manually enable the SSH server according to this raspberrypi.org tutorial :
As of the November 2016 release, Raspbian has the SSH server disabled by default.
There are now multiple ways to enable it. Choose one:
From the desktop
Raspberry Pi Configurationfrom the
- Navigate to the
From the terminal with
sudo raspi-configin a terminal window
- Navigate to and select
Start the SSH service with
sudo systemctl enable ssh sudo systemctl start ssh
On a headless Raspberry Pi
For headless setup, SSH can be enabled by placing a file named
ssh, without any extension, onto the boot partition of the SD card. When the Pi boots, it looks for the
sshfile. If it is found, SSH is enabled, and the file is deleted. The content of the file does not matter: it could contain text, or nothing at all.
I think pi has ssh server enabled by default. Mine have always worked out of the box. Depends which operating system version maybe.
Most of the time when it fails for me it is because the ip address has been changed. Perhaps you are pinging something else now? Also sometimes they just refuse to connect and need a restart.