By Karol Burda
Hi, I have set up a different port for SSH(same way as it is described in the deprecated article) and custom firewall rule [TCP, all IP4/6] limited to the same port. I still can’t get connection[ssh: connect to host xx.xx.xx.xx port xxxx: Connection timed out]. What is the problem?
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!
To change the port ssh works on, edit /etc/ssh/sshd_config and edit the line “Port 22” to be a different port. Then restart sshd (“sudo service ssh restart”) You can then test whether ssh is working on that port with “ssh localhost -p 1234” or whatever your new port is.
If that works, but remotely doesn’t work it’s probably the firewall issue. How do you have your firewall set up? The firewall from Digital Ocean’s control panel? UFW? IPTables?
Helo LampreyOne,
Thanks a lot, for your tip. I’ve been blocked to acces my droplet after the FIREWAL installation. Then your solution was my salvation.
Sincerelly,
luciano viterbo
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.