This commonly happens when firewall rules are applied without allowing the necessary incoming connections.
A VPS can be running perfectly while its firewall prevents you from accessing it.
Here's what you should check:
- Use the provider console: Access your VPS through its web console or recovery console if SSH is unavailable.
- Check firewall rules: Review the active rules using
ufw status or the appropriate firewall management tool.
- Allow SSH access: Make sure your actual SSH port is permitted before enabling the firewall.
- Allow website traffic: Normally, web servers need incoming TCP connections on ports
80 and 443.
- Check provider-level firewalls: Some VPS providers have an additional network firewall outside the operating system.
- Test before disconnecting: Keep your current SSH session open while testing a second connection after changing firewall rules.
One important precaution: never enable a restrictive firewall remotely without first confirming that your SSH access will remain available.