Report this

What is the reason for this report?

Why SSH works only on the standard port?

Posted on April 21, 2015

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?



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

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:

  • UFW firewall rules on server.
  • Server Pilot Firewall
  • Local Firewalls ( antivirus, windows)

up

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.