{"id":53874,"date":"2022-05-05T13:12:54","date_gmt":"2022-05-05T13:12:54","guid":{"rendered":"\/tutorials\/?p=53874"},"modified":"2026-03-09T19:18:35","modified_gmt":"2026-03-09T19:18:35","slug":"vps-security","status":"publish","type":"post","link":"\/ng\/tutorials\/vps-security","title":{"rendered":"16 VPS security tips to prevent attacks on your server"},"content":{"rendered":"<?xml encoding=\"utf-8\" ?><p>Knowing how to secure your Linux virtual private server is important to avoid cyber threats. However, this is not a one-time task &ndash; in addition to applying the best security practices, you must always monitor your virtual private server (VPS).<\/p><p>In this article, we will dive deeper into Linux security and its common vulnerabilities. We will also discuss 16 VPS security tips to prevent cyber attacks on your virtual server.<\/p><div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><a href=\"https:\/\/assets.hostinger.com\/content\/tutorials\/pdf\/Linux-Commands-Cheat-Sheet.pdf\"><img loading=\"lazy\" decoding=\"async\" width=\"2048\" height=\"566\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/11\/Linux-cheat-sheet.png\/public\" alt=\"\" class=\"wp-image-69262\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/11\/Linux-cheat-sheet.png\/w=2048,fit=scale-down 2048w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/11\/Linux-cheat-sheet.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/11\/Linux-cheat-sheet.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/11\/Linux-cheat-sheet.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/11\/Linux-cheat-sheet.png\/w=768,fit=scale-down 768w\" sizes=\"auto, (max-width: 2048px) 100vw, 2048px\" \/><\/a><\/figure><\/div><p>\n\n\n\n<\/p><h2 class=\"wp-block-heading\" id=\"h-linux-security-and-common-weaknesses\">Linux security and common weaknesses<\/h2><p>While Linux VPS security is generally robust, it does have some weaknesses. Many cyber threats can compromise your Linux server&rsquo;s security and data. Here are the most common ones:<\/p><ul class=\"wp-block-list\">\n<li><strong>Malware <\/strong>&ndash; intrusive software intentionally designed to harm computers and their operating systems. It comes in many forms, including Trojans, ransomware, viruses, and spyware.<\/li>\n\n\n\n<li><strong>Sniffing attack<\/strong> &ndash; a cyber attack that happens when a hacker uses packet sniffers to intercept and extract data from a network.<\/li>\n\n\n\n<li><strong>Brute-force attack <\/strong>&ndash; a hacking method involving an attacker who uses trial and error to guess login credentials.<\/li>\n\n\n\n<li><strong>SQL injection <\/strong>&ndash; an attack that occurs when a hacker exploits code in a web application to gain access to the server&rsquo;s database.<\/li>\n\n\n\n<li><strong>Cross-site scripting (XSS) <\/strong>&ndash; a client-side attack during which a hacker injects malicious code into a website.<\/li>\n\n\n\n<li><strong>No function-level control <\/strong>&ndash; when the access rights to a server aren&rsquo;t verified properly, giving unauthorized users root privileges.<\/li>\n\n\n\n<li><strong>Broken authentication <\/strong>&ndash; identity theft that happens due to unencrypted data, weak passwords, or poorly configured application session timeouts.<\/li>\n<\/ul><p>Before implementing any security measures, learn the crucial elements you should monitor in your virtual private server, which include:<\/p><ul class=\"wp-block-list\">\n<li>VPS hosting security<\/li>\n\n\n\n<li>Server software<\/li>\n\n\n\n<li>SSH connection<\/li>\n\n\n\n<li>Root access and logins<\/li>\n\n\n\n<li>Passwords and credentials<\/li>\n\n\n\n<li>Firewalls<\/li>\n\n\n\n<li>FTP connection<\/li>\n\n\n\n<li>User rights and privileges<\/li>\n\n\n\n<li>Server logs<\/li>\n<\/ul><h2 class=\"wp-block-heading\" id=\"h-16-vps-security-tips-to-protect-your-server-security\">16 VPS security tips to protect your server security<\/h2><p>This section contains 16 security tips for preventing cyber attacks on VPS hosting.<\/p><h3 class=\"wp-block-heading\" id=\"h-1-research-your-web-hosting-security\">1. Research your web hosting security<\/h3><p>Your VPS hosting provider must have a strong security infrastructure and offer additional protection to keep your server safe. While users can install extra security features, some are pre-configured.<\/p><p>Depending on the provider, the security features will differ. At Hostinger, we apply comprehensive security practices for all our <a href=\"\/ng\/vps-hosting\">virtual machine hosting plans<\/a> to ensure optimal safety, including:<\/p><ul class=\"wp-block-list\">\n<li><strong>Web application firewall<\/strong> &ndash;<strong> <\/strong>a dedicated security feature that analyzes and filters incoming requests based on predefined security rules. It adds extra protection to your server, ensuring only legitimate and secure traffic reaches your websites.<\/li>\n\n\n\n<li><strong>Suhosin PHP hardening <\/strong>&ndash; a module that fortifies your PHP applications against vulnerabilities that cyber criminals often exploit to launch an attack. It also patches PHP flaws to help reduce the risk of successful hacking attempts.<\/li>\n\n\n\n<li><strong>PHP open_basedir protection <\/strong>&ndash; a security measure that restricts PHP script access to specific directories only. It helps prevent unauthorized access to sensitive files and mitigate potential security breaches.<\/li>\n\n\n\n<li><strong>BitNinja&rsquo;s full-stack server protection <\/strong>&ndash; a suite of security solutions with various modules for IP reputation, malware detection, and proactive defense mechanisms. It provides complete protection for your VPS against various cyber threats.<\/li>\n\n\n\n<li><strong>Advanced DDoS mitigation <\/strong>&ndash; a distributed denial-of-service (DDoS) attack sends malicious internet traffic to slow down your entire server performance. <a href=\"\/blog\/how-hostinger-deals-with-ddos-attacks\">Hostinger mitigates DDoS<\/a> using the remotely triggered black hole (RTBH) and traffic filtering.<\/li>\n\n\n\n<li><strong>Monarx anti-malware <\/strong>&ndash; a security tool that continuously scans your VPS for malware, suspicious files, and potentially malicious activities. It helps ensure your server is safe without needing to manually scan it.<\/li>\n\n\n\n<li><strong>Secure sockets layer (SSL) <\/strong>&ndash; SSL certificates encrypt data transmission between your website and its visitors. It helps prevent hackers from stealing sensitive data from the network.<\/li>\n<\/ul><p><div class=\"protip\">\n                    <h4 class=\"title\">Suggested Reading<\/h4>\n                    <p>Check out our guide on <a href=\"\/ng\/tutorials\/how-to-install-ssl-certificate-on-centos-7\">how to install SSL certificate on Linux running CentOS 7<\/a>.<\/p>\n                <\/div>\n\n\n\n<\/p><p>Furthermore, Hostinger offers automated backups and live snapshots for easy data restoration in case of cyber attacks or other incidents.<\/p><p>All of this is made easy with managed VPS security, which is recommended to most users. It means the provider handles all your hosting server security features, updates outdated software, and scans for malware. It keeps your VPS server secure with minimal effort.<\/p><p>However, advanced users that want more flexibility and control over their VPS security can still benefit from Hostinger&rsquo;s self-managed hosting. Users get root access to the VPS servers &ndash; plus, we offer a dedicated technical support team for assistance.<\/p><?xml encoding=\"utf-8\" ?><figure class=\"wp-block-image size-large\"><a class=\"hgr-tutorials-cta hgr-tutorials-cta-vps-hosting\" href=\"\/ng\/vps-hosting\" target=\"_blank\" rel=\"noreferrer noopener\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"300\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/02\/VPS-hosting-banner.png\/public\" alt=\"\" class=\"wp-image-77934\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/02\/VPS-hosting-banner.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/02\/VPS-hosting-banner.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/02\/VPS-hosting-banner.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/02\/VPS-hosting-banner.png\/w=768,fit=scale-down 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure><h3 class=\"wp-block-heading\" id=\"h-2-change-the-default-ssh-port\">2. Change the default SSH port<\/h3><p>If you still use port 22 to access your virtual server via an SSH connection, hacking attempts may be more likely. This is because attackers can scan open ports to perform brute-force attacks and obtain SSH access to the remote server.<\/p><p>We recommend changing your default SSH listening port to protect your data against automated attacks. Here&rsquo;s <a href=\"\/ng\/tutorials\/how-to-change-ssh-port-vps\">how to change the SSH port<\/a>:<\/p><ol class=\"wp-block-list\">\n<li>Open <strong>Terminal <\/strong>and log in to SSH.<\/li>\n\n\n\n<li>Run the following command to edit the service configuration file:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">nano \/etc\/ssh\/sshd_config<\/pre><ol start=\"3\" class=\"wp-block-list\">\n<li>Locate the line that reads <strong>Port 22<\/strong>.<\/li>\n\n\n\n<li>Replace <strong>22 <\/strong>with a new port number and remove <strong>#<\/strong>.<\/li>\n<\/ol><div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><a href=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2022\/06\/SSHport1026-1.png\"><img loading=\"lazy\" decoding=\"async\" width=\"328\" height=\"126\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/06\/SSHport1026-1.png\/public\" alt=\"The new SSH port in the SSHD configuration file\" class=\"wp-image-56372\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/06\/SSHport1026-1.png\/w=328,fit=scale-down 328w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/06\/SSHport1026-1.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/06\/SSHport1026-1.png\/w=150,fit=scale-down 150w\" sizes=\"auto, (max-width: 328px) 100vw, 328px\" \/><\/a><\/figure><\/div><ol start=\"5\" class=\"wp-block-list\">\n<li>Save the changes and exit.<\/li>\n\n\n\n<li>Enter the following command to restart the service:<\/li>\n<\/ol><ul class=\"wp-block-list\">\n<li><strong>For Debian and Ubuntu<\/strong><\/li>\n<\/ul><pre class=\"wp-block-preformatted\">service ssh restart<\/pre><ul class=\"wp-block-list\">\n<li><strong>For CentOS and Red Hat Enterprise Linux (RHEL)<\/strong><\/li>\n<\/ul><pre class=\"wp-block-preformatted\">systemctl restart sshd.service<\/pre><ol start=\"7\" class=\"wp-block-list\">\n<li>Log in to SSH using the new port to check if the changes were applied successfully.<\/li>\n<\/ol><h3 class=\"wp-block-heading\" id=\"h-3-disable-root-login\">3. Disable root login<\/h3><p>Linux VPS has a root user that possesses the most privileges on the operating system and can modify any aspect of the server. Cyber criminals might target this user to gain full access to the server.<\/p><p>Deactivating this account helps improve root access security, safeguarding your server from brute-force attacks. However, we recommend creating an alternative username with the privilege to execute root-level commands for server configuration purposes.<\/p><p>Follow the steps below to disable root login:<\/p><ol class=\"wp-block-list\">\n<li>Open <strong>Terminal <\/strong>and log in to your SSH account.<\/li>\n\n\n\n<li>To open and edit the configuration file, run the following command using the <strong>nano<\/strong> or <strong>vi <\/strong>text editor:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">nano \/etc\/ssh\/sshd_config<\/pre><ol start=\"3\" class=\"wp-block-list\">\n<li>Find the following parameter and change it to <strong>no <\/strong>to disable the root login:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">PermitRootLogin=no<\/pre><ol start=\"4\" class=\"wp-block-list\">\n<li>Run the following commands to save the changes and restart the SSH service:<\/li>\n<\/ol><ul class=\"wp-block-list\">\n<li><strong>For Debian and Ubuntu<\/strong><\/li>\n<\/ul><pre class=\"wp-block-preformatted\">service ssh restart<\/pre><ul class=\"wp-block-list\">\n<li><strong>For CentOS and Red Hat Enterprise Linux (RHEL)<\/strong><\/li>\n<\/ul><pre class=\"wp-block-preformatted\">systemctl restart sshd.service<\/pre><h3 class=\"wp-block-heading\" id=\"h-4-use-strong-passwords\">4. Use strong passwords<\/h3><p>Passwords containing information about your identity or simple passphrases are easy to guess. To prevent successful brute-force attacks, create a long and complicated password with several elements, such as numbers and special characters.<\/p><p>You can use tools like <a href=\"https:\/\/nordpass.com\/password-generator\/\" target=\"_blank\" rel=\"noreferrer noopener\">NordPass<\/a> to easily create and store strong passwords. These <a href=\"\/ng\/tutorials\/top-it-tools\">IT tools<\/a> provide various customization options, such as limiting the password length and the used characters.<\/p><p>Don&rsquo;t use the same password for more than one account, and remember to change it regularly, ideally <a href=\"https:\/\/www.mcafee.com\/learn\/how-often-should-you-change-your-passwords\/\" target=\"_blank\" rel=\"noreferrer noopener\">once every three months<\/a>. In addition, avoid sharing login credentials for accounts with root privileges to prevent unauthorized server modification.<\/p><h3 class=\"wp-block-heading\" id=\"h-5-start-using-ssh-keys\">5. Start using SSH keys<\/h3><p>If you&rsquo;re only using a password to log in, you may become the target of sniffing attacks. To avoid this, use <a href=\"\/ng\/tutorials\/ssh\/how-to-set-up-ssh-keys\">SSH keys<\/a> instead of a password for VPS authentication.<\/p><p>These encryption keys are additional login credentials for securing an SSH connection on VPS. Since they&rsquo;re computer-generated, they can be up to 4096 bits long. That means they are more complex and harder to decipher than a manual root password.<\/p><p>SSH keys come in two sets &ndash; <strong>public <\/strong>and <strong>private<\/strong>. The former is saved on the server, while the latter is stored on the user&rsquo;s machine. When the server detects a login attempt, it will generate a random string and encrypt it with a public key. The encrypted message only decrypts using the associated private key.<\/p><p>Here&rsquo;s how to generate an SSH key on a Linux server:<\/p><ol class=\"wp-block-list\">\n<li>Open the <strong>Terminal<\/strong> application and log in to SSH.<\/li>\n\n\n\n<li>To generate public and private keys, enter the following command:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">ssh-keygen -t rsa<\/pre><ol start=\"3\" class=\"wp-block-list\">\n<li>Once a reply appears, hit <strong>Enter<\/strong>:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">Enter file in which to save the key (\/root\/.ssh\/id_rsa):<\/pre><ol start=\"4\" class=\"wp-block-list\">\n<li>You will be prompted to fill in a passphrase twice. If you don&rsquo;t have it, press <strong>Enter <\/strong>twice.<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">Enter passphrase (empty for no passphrase):<\/pre><pre class=\"wp-block-preformatted\">Enter same passphrase again:<\/pre><ol start=\"5\" class=\"wp-block-list\">\n<li>Your private and public keys are now saved successfully.<\/li>\n<\/ol><p>If you are using Hostinger VPS, you can ask <strong>Kodee AI assistant <\/strong>to list, add, and remove SSH keys on your server. Simply ask it, &ldquo;Add this new SSH key to my VPS: your-ssh-key,&rdquo; and it will handle the task. <\/p><h3 class=\"wp-block-heading\" id=\"h-6-setup-an-internal-firewall-ip-tables\">6. Setup an internal firewall (IP tables)<\/h3><p>Since HTTP traffic has various origins, setting up a firewall for VPS helps filter the requests to ensure only legitimate visitors can access your system. Doing so helps you avoid malicious traffic and potential DDoS attacks.<\/p><p><a href=\"\/ng\/tutorials\/best-linux-distro\">Linux distributions<\/a> come with an internal firewall service called <a href=\"\/ng\/tutorials\/iptables-tutorial\">iptables<\/a>. This tool monitors traffic from and to your server using tables. It employs rules called chains to filter incoming and outgoing data packets.<\/p><p>It lets you adjust firewall rules according to your needs. Here&rsquo;s how to install and check the current iptables configuration on Ubuntu:<\/p><ol class=\"wp-block-list\">\n<li>Open <strong>Terminal <\/strong>and log in to SSH.<\/li>\n\n\n\n<li>Run the following command to install iptables:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">sudo apt-get install iptables<\/pre><ol start=\"3\" class=\"wp-block-list\">\n<li>After the installation is complete, enter the following command:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">sudo iptables -L -v<\/pre><p>Terminal will output a list of all iptables rules in detail. Here&rsquo;s what the output may look like:<\/p><div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><a href=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2022\/05\/Current-rules-of-iptables.png\"><img loading=\"lazy\" decoding=\"async\" width=\"595\" height=\"165\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/05\/Current-rules-of-iptables.png\/public\" alt=\"Current rules of iptables\" class=\"wp-image-53883\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/05\/Current-rules-of-iptables.png\/w=595,fit=scale-down 595w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/05\/Current-rules-of-iptables.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/05\/Current-rules-of-iptables.png\/w=150,fit=scale-down 150w\" sizes=\"auto, (max-width: 595px) 100vw, 595px\" \/><\/a><\/figure><\/div><h3 class=\"wp-block-heading\" id=\"h-7-configure-your-ufw\">7. Configure your UFW<\/h3><p>The <a href=\"\/ng\/tutorials\/how-to-configure-firewall-on-ubuntu-using-ufw\/\">Uncomplicated Firewall (UFW)<\/a> is a built-in application on Ubuntu that acts as the front end for iptables. Simply put, it will deny all incoming connections and allow outgoing ones, decreasing the risk of potential threats.<\/p><p>You can modify and add rules to the firewall according to your preferences. Here&rsquo;s how to enable it:<\/p><ol class=\"wp-block-list\">\n<li>Open <strong>Terminal <\/strong>and connect via SSH.<\/li>\n\n\n\n<li>Type the following command to enable UFW and press <strong>Enter<\/strong>:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">sudo ufw enable<\/pre><ol start=\"3\" class=\"wp-block-list\">\n<li>If the reply states that the command was not found, install the firewall using this command:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">sudo apt-get install ufw<\/pre><ol start=\"4\" class=\"wp-block-list\">\n<li>Once the installation is complete, run the command from step two to enable UFW.<\/li>\n\n\n\n<li>Verify the firewall status using the following command:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">sudo ufw status<\/pre><div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><a href=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2022\/05\/Checking-UFW-firewall-status.png\"><img loading=\"lazy\" decoding=\"async\" width=\"262\" height=\"39\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/05\/Checking-UFW-firewall-status.png\/public\" alt=\"Checking UFW firewall status\" class=\"wp-image-53886\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/05\/Checking-UFW-firewall-status.png\/w=262,fit=scale-down 262w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/05\/Checking-UFW-firewall-status.png\/w=150,fit=scale-down 150w\" sizes=\"auto, (max-width: 262px) 100vw, 262px\" \/><\/a><\/figure><\/div><p>Alternatively, use our integrated VPS Firewall on hPanel. Select your VPS and go to <strong>Security<\/strong> <strong>&rarr;<\/strong> <strong>Firewall<\/strong> on the left side menu:<\/p><div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><a href=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2022\/05\/vps-firewall-side-menu.png\"><img loading=\"lazy\" decoding=\"async\" width=\"500\" height=\"1080\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/05\/vps-firewall-side-menu.png\/public\" alt=\"Hostinger's hPanel VPS left side menu\" class=\"wp-image-118691\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/05\/vps-firewall-side-menu.png\/w=500,fit=scale-down 500w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/05\/vps-firewall-side-menu.png\/w=139,fit=scale-down 139w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/05\/vps-firewall-side-menu.png\/w=474,fit=scale-down 474w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/05\/vps-firewall-side-menu.png\/w=69,fit=scale-down 69w\" sizes=\"auto, (max-width: 500px) 100vw, 500px\" \/><\/a><\/figure><\/div><p>Then, create a new firewall configuration. Once created, select the <strong>Edit<\/strong> button:<\/p><div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><a href=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2022\/05\/vps-firewall-edit-button.png\"><img loading=\"lazy\" decoding=\"async\" width=\"2290\" height=\"472\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/05\/vps-firewall-edit-button.png\/public\" alt=\"Hostinger's hPanel firewall section with the edit button highlighted\" class=\"wp-image-118692\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/05\/vps-firewall-edit-button.png\/w=2290,fit=scale-down 2290w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/05\/vps-firewall-edit-button.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/05\/vps-firewall-edit-button.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/05\/vps-firewall-edit-button.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/05\/vps-firewall-edit-button.png\/w=768,fit=scale-down 768w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/05\/vps-firewall-edit-button.png\/w=1536,fit=scale-down 1536w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/05\/vps-firewall-edit-button.png\/w=2048,fit=scale-down 2048w\" sizes=\"auto, (max-width: 2290px) 100vw, 2290px\" \/><\/a><\/figure><\/div><p>Lastly, create any preferred rules:<\/p><div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><a href=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2022\/05\/vps-firewall-configuration.png\"><img loading=\"lazy\" decoding=\"async\" width=\"2318\" height=\"1056\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/05\/vps-firewall-configuration.png\/public\" alt=\"Hostinger's hPanel firewall configuration menu\" class=\"wp-image-118693\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/05\/vps-firewall-configuration.png\/w=2318,fit=scale-down 2318w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/05\/vps-firewall-configuration.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/05\/vps-firewall-configuration.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/05\/vps-firewall-configuration.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/05\/vps-firewall-configuration.png\/w=768,fit=scale-down 768w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/05\/vps-firewall-configuration.png\/w=1536,fit=scale-down 1536w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/05\/vps-firewall-configuration.png\/w=2048,fit=scale-down 2048w\" sizes=\"auto, (max-width: 2318px) 100vw, 2318px\" \/><\/a><\/figure><\/div><p>Alternatively, Hostinger VPS users can easily configure their server firewall by asking Kodee AI assistant. For example, you can ask it to &ldquo;List all active firewall rules on my VPS&rdquo; or &ldquo;Create a new firewall rule that allows connections to port <strong>12345 <\/strong>from any IP address.&rdquo;<\/p><p>We also recommend <a href=\"\/ng\/tutorials\/how-to-install-suricata-on-ubuntu\">installing Suricata on your Ubuntu system<\/a>. This tool automatically identifies malicious traffic on your network and its sources, which you can later include in the UFW blocklist.&nbsp;<\/p><h3 class=\"wp-block-heading\" id=\"h-8-using-sftp-instead-of-ftp\">8. Using SFTP instead of FTP<\/h3><p>While commonly used, the <a href=\"\/ng\/tutorials\/what-is-ftp\">file transfer protocol<\/a> (FTP) connection is unsafe due to the lack of encryption. Even though FTP over transport layer security (TLS) or FTPS encrypts the login credentials, it doesn&rsquo;t secure the file transmission.<\/p><p>As a result, using either of these connections may put your data at risk. Hackers can easily perform a sniffing attack to steal your login credentials and intercept file transfers.<\/p><p>To avoid this, use the <a href=\"\/ng\/tutorials\/how-to-use-sftp-to-safely-transfer-files\/\">secure file transfer protocol<\/a><strong> <\/strong>(SFTP) instead. It encrypts all data, including the credentials and transferred files. Furthermore, SFTP protects users from man-in-the-middle attacks, as the client needs to be authenticated before accessing the system.<\/p><p>Follow these steps to set up a secure file transfer protocol connection:<\/p><ol class=\"wp-block-list\">\n<li>Open <strong>Terminal <\/strong>and log in to SSH.<\/li>\n\n\n\n<li>Initiate an SFTP connection by using this command:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">sftp user@server_ipaddress<\/pre><p>or<\/p><pre class=\"wp-block-preformatted\">sftp user@remotehost_domainname<\/pre><ol start=\"3\" class=\"wp-block-list\">\n<li>If you&rsquo;re using a custom port, run the following command:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">sftp -oPort=customport user@server_ipaddress<\/pre><p>or<\/p><pre class=\"wp-block-preformatted\">sftp -oPort=customport user@remotehost_domainname<\/pre><p>Once you&rsquo;re connected, an SFTP prompt will appear like the following:<\/p><div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><a href=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2022\/05\/Connecting-using-SFTP.png\"><img loading=\"lazy\" decoding=\"async\" width=\"617\" height=\"134\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/05\/Connecting-using-SFTP.png\/public\" alt=\"The SFTP connection in an SSH client\" class=\"wp-image-53887\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/05\/Connecting-using-SFTP.png\/w=617,fit=scale-down 617w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/05\/Connecting-using-SFTP.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/05\/Connecting-using-SFTP.png\/w=150,fit=scale-down 150w\" sizes=\"auto, (max-width: 617px) 100vw, 617px\" \/><\/a><\/figure><\/div><h3 class=\"wp-block-heading\" id=\"h-9-set-up-fail2ban\">9. Set up Fail2Ban<\/h3><p>The security software <a href=\"\/ng\/tutorials\/fail2ban-configuration\">Fail2Ban<\/a> monitors system logs and blocks hackers after multiple failed logins. In addition, it protects servers against DoS, DDoS, dictionary, and brute-force attacks. Fail2Ban uses iptables and a firewall to ban IP addresses.<\/p><p>Follow these steps to set up the Fail2Ban software package on Ubuntu:<\/p><ol class=\"wp-block-list\">\n<li>Open <strong>Terminal <\/strong>and start an SSH connection.<\/li>\n\n\n\n<li>Input the following command to install the Fail2Ban software package:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">sudo apt-get install fail2ban<\/pre><ol start=\"3\" class=\"wp-block-list\">\n<li>The following output will appear. Type <strong>Y <\/strong>and hit <strong>Enter<\/strong>.<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">Do you want to continue? [Y\/n] y<\/pre><ol start=\"4\" class=\"wp-block-list\">\n<li>Once the installation is finished, verify the status by running the following command:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">sudo systemctl status fail2ban<\/pre><p>If the Fail2Ban software package is active and running, Terminal should return the following:<\/p><div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><a href=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2022\/05\/Checking-Fail2Ban-status.png\"><img loading=\"lazy\" decoding=\"async\" width=\"693\" height=\"205\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/05\/Checking-Fail2Ban-status.png\/public\" alt=\"An SSH client returning a VPS' current Fail2Ban status\" class=\"wp-image-53889\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/05\/Checking-Fail2Ban-status.png\/w=693,fit=scale-down 693w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/05\/Checking-Fail2Ban-status.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/05\/Checking-Fail2Ban-status.png\/w=150,fit=scale-down 150w\" sizes=\"auto, (max-width: 693px) 100vw, 693px\" \/><\/a><\/figure><\/div><h3 class=\"wp-block-heading\" id=\"h-10-install-an-antivirus\">10. Install an antivirus<\/h3><p>In addition to setting up a firewall to filter incoming traffic, it&rsquo;s important to monitor files in your VPS. Virus attacks are one of the main Linux server vulnerabilities, and they can potentially target your servers and damage your data.<\/p><p>That makes installing an antivirus especially crucial. Many options are available, but the most notable one is <a href=\"\/ng\/tutorials\/how-to-install-clamav-centos7\">ClamAV<\/a>. It&rsquo;s open-source and used to detect suspicious activity and quarantine unwanted files.<\/p><p><div><p class=\"important\"><strong>Important!<\/strong> Don&rsquo;t enable ClamAV if your VPS has less than 2 GB of spare RAM. Doing so may consume all the remaining memory, crashing your server.<\/p><\/div>\n\n\n\n<\/p><p>Follow these instructions to install ClamAV on CentOS:<\/p><ol class=\"wp-block-list\">\n<li>Open <strong>Terminal <\/strong>and log in to SSH.<\/li>\n\n\n\n<li>Install Extra Packages for Enterprise Linux (EPEL) using this command:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">sudo yum -y install epel-release<\/pre><ol start=\"3\" class=\"wp-block-list\">\n<li>The <strong>Complete!<\/strong> output will signal that the EPEL installation is done. Press <strong>Enter <\/strong>to create a new line.<\/li>\n\n\n\n<li>Enter the following command to clear all cached information:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">sudo yum clean all<\/pre><ol start=\"5\" class=\"wp-block-list\">\n<li>Run the command below to install ClamAV:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">sudo yum -y install clamav-server clamav-data clamav-update clamav-filesystem clamav clamav-scanner-systemd clamav-devel clamav-lib clamav-server-systemd<\/pre><p>A <strong>Complete!<\/strong> line will appear, indicating that the installation is finished and ClamAV is running. Here&rsquo;s how the final output should look:<\/p><div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><a href=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2022\/05\/ClamAV-installation-is-finished.png\"><img loading=\"lazy\" decoding=\"async\" width=\"781\" height=\"546\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/05\/ClamAV-installation-is-finished.png\/public\" alt=\"Terminal showing that the ClamAV antivirus installation in a VPS is completed\" class=\"wp-image-53892\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/05\/ClamAV-installation-is-finished.png\/w=781,fit=scale-down 781w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/05\/ClamAV-installation-is-finished.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/05\/ClamAV-installation-is-finished.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/05\/ClamAV-installation-is-finished.png\/w=768,fit=scale-down 768w\" sizes=\"auto, (max-width: 781px) 100vw, 781px\" \/><\/a><\/figure><\/div><h3 class=\"wp-block-heading\" id=\"h-11-use-a-malware-scanner\">11. Use a malware scanner<\/h3><p>While an antivirus protects your VPS from threats like trojans and worms, it may be unable to detect newer exploits like <a href=\"https:\/\/www.ibm.com\/topics\/zero-day\" target=\"_blank\" rel=\"noreferrer noopener\">zero-day malware<\/a>.<\/p><p>To enhance your VPS security, pair an antivirus with a malware scanner. This type of software <a href=\"https:\/\/www.electric.ai\/blog\/anti-malware-vs-antivirus\" target=\"_blank\" rel=\"noreferrer noopener\">updates the detection rule faster<\/a>, allowing it to distinguish newer threats on your system.<\/p><p>Linux supports various malware scanners, which you must install manually via Terminal. At Hostinger, all our VPS plans include a free <strong>Monarx<\/strong> malware scanner. The tool&rsquo;s graphical user interface makes it easy to use, especially for non-technical users.<\/p><?xml encoding=\"utf-8\" ?><figure class=\"wp-block-image size-large\"><a class=\"hgr-tutorials-cta hgr-tutorials-cta-vps-hosting\" href=\"\/ng\/vps-hosting\" target=\"_blank\" rel=\"noreferrer noopener\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"300\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/02\/VPS-hosting-banner.png\/public\" alt=\"\" class=\"wp-image-77934\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/02\/VPS-hosting-banner.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/02\/VPS-hosting-banner.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/02\/VPS-hosting-banner.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/02\/VPS-hosting-banner.png\/w=768,fit=scale-down 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure><p>After setting up your VPS, follow these steps to install Monarx:<\/p><ol class=\"wp-block-list\">\n<li>Log in to the <a href=\"https:\/\/hpanel.hostinger.com\/\">Members Area<\/a> and click <strong>VPS <\/strong>on the left side menu &ndash; select the VPS you wish to manage if you have several.<\/li>\n\n\n\n<li>From the sidebar, go to <strong>Security<\/strong> &rarr; <strong>Malware Scanner<\/strong>.<\/li>\n\n\n\n<li>Click on the malware scanner banner and select <strong>Install <\/strong>on the pop-up prompt.<\/li>\n<\/ol><div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><a href=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2022\/05\/vps-malware-scanner-screen.png\"><img loading=\"lazy\" decoding=\"async\" width=\"2324\" height=\"600\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/05\/vps-malware-scanner-screen.png\/public\" alt=\"Hostinger's VPS admin dashboard with the Malware Scanner panel\" class=\"wp-image-118694\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/05\/vps-malware-scanner-screen.png\/w=2324,fit=scale-down 2324w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/05\/vps-malware-scanner-screen.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/05\/vps-malware-scanner-screen.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/05\/vps-malware-scanner-screen.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/05\/vps-malware-scanner-screen.png\/w=768,fit=scale-down 768w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/05\/vps-malware-scanner-screen.png\/w=1536,fit=scale-down 1536w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/05\/vps-malware-scanner-screen.png\/w=2048,fit=scale-down 2048w\" sizes=\"auto, (max-width: 2324px) 100vw, 2324px\" \/><\/a><\/figure><\/div><p><div><p class=\"important\"><strong>Important!<\/strong> Restoring a snapshot and rescanning your VPS will reset the current malware diagnostic results. Also, re-install Monarx if you are changing the server&rsquo;s operating system.<\/p><\/div>\n\n\n\n<\/p><p>The installation process may take up to 60 minutes. Once installed, access the tool by going to the <strong>VPS Dashboard<\/strong>&rsquo;s sidebar &rarr; <strong>Security &rarr; Malware Scanner<\/strong>. This section displays the automatic scan results, including the number of compromised files.<\/p><div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><a href=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2022\/05\/monarx-malware-scanner-dashboard-in-hostinger-vps-management-dashboard.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"492\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/05\/monarx-malware-scanner-dashboard-in-hostinger-vps-management-dashboard.png\/public\" alt=\"The Monarx malware scanner dashboard in Hostinger's VPS management area\" class=\"wp-image-96723\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/05\/monarx-malware-scanner-dashboard-in-hostinger-vps-management-dashboard.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/05\/monarx-malware-scanner-dashboard-in-hostinger-vps-management-dashboard.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/05\/monarx-malware-scanner-dashboard-in-hostinger-vps-management-dashboard.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/05\/monarx-malware-scanner-dashboard-in-hostinger-vps-management-dashboard.png\/w=768,fit=scale-down 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure><\/div><p>You can manually clean up the malicious files or use Monarx&rsquo;s <strong>Auto removal<\/strong> tool. This feature automatically deletes the injected malware and quarantines potentially compromised files, enabling you to maintain optimal server security with minimal effort.<\/p><p>To enable auto-removal, purchase the license by pressing <strong>Activate <\/strong>on the <strong>Auto removal <\/strong>section. It costs <strong>$7\/month<\/strong>,<strong> <\/strong>and the billing cycle will automatically adjust based on your remaining VPS subscription length.<\/p><p>In addition to the malware scanner menu in hPanel, you can directly manage Monarx by asking Kodee AI assistant. For example, you can ask it to set up Monarx on your VPS, uninstall it, summarize scan results, and more. <\/p><h3 class=\"wp-block-heading\">12. Set Up a VPN for Your VPS<\/h3><p>If you use a public connection, someone may intercept your traffic and steal your data. To avoid this, we recommend <a href=\"\/ng\/tutorials\/how-to-set-up-a-linux-vpn-server-with-openvpn\/\">setting up a virtual private network (VPN)<\/a> to combat security threats.<\/p><p>A VPN will provide an alternative IP address for your machine to route traffic through an encrypted tunnel and mask your location. It makes your IP address untraceable, allowing you to maintain anonymity while browsing the internet.<\/p><p>In short, a VPN keeps your data safe and prevents hackers from intercepting your traffic. It works hand in hand with a firewall to provide additional VPS security.<\/p><p><div class=\"protip\">\n                    <h4 class=\"title\">Pro Tip<\/h4>\n                    <p>A VPN is also beneficial for users who live in an area with location-based restrictions since it lets them change their IP addresses to bypass internet censorship.<\/p>\n                <\/div>\n\n\n\n<\/p><p>Follow these steps to install<strong> OpenVPN<\/strong> on CentOS:<\/p><ol class=\"wp-block-list\">\n<li>Open <strong>Terminal <\/strong>and connect with SSH.<\/li>\n\n\n\n<li>Install the net-tools package before installing OpenVPN. Run this command:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">sudo yum install net-tools<\/pre><ol start=\"3\" class=\"wp-block-list\">\n<li>Enter the following curl command to download the OpenVPN package:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">curl -O http:\/\/swupdate.openvpn.org\/as\/openvpn-as-2.7.3-CentOS7.x86_64.rpm<\/pre><ol start=\"4\" class=\"wp-block-list\">\n<li>Print SHA256 checksum to validate the installation using this command:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">sha256sum openvpn-as-*<\/pre><ol start=\"5\" class=\"wp-block-list\">\n<li>The output will print the checksum as shown below:<\/li>\n<\/ol><div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><a href=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2022\/05\/Checksum-output.png\"><img loading=\"lazy\" decoding=\"async\" width=\"730\" height=\"38\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/05\/Checksum-output.png\/public\" alt=\"The Checksum output on Terminal\" class=\"wp-image-53894\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/05\/Checksum-output.png\/w=730,fit=scale-down 730w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/05\/Checksum-output.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/05\/Checksum-output.png\/w=150,fit=scale-down 150w\" sizes=\"auto, (max-width: 730px) 100vw, 730px\" \/><\/a><\/figure><\/div><p>Alternatively, use Hostinger VPS&rsquo;s Kodee feature to check the SHA-256 checksum of the package:<\/p><div class=\"wp-block-image\"><figure data-wp-context='{\"imageId\":\"69e2382041155\"}' data-wp-interactive=\"core\/image\" class=\"aligncenter size-large wp-lightbox-container\"><img decoding=\"async\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-on-async--load=\"callbacks.setButtonStyles\" data-wp-on-async-window--resize=\"callbacks.setButtonStyles\" src=\"\/tutorials\/wp-content\/uploads\/sites\/2\/2022\/05\/hpanel-vps-kodee-checksum-openvpn-1024x597.png\" alt=\"Kodee responds to a question about verifying the OpenVPN package's SHA-256 checksum\"><button class=\"lightbox-trigger\" type=\"button\" aria-haspopup=\"dialog\" aria-label=\"Enlarge\" data-wp-init=\"callbacks.initTriggerButton\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-style--right=\"state.imageButtonRight\" data-wp-style--top=\"state.imageButtonTop\">\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewbox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\"><\/path>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure><\/div><ol start=\"6\" class=\"wp-block-list\">\n<li>Compare the downloaded binary&rsquo;s checksum with the one provided on the website. If they match, you can start installing OpenVPN with this command:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">sudo rpm --install openvpn-as-*.rpm<\/pre><ol start=\"7\" class=\"wp-block-list\">\n<li>After the installation, you will get the Admin UI and Client UI details. Press <strong>Enter <\/strong>to create a new line.<\/li>\n\n\n\n<li>Set up a password with the following command:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">passwd openvpn<\/pre><ol start=\"9\" class=\"wp-block-list\">\n<li>You will be prompted to retype the new password.<\/li>\n\n\n\n<li>Visit the Admin or Client UI to access the screen below:<\/li>\n<\/ol><div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><a href=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2022\/05\/OpenVPN-admin-login-page.png\"><img loading=\"lazy\" decoding=\"async\" width=\"505\" height=\"464\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/05\/OpenVPN-admin-login-page.png\/public\" alt=\"OpenVPN admin login page\" class=\"wp-image-53897\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/05\/OpenVPN-admin-login-page.png\/w=505,fit=scale-down 505w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/05\/OpenVPN-admin-login-page.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/05\/OpenVPN-admin-login-page.png\/w=150,fit=scale-down 150w\" sizes=\"auto, (max-width: 505px) 100vw, 505px\" \/><\/a><\/figure><\/div><ol start=\"11\" class=\"wp-block-list\">\n<li>Enter the username <strong>openvpn <\/strong>and the password you have just set up. Press <strong>Sign In<\/strong>.<\/li>\n<\/ol><p><div class=\"protip\">\n                    <h4 class=\"title\">Pro Tip<\/h4>\n                    <p>The new Hostinger KVM VPS plans are compatible with any VPN software available in the market.<\/p>\n                <\/div>\n\n\n\n<\/p><h3 class=\"wp-block-heading\" id=\"h-13-review-user-rights\">13. Review user rights<\/h3><p>If there are many users on your VPS hosting, carefully consider the distribution of control and rights. Providing all users with root privileges will expose your server&rsquo;s resources and sensitive data to security risks.<\/p><p>To prevent this issue, set a user access limit on your server. You can do so by managing users and granting them different permissions for specific files and system resources.<\/p><p>Linux has a user privileges management feature, which lets you modify system access permissions for different accounts. Simply create a group for users with the same access privileges.<\/p><p>Here&rsquo;s how to manage users and their privileges on Ubuntu:<\/p><ol class=\"wp-block-list\">\n<li>Open <strong>Terminal <\/strong>and connect via SSH.<\/li>\n\n\n\n<li>Enter the following command to create a group. Replace <strong>my_group <\/strong>with the group name:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">sudo addgroup my_group<\/pre><ol start=\"3\" class=\"wp-block-list\">\n<li>Next, run the following command to create a new user. Replace <strong>first_user <\/strong>with your user name:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">adduser first_user<\/pre><ol start=\"4\" class=\"wp-block-list\">\n<li>The output will prompt you to set a password and bio, such as full name, room number, and phone number. Type <strong>y <\/strong>and press<strong> Enter <\/strong>to confirm the entered information.<\/li>\n\n\n\n<li>To add a user to a group, run the command below. Note that it doesn&rsquo;t produce any output.<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">sudo usermod -a -G group1,group2 first_user<\/pre><ol start=\"6\" class=\"wp-block-list\">\n<li>If you want to grant root access to a user, run the following command. It also won&rsquo;t give any output.<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">sudo usermod -aG sudo first_user<\/pre><ol start=\"7\" class=\"wp-block-list\">\n<li>If you have a directory and want to add read and write privileges to it, use a command with this syntax:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">sudo chmod -R g+w \/directory<\/pre><p>We also recommend regularly <a href=\"\/ng\/tutorials\/how-to-see-system-users-in-ubuntu-linux-vps\/\">listing users in your Linux system<\/a> to check for any malicious entries. It&rsquo;s important since hackers often create an account in a compromised machine to gain access.&nbsp;<\/p><h3 class=\"wp-block-heading\">14. Disable IPv6<\/h3><p>Disabling IPv6 helps avoid security vulnerabilities and makes your VPS hosting less prone to cyber attacks. As hackers often send malicious traffic through IPv6, leaving the protocol open can expose your server to potential security breaches.<\/p><p>Even if you&rsquo;re not actively using IPv6, some of your programs may open listening sockets on it. When a packet comes in, these programs will process it, even a malicious one.<\/p><p>To keep your operating system and VPS server safe, follow these instructions to disable IPv6 on Ubuntu:<\/p><ol class=\"wp-block-list\">\n<li>Open <strong>Terminal <\/strong>and log in to SSH.<\/li>\n\n\n\n<li>Enter the following command to disable IPv6:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">sudo nano \/etc\/sysctl.d\/99-sysctl.conf<\/pre><ol start=\"3\" class=\"wp-block-list\">\n<li>The configuration file will open. Add the following lines at the bottom:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">net.ipv6.conf.all.disable_ipv6 = 1<\/pre><pre class=\"wp-block-preformatted\">net.ipv6.conf.default.disable_ipv6 = 1<\/pre><pre class=\"wp-block-preformatted\">net.ipv6.conf.lo.disable_ipv6 = 1<\/pre><div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><a href=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2022\/05\/Adding-command-lines-to-disable-IPv6.png\"><img loading=\"lazy\" decoding=\"async\" width=\"780\" height=\"400\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/05\/Adding-command-lines-to-disable-IPv6.png\/public\" alt=\"The additional command lines added in a VPS configuration file to disable IPv6\" class=\"wp-image-53903\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/05\/Adding-command-lines-to-disable-IPv6.png\/w=780,fit=scale-down 780w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/05\/Adding-command-lines-to-disable-IPv6.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/05\/Adding-command-lines-to-disable-IPv6.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/05\/Adding-command-lines-to-disable-IPv6.png\/w=768,fit=scale-down 768w\" sizes=\"auto, (max-width: 780px) 100vw, 780px\" \/><\/a><\/figure><\/div><ol start=\"4\" class=\"wp-block-list\">\n<li>Save and close the file.<\/li>\n\n\n\n<li>Next, run the command below to execute the changes:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">sudo sysctl -p<\/pre><ol start=\"6\" class=\"wp-block-list\">\n<li>Lastly, insert the following command and hit <strong>Enter<\/strong>. If you see 1, that means IPv6 has been disabled successfully.<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">cat \/proc\/sys\/net\/ipv6\/conf\/all\/disable_ipv6<\/pre><div class=\"wp-block-image\"><figure class=\"aligncenter size-full is-resized\"><a href=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2022\/05\/Checking-IPv6-status.png\"><img loading=\"lazy\" decoding=\"async\" width=\"467\" height=\"34\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/05\/Checking-IPv6-status.png\/public\" alt=\"Terminal showing the current IPv6 status\" class=\"wp-image-53905\" style=\"width:467px;height:34px\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/05\/Checking-IPv6-status.png\/w=467,fit=scale-down 467w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/05\/Checking-IPv6-status.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/05\/Checking-IPv6-status.png\/w=150,fit=scale-down 150w\" sizes=\"auto, (max-width: 467px) 100vw, 467px\" \/><\/a><\/figure><\/div><h3 class=\"wp-block-heading\" id=\"h-15-monitor-your-server-logs\">15. Monitor your server logs<\/h3><p>Monitoring your server logs gives insights into what&rsquo;s happening with your VPS hosting. These logs can also provide detailed information about the VPS condition, including the server load and resource usage, for reporting purposes.<\/p><p>Server log monitoring helps you determine whether the server is experiencing cyber attacks or other security threats. The sooner those vulnerabilities are fixed, the fewer opportunities attackers will have to intercept data.<\/p><p>One of the critical directories on your Linux system is called <strong>\/var\/log<\/strong>. It stores a collection of log files that contain crucial information related to the system, kernel, package managers, and various applications running on the server.<\/p><p>Here&rsquo;s how to open <strong>\/var\/log<\/strong> on a Ubuntu server for log monitoring:<\/p><ol class=\"wp-block-list\">\n<li>Open <strong>Terminal <\/strong>and log in to SSH.<\/li>\n\n\n\n<li>Run the command below to change the working directory to <strong>\/var\/log<\/strong>. It won&rsquo;t produce any output, but your command line should show the directory.<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">cd \/var\/log<\/pre><ol start=\"3\" class=\"wp-block-list\">\n<li>To list all the files, enter the following command:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">ls<\/pre><div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><a href=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2022\/05\/Listing-down-the-entire-files-inside-varlog-directory.png\"><img loading=\"lazy\" decoding=\"async\" width=\"634\" height=\"119\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/05\/Listing-down-the-entire-files-inside-varlog-directory.png\/public\" alt=\"Terminal lists down the entire files inside :var:log directory\" class=\"wp-image-53906\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/05\/Listing-down-the-entire-files-inside-varlog-directory.png\/w=634,fit=scale-down 634w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/05\/Listing-down-the-entire-files-inside-varlog-directory.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/05\/Listing-down-the-entire-files-inside-varlog-directory.png\/w=150,fit=scale-down 150w\" sizes=\"auto, (max-width: 634px) 100vw, 634px\" \/><\/a><\/figure><\/div><ol start=\"4\" class=\"wp-block-list\">\n<li>To check the logs, enter this command:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">sudo cat syslog<\/pre><p>Here&rsquo;s how your VPS logs should look like:<\/p><div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><a href=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2022\/05\/Checking-syslog-inside-varlog-directory.png\"><img loading=\"lazy\" decoding=\"async\" width=\"780\" height=\"386\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/05\/Checking-syslog-inside-varlog-directory.png\/public\" alt=\"Terminal showing syslog inside the :var:log directory\" class=\"wp-image-53907\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/05\/Checking-syslog-inside-varlog-directory.png\/w=780,fit=scale-down 780w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/05\/Checking-syslog-inside-varlog-directory.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/05\/Checking-syslog-inside-varlog-directory.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/05\/Checking-syslog-inside-varlog-directory.png\/w=768,fit=scale-down 768w\" sizes=\"auto, (max-width: 780px) 100vw, 780px\" \/><\/a><\/figure><\/div><p>In addition to operating system logs, check the action history in your VPS hosting instance to identify suspicious activities or events. For Hostinger VPS users, you can easily do this by asking Kodee AI assistant, &ldquo;Check the activity logs in my current VPS.&rdquo;<\/p><h3 class=\"wp-block-heading\" id=\"h-16-keep-your-applications-up-to-date\">16. Keep your applications up to date<\/h3><p>Since old software may have vulnerabilities, keeping applications up-to-date helps prevent cyber attacks on your VPS. Developers usually release updates and security patches regularly, so check for the latest versions of your software and install them as soon as possible.<\/p><p>In a Linux operating system, you can run a command to quickly list and install all the available package updates. Here&rsquo;s how to do it on Debian or Ubuntu:<\/p><ul class=\"wp-block-list\">\n<li>If you are updating the entire package list, run the following command:<\/li>\n<\/ul><pre class=\"wp-block-preformatted\">sudo apt-get update<\/pre><ul class=\"wp-block-list\">\n<li>If you are updating the actual package, use this command:<\/li>\n<\/ul><pre class=\"wp-block-preformatted\">sudo apt-get upgrade<\/pre><p>Meanwhile, follow these steps to do it on CentOS\/RHEL:<\/p><ul class=\"wp-block-list\">\n<li>Enter this command to refresh the package database and install updates:<\/li>\n<\/ul><pre class=\"wp-block-preformatted\">sudo yum update<\/pre><ul class=\"wp-block-list\">\n<li>To check for any updates, run the following command:<\/li>\n<\/ul><pre class=\"wp-block-preformatted\">sudo yum check-update<\/pre><p>We recommend enabling automated updates if you use a <a href=\"\/ng\/tutorials\/what-is-a-cms\/\">content management system<\/a> (CMS) on your server. In addition, you can create <a href=\"\/ng\/tutorials\/cron-job\">cron jobs<\/a>, a Linux-based utility that schedules a command or script to run at a specified time and date.<\/p><p>The most convenient way to install and run a cron job on CentOS or RHEL is using the <strong>yum-cron <\/strong>service. It will automatically update the software every time a new version is released. Here&rsquo;s how to set it up on CentOS or RHEL:<\/p><ol class=\"wp-block-list\">\n<li>Open <strong>Terminal <\/strong>and connect via SSH.<\/li>\n\n\n\n<li>Enter this command to install<strong> yum-cron<\/strong>:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">sudo yum install yum-cron<\/pre><ol start=\"3\" class=\"wp-block-list\">\n<li>Run the following command to enable the service. This command doesn&rsquo;t give any output.<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">sudo systemctl enable yum-cron.service<\/pre><ol start=\"4\" class=\"wp-block-list\">\n<li>Enter the command below to start the service. This command also won&rsquo;t produce a reply.<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">sudo systemctl start yum-cron.service<\/pre><ol start=\"5\" class=\"wp-block-list\">\n<li>Then, use this command to check the service&rsquo;s status:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">sudo systemctl status yum-cron.service<\/pre><div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><a href=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2022\/05\/Checking-yum-cron-service-status.png\"><img loading=\"lazy\" decoding=\"async\" width=\"720\" height=\"148\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/05\/Checking-yum-cron-service-status.png\/public\" alt=\"Terminal showing a VPS' yum-cron service status\" class=\"wp-image-53909\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/05\/Checking-yum-cron-service-status.png\/w=720,fit=scale-down 720w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/05\/Checking-yum-cron-service-status.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/05\/Checking-yum-cron-service-status.png\/w=150,fit=scale-down 150w\" sizes=\"auto, (max-width: 720px) 100vw, 720px\" \/><\/a><\/figure><\/div><ol start=\"6\" class=\"wp-block-list\">\n<li>Use the command below to open the configuration file:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">sudo vi \/etc\/yum\/yum-cron.conf<\/pre><ol start=\"7\" class=\"wp-block-list\">\n<li>Find the following line on the output and replace <strong>no <\/strong>with <strong>yes<\/strong>. Save the changes and exit the file using this command:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">apply_updates = yes<\/pre><div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><a href=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2022\/05\/Replace-a-command-line.png\"><img loading=\"lazy\" decoding=\"async\" width=\"505\" height=\"53\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/05\/Replace-a-command-line.png\/public\" alt=\"A prompt in Terminal confirming whether user wants to apply update\" class=\"wp-image-53910\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/05\/Replace-a-command-line.png\/w=505,fit=scale-down 505w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/05\/Replace-a-command-line.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/05\/Replace-a-command-line.png\/w=150,fit=scale-down 150w\" sizes=\"auto, (max-width: 505px) 100vw, 505px\" \/><\/a><\/figure><\/div><h2 class=\"wp-block-heading\" id=\"h-conclusion\">Conclusion<\/h2><p>Protecting your VPS server is important since it contains sensitive data. Although Linux is famous for its robust security, the VPS server still has vulnerabilities.<\/p><p>Common cyber attacks and issues in a Linux system include malware, sniffing and brute-force attacks, SQL injections, cross-site scripting (XSS), missing function-level control, and broken authentication.<\/p><p>To avoid them, owners of virtual private servers must know how to monitor the server and operating system to apply robust security measures. To get you started, we have compiled the 16 best VPS hosting security tips:<\/p><ol class=\"wp-block-list\">\n<li>Pick a secure VPS hosting provider.<\/li>\n\n\n\n<li>Use a more secure SSH port.<\/li>\n\n\n\n<li>Disable root logins.<\/li>\n\n\n\n<li>Use complex passwords with symbols and numbers.<\/li>\n\n\n\n<li>Enable SSH keys for VPS authentication.<\/li>\n\n\n\n<li>Use iptables on your server.<\/li>\n\n\n\n<li>Install a UFW firewall as an additional security layer.<\/li>\n\n\n\n<li>Start using the secure file transfer protocol (SFTP) instead of FTP.<\/li>\n\n\n\n<li>Activate the Fail2Ban feature to block failed login attempts.<\/li>\n\n\n\n<li>Install antivirus software.<\/li>\n\n\n\n<li>Use a malware scanner.<\/li>\n\n\n\n<li>Set up a VPN for VPS.<\/li>\n\n\n\n<li>Review user access privileges.<\/li>\n\n\n\n<li>Disable IPv6 on your server.<\/li>\n\n\n\n<li>Monitor server logs.<\/li>\n\n\n\n<li>Check for security updates.<\/li>\n<\/ol><p>We hope this article has helped you improve your VPS hosting security. If you have any questions or other tips, please leave them in the comments below.<\/p><p><div class=\"protip\">\n                    <h4 class=\"title\">Suggested Reading<\/h4>\n                    <p>Check out our guide about <a href=\"\/ng\/tutorials\/web-application-security\">web application security<\/a> and protect your site from cyber attacks.<\/p>\n                <\/div>\n\n\n\n<\/p><h2 class=\"wp-block-heading\" id=\"h-vps-security-faq\">VPS security FAQ<\/h2><p>In this section, we will answer several common questions about VPS security.<\/p><div class=\"schema-faq wp-block-yoast-faq-block\"><div class=\"schema-faq-section\" id=\"faq-question-1691931067562\"><h3 class=\"schema-faq-question\">What is VPS security?<\/h3> <p class=\"schema-faq-answer\">VPS security is the resilience of your virtual servers against various cyber threats like SQL injection, malware, and sniffing attacks.&nbsp;<br><br>Improving VPS security involves proper server management, bug patching, and applying security features. Your hosting provider&rsquo;s support, built-in features, and services also determine your VPS security.<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1691931074459\"><h3 class=\"schema-faq-question\">Why Is VPS security important?<\/h3> <p class=\"schema-faq-answer\">Weak VPS security makes your server, websites, and visitors vulnerable to cyber attacks. Such attacks can compromise privacy, leak sensitive data, and cause huge financial losses. For businesses, cyber attacks may tarnish their reputation, driving customers away and slowing down sales.<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1691931101442\"><h3 class=\"schema-faq-question\">Is VPS hosting more secure than other types of hosting?<\/h3> <p class=\"schema-faq-answer\">VPS is commonly more secure than a shared hosting plan due to additional security features, isolated resources, and better website privacy. Meanwhile, VPS and dedicated server hosting offer a similar security level.&nbsp;<br><br>However, while dedicated server hosting is generally more secure, it lacks VPS&rsquo; automatic <a href=\"https:\/\/www.cloudflare.com\/learning\/performance\/what-is-server-failover\/\" target=\"_blank\" rel=\"noreferrer noopener\">failover<\/a> feature that helps prevent data loss.<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1691931102985\"><h3 class=\"schema-faq-question\">Does VPS have a firewall?<\/h3> <p class=\"schema-faq-answer\">Yes, VPS typically has a pre-configured firewall that users can adjust. Several Linux distributions have built-in applications for configuring VPS firewall rules, like Uncomplicated Firewall and iptables.<\/p> <\/div> <\/div>\n","protected":false},"excerpt":{"rendered":"<p>Knowing how to secure your Linux virtual private server is important to avoid cyber threats. However, this is not a one-time task &ndash; in addition to applying the best security practices, you must always monitor your virtual private server (VPS). In this article, we will dive deeper into Linux security and its common vulnerabilities. We [&#8230;]<\/p>\n<p><a class=\"btn btn-secondary understrap-read-more-link\" href=\"\/ng\/tutorials\/vps-security\">Read More&#8230;<\/a><\/p>\n","protected":false},"author":298,"featured_media":144432,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"rank_math_title":"VPS Security: Tips + Common Weaknesses","rank_math_description":"Learn VPS Security tips to protect your server - from host research and changing SSH port to securing with firewalls. Read on for more.","rank_math_focus_keyword":"vps security","footnotes":""},"categories":[22644],"tags":[],"class_list":["post-53874","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-vps"],"hreflangs":[{"locale":"en-US","link":"https:\/\/www.hostinger.com\/tutorials\/vps-security","default":0},{"locale":"pt-BR","link":"https:\/\/www.hostinger.com\/br\/tutoriais\/vps-seguro","default":0},{"locale":"fr-FR","link":"https:\/\/www.hostinger.com\/fr\/tutoriels\/securite-vps","default":0},{"locale":"es-ES","link":"https:\/\/www.hostinger.com\/es\/tutoriales\/seguridad-vps","default":0},{"locale":"id-ID","link":"https:\/\/www.hostinger.com\/id\/tutorial\/cara-mengamankan-vps","default":0},{"locale":"de-DE","link":"https:\/\/www.hostinger.com\/de\/tutorials\/tipps-zur-vps-sicherheit","default":0},{"locale":"it-IT","link":"https:\/\/www.hostinger.com\/it\/tutorial\/sicurezza-vps","default":0},{"locale":"en-UK","link":"https:\/\/www.hostinger.com\/uk\/tutorials\/vps-security","default":0},{"locale":"en-MY","link":"https:\/\/www.hostinger.com\/my\/tutorials\/vps-security","default":0},{"locale":"en-PH","link":"https:\/\/www.hostinger.com\/ph\/tutorials\/vps-security","default":0},{"locale":"es-MX","link":"https:\/\/www.hostinger.com\/mx\/tutoriales\/seguridad-vps","default":0},{"locale":"es-CO","link":"https:\/\/www.hostinger.com\/co\/tutoriales\/seguridad-vps","default":0},{"locale":"es-AR","link":"https:\/\/www.hostinger.com\/ar\/tutoriales\/seguridad-vps","default":0},{"locale":"pt-PT","link":"https:\/\/www.hostinger.com\/pt\/tutoriais\/vps-seguro","default":0},{"locale":"en-IN","link":"https:\/\/www.hostinger.com\/in\/tutorials\/vps-security","default":0},{"locale":"en-CA","link":"https:\/\/www.hostinger.com\/ca\/tutorials\/vps-security","default":0},{"locale":"en-AU","link":"https:\/\/www.hostinger.com\/au\/tutorials\/vps-security","default":0},{"locale":"en-NG","link":"https:\/\/www.hostinger.com\/ng\/tutorials\/vps-security","default":0}],"_links":{"self":[{"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/posts\/53874","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/users\/298"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/comments?post=53874"}],"version-history":[{"count":48,"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/posts\/53874\/revisions"}],"predecessor-version":[{"id":144431,"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/posts\/53874\/revisions\/144431"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/media\/144432"}],"wp:attachment":[{"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/media?parent=53874"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/categories?post=53874"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/tags?post=53874"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}