# Ensure SSH (port 22) is not open to the internet

- Source: https://support.icompaas.com/support/solutions/articles/a_1796390894239847-ensure-ssh-port-22-is-not-open-to-the-internet
- Section: [Solutions](https://support.icompaas.com/support/solutions) › [Hostinger](https://support.icompaas.com/support/solutions/c_1796390637084781) › [Hostinger Checks](https://support.icompaas.com/support/solutions/folders/f_1796390648370879)
- Last updated: 2026-12-04
- Publisher: iCompaas, Inc. (https://www.icompaas.com)

**Description**

This check ensures that no Hostinger VPS firewall rule accepts SSH traffic (the SSH application, or TCP port 22) from any source. A rule is treated as open to the internet when its source is any, 0.0.0.0/0 or ::/0. Rules for all ports or port ranges that include 22 are also counted. Each firewall in the account is evaluated separately.

**Rationale**

SSH open to the whole internet is constantly targeted by automated brute-force and credential-stuffing attacks and by exploits against SSH vulnerabilities. Allowing SSH only from trusted IP addresses (an office, a VPN or a bastion host) removes this exposure while keeping administrative access.

**Impact**

-   Only the listed IP addresses can connect over SSH. Administrators on changing IP addresses need a VPN or bastion host with a fixed IP
    
-   Add the restricted SSH rule before removing the open one, so you do not lock yourself out
    
-   If SSH runs on a non-standard port, apply the same restriction to that port; this check looks at port 22
    
-   If you are locked out, open Settings for the VPS in hPanel and use Reset firewall
    

**Default Value**

A new firewall has no rules and drops all incoming traffic. SSH is open to the internet only if an accept rule for SSH or port 22 is added with the source Anywhere.

**Pre-Requisites**

-   Access to hPanel for the account that owns the VPS
    
-   The fixed public IP addresses or CIDR ranges that need SSH access
    

**Remediation**

**Test Plan**

1.  Log in to hPanel at https://hpanel.hostinger.com.
    
2.  Go to VPS and click Manage next to the server.
    
3.  In the left sidebar, select Security → Firewall.
    
4.  Click the ⋯ button next to the firewall and select Edit.
    
5.  Review the rules. If an accept rule for SSH (or TCP port 22, or all ports) has the source Anywhere, the check fails.
    
6.  Repeat for each firewall in the account.
    

**Implementation Steps**

1.  Log in to hPanel at https://hpanel.hostinger.com.
    
2.  Go to VPS and click Manage next to the server.
    
3.  In the left sidebar, select Security → Firewall.
    
4.  Click the ⋯ button next to the firewall and select Edit.
    
5.  Add a new accept rule: Protocol SSH, Traffic source Custom, and Source details set to the trusted IP or CIDR (for example 203.0.113.10/32). Click Add rule. Add one rule per trusted address.
    
6.  In the rule list, remove the rule that allows SSH from Anywhere.
    
7.  Click Apply changes.
    
8.  From a trusted address, confirm you can still connect over SSH.
    

**Backout Plan**

1.  Log in to hPanel at https://hpanel.hostinger.com.
    
2.  Go to VPS and click Manage next to the server.
    
3.  In the left sidebar, select Security → Firewall.
    
4.  Click the ⋯ button next to the firewall and select Edit.
    
5.  Add an accept rule for SSH with the Traffic source Anywhere, then click Apply changes.
    

**Note:** Opening SSH to the internet makes the server vulnerable to brute-force attacks again; do this only if strictly needed.

**Reference**

-   [https://www.hostinger.com/support/8172641-how-to-use-a-managed-vps-firewall-at-hostinger/](https://www.hostinger.com/support/8172641-how-to-use-a-managed-vps-firewall-at-hostinger/)
