Ubuntu ssh connection refused issue

This note addresses the solution to the connection rejection issue in attempting an SSH connection to the Ubuntu server.

First check if there is ssh between the allowed ports on the Ubuntu server.

sudo ufw status

To                         Action        From
--                           ------          ----
22/tcp                  ALLOW       Anywhere

If the error continues to be received even though the port is open, the best solution would be to delete and reinstall the pre-installed ssh server and client.

sudo apt-get remove openssh-server openssh-client --purge && sudo apt-get autoremove && sudo apt-get autoclean && sudo apt-get update
sudo apt-get install openssh-server openssh-client

Leave a Comment