Budget-friendly, full-performance, fully equipped servers in any desired location.
ExploreBudget-friendly, full-performance, fully equipped servers in any desired location.
ExploreFirewall configuration determines which connections a server accepts, but an incorrect rule can also cut off administrative access. For safe implementation, first distinguish the provider’s network security layer from the operating system firewall, preserve your existing SSH or management connection, allow necessary traffic by source address and port, and then repeat the same connection afterward to verify the result using new, time-stamped logs.
This guide is for a Linux VPS or physical server that can be accessed through an administrative shell. On a shared hosting account, you cannot change the operating system firewall; you can use only the IP blocking, application security, or provider rules offered in the hosting panel. On managed servers, however, the network firewall in the provider’s control panel and tools such as ufw, firewalld, or nftables on the server may evaluate the same traffic one after another.
First, record the following information in writing: the management protocol and port, the ports used by the web application, the sources that need database access, the addresses of monitoring or backup systems, and your current client IP address. Instead of allowing unrestricted public access to the management port, limit it to a fixed office, VPN, or management-network address whenever possible. If the source address is not fixed, verify in advance that the provider console or another recovery access method works.
If a connection is blocked by the provider’s firewall and never reaches the operating-system rule, the expected entry may not appear in the server logs. Conversely, the local firewall can drop a connection even when the provider allows the port through. Therefore, do not change only one layer and assume that the other layer has not changed the outcome.
ss -tulpen. Do not automatically treat every listening port shown in the output as a port that should be exposed to the internet. Compare it with the service settings and architecture to determine whether the service really needs external access or is used only by a local application. If a port does not need to listen, securely stopping the service may be more appropriate than adding a firewall rule.If only an externally initiated SSH connection fails while the website works, the problem is probably not with the web ports but with the source scope of the management port or the priority at one of the layers. First check that the client IP has not changed. If it has changed, add the new trusted address in a controlled way instead of broadening the old single-address rule without restriction. If the web service also fails, examine the port permission at the provider layer, the local firewall, and whether the service is actually listening, each separately.
Suppose an application server needs to connect only to a database on a private network, while administrators use SSH over a VPN. If external web access is required, the web ports can remain publicly accessible; define the database port to allow only the application server’s private address, and SSH to allow only the VPN network. If the application server’s address changes, the existing rule may interrupt the connection. The safe correction is to verify the new address, update the rule, and remove the old address only after proving that it is no longer in use.
A connection that appears successful does not, by itself, prove that the rule has the correct scope. Test the application with a real usage scenario: check the HTTP status of a web request, confirm that an SSH session can be opened, and for application-to-database communication, check for a new application success or error entry. The time in the firewall log must match the test time; do not treat old entries as evidence of the new result.
If the symptom continues, roll back the latest rule before changing another layer, using the previous backup or the recorded value. Especially if management access has been cut off, use the provider console; completely disabling the firewall, turning off security controls, or granting broad permissions is not a safe recovery method. If the connection is restored after the previous setting is returned, reconsider only the immediately preceding change and test it again with a narrower scope.
The purpose of the rules is not to make unused ports invisible, but to define expected traffic explicitly while limiting unnecessary access. After the initial implementation, make a brief record of the port, source address, reason, and time of the last verification. For additional guidance about server management or the network layer, you can review the relevant resources on the İyibirNet home page.
Copyright © 2026 All Rights Reserved
