When I change the Port in /etc/ssh/sshd_config I get “Connection refused” error. When Port is 22 I can connect to server without any problems. How to fix it?
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
For others that have this problem: Try using the IP address. I had just transferred the domain to cloudflare and cloudflare blocks everything except http/s traffic. To fix that, use the IP address directly or add a ssh.example.com entry to your DNS records. Or just use your local ~/.ssh/config to set your Host setting to your IP.
Don’t forget firewalls:
up
Click below to sign up and get $100 of credit to try our products over 60 days!
After changing the ssh port are you restarting your ssh service?
Unless the service is restarted the changes to your configuration will not take effect.
I have the same problem. SSH works on port 22, but on other port. I use a LAMP droplet. Did you manage to find an answer?
This comment has been deleted
I don’t use firewall, It is a new droplet. I follow step by step of this tutorial and earlier all work properly.
Did you open the new port your using in your firewall?
Of course, I restart ssh but it has not affected.