There are three most common reasons behind this error:
The most common reason behind this error is that in most cases the OpenSSH has not been installed on the client machine to which you are trying to connect. For the verification of this OpenSSH package installed on the client machine, use the command in the client machine:
The output is showing the package is not installed, so we will install it using the command:
Now if the error is because of this issue, then it should be resolved.
Another reason behind this error is that the service of the SSH server is not active, and we can confirm the status of the service of SSH by using the command:
To activate the service, we will again use the systemctl utility with its start option:
Now again check the status of the service:
Lastly, problem is that the ssh service is linked with some other port instead of port 22, to confirm this, we will use the command:
In our case, the port is set 22 which is default but if there is some other port showing then you will use the following port number, for example, if it is port 44, then we will use the command:
Most Ubuntu users have to face the issue of “Connection refused by port 22” which is of different reasons discussed in this article. Not only the reasons but the solutions to resolve those problems to fix the error of “Connection refused by port 22” are being explained.
At Canonical, the work of our teams is strongly embedded in the open source principles…
Welcome to the Ubuntu Weekly Newsletter, Issue 873 for the week of December 29, 2024…
Have WiFi troubles on your Ubuntu 24.04 system? Don’t worry, you’re not alone. WiFi problems…
The following is a post from Mark Shuttleworth on the Ubuntu Discourse instance. For more…
I don’t like my prompt, i want to change it. it has my username and…
Introduction: A Fragile Trust The Ruby ecosystem relies heavily on RubyGems.org as the central platform…