<?xml version="1.0"?>
<rss version="2.0"><channel><title>Performance and Security Latest Topics</title><link>https://www.lcwhost.org/forum/14-performance-and-security/</link><description>Performance and Security Latest Topics</description><language>en</language><item><title>Let's Encrypt for Apache - CentOS 7/AlmaLinux 8</title><link>https://www.lcwhost.org/topic/14787-lets-encrypt-for-apache-centos-7almalinux-8/</link><description><![CDATA[<p style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	Let's Encrypt is a certificate authority that provides free certificates in a fully automated process.<br>
	In this guide, you will learn how to set up a TLS/SSL certificate from Let’s Encrypt on an Centos 7 / AlmaLinux 8 servers running Apache as a web server.
</p>

<h3 style="background-color:#ffffff;border:none;color:#555a62;font-size:24px;padding:0px;vertical-align:baseline;">
	Preparation
</h3>

<p style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	Before enabling the Let's Encrypt certificate, make sure you have Apache Web Server installed on your server. If not, you can check out our<span> </span><a href="https://community.time4vps.com/discussion/679/centos-7-almalinux-how-to-install-apache-web-server-on-centos-7-almalinux#latest" rel="external nofollow" style="border:0px;color:#ed1c24;font-size:14px;padding:0px;vertical-align:baseline;" title="Apache web server installation guide">Apache web server installation guide</a>.
</p>

<p style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	You also need to create a virtual host configuration file by typing this command (if you didn't do it during Apache installation):
</p>

<p style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">vi /etc/httpd/conf.d/yourdomain.ltd.conf</code>
</p>

<p style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	Add these lines to the configuration file:
</p>

<blockquote style="border-left-color:rgba(0,0,0,0.1);border-left-style:solid;border-width:0px 0px 0px 4px;color:#333333;font-size:17.5px;padding:1ex 16px;vertical-align:baseline;">
	<div style="border:0px;font-size:17.5px;padding:0px;vertical-align:baseline;">
		<pre style="border:1px solid #cccccc;color:#333333;font-size:13px;padding:9.5px;vertical-align:baseline;"><code style="border:none;color:inherit;font-size:inherit;padding:0px;vertical-align:baseline;">&lt;VirtualHost *:80&gt;
  ServerAdmin admin@yourdomain.ltd
  DocumentRoot "/var/www/html"
  DirectoryIndex index.html
  ServerName yourdomain.ltd
  ErrorLog "/var/log/httpd/yourdomain.ltd.error_log"
  CustomLog "/var/log/httpd/yourdomain.ltd.access_log" common
&lt;/VirtualHost&gt;
</code></pre>
	</div>
</blockquote>

<p style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	<strong>Please note.</strong><span> </span>Make sure to change the "yourdomain.ltd" to your actual domain.
</p>

<p style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	After editing, you can save changes and exit.
</p>

<h3 style="background-color:#ffffff;border:none;color:#555a62;font-size:24px;padding:0px;vertical-align:baseline;">
	1. Creating An Index.Html File For Testing
</h3>

<p style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	To create an index.html file for testing, run this command:
</p>

<p style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">vi /var/www/html/index.html</code>
</p>

<p style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	Enter the text for testing in the file:
</p>

<blockquote style="border-left-color:rgba(0,0,0,0.1);border-left-style:solid;border-width:0px 0px 0px 4px;color:#333333;font-size:17.5px;padding:1ex 16px;vertical-align:baseline;">
	<div style="border:0px;font-size:17.5px;padding:0px;vertical-align:baseline;">
		<pre style="border:1px solid #cccccc;color:#333333;font-size:13px;padding:9.5px;vertical-align:baseline;"><code style="border:none;color:inherit;font-size:inherit;padding:0px;vertical-align:baseline;">  &lt;html&gt;
   Page for testing purposes
  &lt;/html&gt;
</code></pre>
	</div>
</blockquote>

<p style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	After that, you can save the file and exit.
</p>

<p style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	Now you need to change the owner of the ‘/var/www/html/index.html’ file to Apache by entering this command:
</p>

<p style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">chown -R apache:apache /var/www/html/index.html</code>
</p>

<p style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	This means that Apache can now read this file.
</p>

<h3 style="background-color:#ffffff;border:none;color:#555a62;font-size:24px;padding:0px;vertical-align:baseline;">
	2. Install Certbot
</h3>

<p style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	On Centos 7 follow these steps to install Cerbot:
</p>

<ol style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	<li style="border:0px;font-size:14px;padding:0px;vertical-align:baseline;">
		We need to add the EPEL repository before installing Certbot. Run this command:<br>
		<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">yum install epel-release</code>
	</li>
	<li style="border:0px;font-size:14px;padding:0px;vertical-align:baseline;">
		Install the Certbot:<br>
		<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">yum install certbot python2-certbot-apache mod_ssl</code>
	</li>
</ol>

<p style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	On AlmaLinux 8 follow these steps to install Cerbot:
</p>

<ol style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	<li style="border:0px;font-size:14px;padding:0px;vertical-align:baseline;">
		Run this command to add the EPEL repository before installing Certbot:<br>
		<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">dnf install epel-release</code>
	</li>
	<li style="border:0px;font-size:14px;padding:0px;vertical-align:baseline;">
		Install the Certbot:<br>
		<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">dnf install certbot python3-certbot-apache</code>
	</li>
</ol>

<h3 style="background-color:#ffffff;border:none;color:#555a62;font-size:24px;padding:0px;vertical-align:baseline;">
	3.Set Up The SSL Certificate
</h3>

<p style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	To set up the SSL for domain, run this command:
</p>

<p style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">certbot --apache -d yourdomain.ltd</code>
</p>

<p style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	You can install certificate for multiple domains and subdomains by following this command:
</p>

<p style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">certbot --apache -d yourdomain.ltd -d www.yourdomain.ltd -d yourdomain2.ltd -d subdomain.yourdomain2.ltd</code>
</p>

<p style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	When issuing a certificate, you will need to provide an email, that you specified previously in virtual host configuration file (<strong>admin@yourdomain.ltd</strong>).<br>
	You will also need to agree to the Terms of Service (mandatory) and agree or disagree to share your email address with Electronic Frontier Foundation (optional)
</p>

<h4 style="background-color:#ffffff;border:0px;color:#555a62;font-size:18px;padding:0px;vertical-align:baseline;">
	Please note.
</h4>

<p style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	When issuing a certificate, you may receive the following error message:
</p>

<p style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	<img class="ipsImage ipsImage_thumbnailed" data-fileid="11" width="806" alt="log90nj4w9k3.webp.73ae6bea3ae28a79c83042bbc5194c29.webp" src="https://www.lcwhost.org/uploads/monthly_2025_01/log90nj4w9k3.webp.73ae6bea3ae28a79c83042bbc5194c29.webp" loading="lazy" height="145.08">
</p>

<p style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	Cancel the certificate issue process (enter 'c') and restart Apache service with the following command:
</p>

<p style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">systemctl restart httpd</code>
</p>

<p style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	After that, try to issue the certificate again.
</p>

<h3 style="background-color:#ffffff;border:none;color:#555a62;font-size:24px;padding:0px;vertical-align:baseline;">
	4.Check SSL Certificate
</h3>

<p style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	Enter this command to check if SSL issued successfully:
</p>

<p style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">ls /etc/letsencrypt/live/yourdomain.ltd/</code>
</p>

<p style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	You should see the following output:
</p>

<p style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">cert.pem chain.pem fullchain.pem privkey.pem</code>
</p>

<p style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	You can also check SSL in your browser. Open your website and click on the padlock icon in the address bar to see information about certificate.
</p>

<h3 style="background-color:#ffffff;border:none;color:#555a62;font-size:24px;padding:0px;vertical-align:baseline;">
	5.Manual And Automatic Renewal
</h3>

<p style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	Let’s Encrypt certificates are valid for 90 days.
</p>

<p style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	You can manually renew certificate with this command:
</p>

<p style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">certbot renew --dry-run</code>
</p>

<p style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	If the certificate is less than 30 days away from expiration, this command will renew it.
</p>

<p style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	If you want to specify auto-renewal, you can edit the crontab and create cronjob to run the above command twice a day automatically:
</p>

<p style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">crontab -e</code>
</p>

<p style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	Add this line to the crontab:
</p>

<blockquote style="border-left-color:rgba(0,0,0,0.1);border-left-style:solid;border-width:0px 0px 0px 4px;color:#333333;font-size:17.5px;padding:1ex 16px;vertical-align:baseline;">
	<div style="border:0px;font-size:17.5px;padding:0px;vertical-align:baseline;">
		<pre style="border:1px solid #cccccc;color:#333333;font-size:13px;padding:9.5px;vertical-align:baseline;"><code style="border:none;color:inherit;font-size:inherit;padding:0px;vertical-align:baseline;"> * */12 * * * root /usr/bin/certbot renew &gt;/dev/null 2&gt;&amp;1
</code></pre>
	</div>
</blockquote>

<p style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	You're all set. When necessary, certbot will renew your certificates and reload Apache to pick up the changes.
</p>

<h4 style="background-color:#ffffff;border:0px;color:#555a62;font-size:18px;padding:0px;vertical-align:baseline;">
	Please note.
</h4>

<p style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	If, after activating the certificate, your site is still not available and you receive "Secure Connection Failed" error, make sure to allow traffic via HTTPS (port 443), which could be blocked in firewalld by default.
</p>

<p style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	You can check if HTTPS enabled, using this command:
</p>

<p style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">firewall-cmd --list-all</code>
</p>

<p style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	The output will provide you information about enabled services. In this screenshot, you can see that port 443 is enabled:
</p>

<p style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	<img class="ipsImage ipsImage_thumbnailed" data-fileid="10" width="282" alt="hpsp0h5eo90e.webp.59ee7210e2aec2454b9ff481e7ab6c7a.webp" src="https://www.lcwhost.org/uploads/monthly_2025_01/hpsp0h5eo90e.webp.59ee7210e2aec2454b9ff481e7ab6c7a.webp" loading="lazy" height="236.88">
</p>

<p style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	If 443 port disabled, you can enable it with firewalld or iptables.
</p>

<p style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	To enable https service in firewalld, use this command:
</p>

<p style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">firewall-cmd --permanent --add-service=https</code>
</p>

<p style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	Then reload the firewall:
</p>

<p style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">firewall-cmd --reload</code>
</p>

<p style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	To enable https in iptables, use this command:
</p>

<p style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">iptables -I INPUT -p tcp -m tcp --dport 443 -j ACCEPT</code>
</p>

<p style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	Then save the changes:
</p>

<p style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">iptables-save</code>
</p>
]]></description><guid isPermaLink="false">14787</guid><pubDate>Thu, 23 May 2024 09:48:01 +0000</pubDate></item><item><title>How to modify SWAP memory</title><link>https://www.lcwhost.org/topic/51-how-to-modify-swap-memory/</link><description><![CDATA[<div style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;text-align:justify;vertical-align:baseline;">
	SWAP memory is used to help RAM, once it cannot store any more data. The data which cannot be stored in RAM is then stored to SWAP memory in the hard disk. In this article, we will provide the basic steps on how to modify and increase SWAP memory in our KVM virtualization Linux VPS packages.<br />
	 
</div>

<div style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;text-align:justify;vertical-align:baseline;">
	In general, there are different opinions on how much SWAP memory your server should have. It could be half of your RAM, the same amount or even more than RAM. In our article, we will assign 6 GB of SWAP to the server.
</div>

<p style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	 
</p>

<h3 style="background-color:#ffffff;border:none;color:#555a62;font-size:24px;padding:0px;vertical-align:baseline;">
	Allocating SWAP Memory
</h3>

<div style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;text-align:justify;vertical-align:baseline;">
	First thing you should do is to check if there is no SWAP memory in use on your server with the following command:
</div>

<pre style="border:1px solid #cccccc;color:#333333;font-size:13px;padding:9.5px;vertical-align:baseline;">free -h
</pre>

<p style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	Your results will be printed in two lines: "Mem", "Swap", which will indicate, what the exact amount of RAM and SWAP memory is on the KVM server. The "Swap" line should only contain zeros. 
</p>

<div style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;text-align:justify;vertical-align:baseline;">
	 
</div>

<div style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;text-align:justify;vertical-align:baseline;">
	With the following command, we will allocate 6 GB of disk space for our SWAP memory:
</div>

<pre style="border:1px solid #cccccc;color:#333333;font-size:13px;padding:9.5px;vertical-align:baseline;">fallocate -l 6G /swapfile</pre>

<p>
	 
</p>

<div style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;text-align:justify;vertical-align:baseline;">
	You can check if your SWAP memory was assigned with this command:
</div>

<pre style="border:1px solid #cccccc;color:#333333;font-size:13px;padding:9.5px;vertical-align:baseline;">ls -lh /swapfile</pre>

<p>
	 
</p>

<div style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;text-align:justify;vertical-align:baseline;">
	At first, your SWAP may not be allocated due to permission issue and you might be seeing this message:
</div>

<p style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	 
</p>

<pre style="border:1px solid #cccccc;color:#333333;font-size:13px;padding:9.5px;vertical-align:baseline;">-rw-r--r-- 1 root root 6.0G Dec 5 14:32 /swapfile
</pre>

<p>
	 
</p>

<div style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;text-align:justify;vertical-align:baseline;">
	This would suggest we have to make additional changes, first of which should be changing the permission of the swapfile:
</div>

<pre style="border:1px solid #cccccc;color:#333333;font-size:13px;padding:9.5px;vertical-align:baseline;">chmod 600 /swapfile</pre>

<p>
	 
</p>

<div style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;text-align:justify;vertical-align:baseline;">
	After the change you can check the file permissions again:
</div>

<pre style="border:1px solid #cccccc;color:#333333;font-size:13px;padding:9.5px;vertical-align:baseline;">ls -lh /swapfile</pre>

<p>
	 
</p>

<div style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;text-align:justify;vertical-align:baseline;">
	The results should change as well, comparing to the previous above:
</div>

<pre style="border:1px solid #cccccc;color:#333333;font-size:13px;padding:9.5px;vertical-align:baseline;"><code style="border:none;color:inherit;font-size:inherit;padding:0px;vertical-align:baseline;">-rw------- 1 root root 6.0G Dec  5 14:36 /swapfile</code></pre>

<div style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	 
</div>

<div style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	Now set the swapfile as Linux swap area:
	<pre style="border:1px solid #cccccc;color:#333333;font-size:13px;padding:9.5px;vertical-align:baseline;"><code style="border:none;color:inherit;font-size:inherit;padding:0px;vertical-align:baseline;">mkswap /swapfile</code></pre>
</div>

<div style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	Finally, enable SWAP usage:
</div>

<div style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	<pre style="border:1px solid #cccccc;color:#333333;font-size:13px;padding:9.5px;vertical-align:baseline;"><code style="border:none;color:inherit;font-size:inherit;padding:0px;vertical-align:baseline;">swapon /swapfile</code></pre>
</div>

<div style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;text-align:justify;vertical-align:baseline;">
	We can now check if the SWAP memory was allocated correctly:
</div>

<pre style="border:1px solid #cccccc;color:#333333;font-size:13px;padding:9.5px;vertical-align:baseline;">free -h</pre>

<p style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	Your results will print two lines again, just this time, you will see a line "Swap" having a variable of 6 GB.
</p>

<p>
	 
</p>

<h3 style="background-color:#ffffff;border:none;color:#555a62;font-size:24px;padding:0px;vertical-align:baseline;">
	Additional Options
</h3>

<div style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;text-align:justify;vertical-align:baseline;">
	In general, your SWAP memory allocation may stop working after you reboot the KVM server, so in order to save these changes permanently, we have to edit /etc/fstab. But first, we would recommend making a backup of this file:
</div>

<pre style="border:1px solid #cccccc;color:#333333;font-size:13px;padding:9.5px;vertical-align:baseline;">cp /etc/fstab /etc/fstab.old</pre>

<p>
	 
</p>

<div style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;text-align:justify;vertical-align:baseline;">
	Once the backup is done, we have to make the changes to the actual file:
</div>

<pre style="border:1px solid #cccccc;color:#333333;font-size:13px;padding:9.5px;vertical-align:baseline;">echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab</pre>

<p>
	 
</p>

<div style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;text-align:justify;vertical-align:baseline;">
	There are few extra options for SWAP memory, which we would like to address as well:<br />
	 
</div>

<div style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;text-align:justify;vertical-align:baseline;">
	Option - swappiness, is used to describe when the system will move data to the SWAP file. The option may have a value from 0 to 100. Closer to 0, means that your data will be moved to SWAP only when it will be necessary.  Closer to 100 means that, data will be moved to SWAP more often, therefore leaving RAM memory more free. We would recommend keeping this option closer to 0, for example, 10.<br />
	 
</div>

<div style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;text-align:justify;vertical-align:baseline;">
	You can check the current value with the following command:
</div>

<pre style="border:1px solid #cccccc;color:#333333;font-size:13px;padding:9.5px;vertical-align:baseline;">cat /proc/sys/vm/swappiness</pre>

<p>
	 
</p>

<div style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;text-align:justify;vertical-align:baseline;">
	Option - vfs_cache_pressure, this option sets how often the information about the file system is updated. By default, it should be 100, but we would recommend using a lower value, for example, 50.<br />
	 
</div>

<div style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;text-align:justify;vertical-align:baseline;">
	The current value can be checked with this command:
</div>

<pre style="border:1px solid #cccccc;color:#333333;font-size:13px;padding:9.5px;vertical-align:baseline;">cat /proc/sys/vm/vfs_cache_pressure</pre>

<p>
	 
</p>

<div style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;text-align:justify;vertical-align:baseline;">
	Both of the additional options can be edited at the file /etc/sysctl.conf<br />
	by adding the following line at the bottom of the file:
</div>

<div style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;text-align:justify;vertical-align:baseline;">
	 
</div>

<p>
	<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">vm.swappiness=10</code><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">vm.vfs_cache_pressure=50</code><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	 
</p>

<p style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	<i>If any questions remain, please<span> </span><strong><a href="https://www.lcwhost.com/contact-us/" rel="external nofollow"><span style="color:#d35400;">contact our customer support</span></a></strong>, we will be glad to help.</i>
</p>
]]></description><guid isPermaLink="false">51</guid><pubDate>Fri, 21 Apr 2023 08:28:29 +0000</pubDate></item><item><title>Tips in how to secured your VPS</title><link>https://www.lcwhost.org/topic/50-tips-in-how-to-secured-your-vps/</link><description><![CDATA[<p>
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">Here is a simple, straightforward guide to improving VPS security.</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<b style="background-color:#ffffff;color:#333333;font-size:14px;">Change the SSH port</b><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">One of the most common points of attack is port 22. Changing this discourages many of them as well as scripts set to check for that port. In order to change the port do the following:</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">nano /etc/ssh/sshd_config</code><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">You should locate a line that looks like:</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">#Port 22</code><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">Un-comment this line and change the port number. A port number above 1024 is recommended.</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">This section of your sshd_conf should now look like:</span>
</p>

<pre style="border:1px solid #cccccc;color:#333333;font-size:13px;padding:9.5px;vertical-align:baseline;"><code style="border:none;color:inherit;font-size:inherit;padding:0px;vertical-align:baseline;">Port 2222
#AddressFamily any
#ListenAddress 0.0.0.0
#ListenAddress ::</code></pre>

<p>
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">You can now save and exit nano (Ctrl x) and restart the SSHD service by issuing the following command:</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">service sshd restart</code><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">IMPORTANT: Make sure you can connect to SSH using the new port. Leave your current SSH session open and open a new session using the new port you set above. If you can connect to the new SSH session on the new port than everything is good. If you cannot, then you need to figure out why. This is why you left the original SSH session open, otherwise, you would be locked out of your server.</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">You may need to add the new port in your IPTables.</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">First, open your IPtables rules:</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">nano /etc/sysconfig/iptables</code><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">Next, locate the COMMIT line and add the following above it making sure to change #### to the port you set for SSH:</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport #### -j ACCEPT</code><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">You can now save and exit nano (Ctrl x) and restart the IPtables service:</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">service iptables restart</code><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">You should now try to connect to SSH again. If you still cannot connect to it, it would be best to set your SSH port back to 22 and contact your service provider for help.</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<b style="background-color:#ffffff;color:#333333;font-size:14px;">Use strong passwords for everything</b><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">One of the most common causes of system breach is weak passwords. For a strong password, follow a few simple guidelines:</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">• Minimum password length should be 10 characters</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">• Always use a mix of numbers, letters, uppercase, lowercase, and symbols (when allowed)</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">• Strong Password Example-<span> </span></span><span style="background-color:#ffffff;color:#333333;font-size:14px;">T=ep@Uy</span><span style="background-color:#ffffff;color:#333333;font-size:14px;">*ST</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">If you need to change your root password, issue the following command and follow the prompts:</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">passwd</code><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<b style="background-color:#ffffff;color:#333333;font-size:14px;">Disable Root User</b><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">It is a security risk to keep the root user enabled. Most operations and installs should not be done using root. Instead, create a regular user and if you need root privileges, use the su command.</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">To add a user, do the following replacing “namehere” with your desired username:</span>
</p>

<pre style="border:1px solid #cccccc;color:#333333;font-size:13px;padding:9.5px;vertical-align:baseline;"><code style="border:none;color:inherit;font-size:inherit;padding:0px;vertical-align:baseline;">useradd namehere
passwd namehere</code></pre>

<p>
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">Now, disable root login to SSH by editing your sshd_config file:</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">nano /etc/ssh/sshd_config PermitRootLogin no (make sure you remove the #)</code><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">Now save and exit Nano (Ctrl x) and restart SSHd:</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	 
</p>

<div style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">service sshd restart</code>
</div>

<p>
	 
</p>

<div style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	For your next connection, use the previously created “namehere” user and if needed to perform root commands, simply use the “su” command followed with the root password.
</div>

<div style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	 
</div>

<p>
	<b style="background-color:#ffffff;color:#333333;font-size:14px;">Restrict SSH access by IP using IPtables</b><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">This adds a great amount of security but make sure you have a static IP.</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">First, open your IPtables rules:</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">nano /etc/sysconfig/iptables</code><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">Locate the line containing rule with "--dport 22" fragment and add the following above it making sure to change #### to the port you set for SSH and 192.168.0.1 to your IP address:</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">-A INPUT -p tcp -s 192.168.0.1 --dport #### -j ACCEPT</code><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">You can now save and exit nano (Ctrl x) and restart the iptables service:</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">service iptables restart</code><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<b style="background-color:#ffffff;color:#333333;font-size:14px;">Install RkHunter</b><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">Every server needs something checking for rootkits, backdoors, md5 hashes (file changes), hidden files, etc.. etc.. and RKHunter is great at this.</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">To install RKHunter, issue the following commands:</span>
</p>

<pre style="border:1px solid #cccccc;color:#333333;font-size:13px;padding:9.5px;vertical-align:baseline;"><code style="border:none;color:inherit;font-size:inherit;padding:0px;vertical-align:baseline;">yum install rkhunter -y</code></pre>

<p>
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">You need to set up a daily cron so that rkhunter will check its version and update it if needed as well as run a scan. We will also be setting it so it will e-mail you the daily report.</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">Create and open in nano a new cron task/shell script by issuing the command below:</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">nano -w /etc/cron.daily/rkhunter.sh</code><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">Now add the following making sure to replace “PutYourServerNameHere” with your server's hostname and “</span><span style="background-color:#ffffff;color:#333333;font-size:14px;">your@email.here</span><span style="background-color:#ffffff;color:#333333;font-size:14px;">” with your email address:</span>
</p>

<pre style="border:1px solid #cccccc;color:#333333;font-size:13px;padding:9.5px;vertical-align:baseline;"><code style="border:none;color:inherit;font-size:inherit;padding:0px;vertical-align:baseline;">#!/bin/sh(/usr/local/bin/rkhunter --versioncheck/usr/local/bin/rkhunter --update/usr/local/bin/rkhunter --cronjob --report-warnings-only)
/bin/mail -s 'rkhunter Daily Run (PutYourServerNameHere)' your@email.here</code></pre>

<p>
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">If you don’t know your server’s hostname, you can find it by typing hostname in your ssh window. You will need to exit (Ctrl x) nano first or open another session.</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">You also need to secure the script making it usable only by root. To do this, issue the following command:</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">chmod 700 /etc/cron.daily/rkhunter.sh</code><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">Now test it and make sure it runs ok. To run rkhunter manually, issue the following command:</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">rkhunter -c -sk</code><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">That’s it. You're done and your server just became much safer!</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<b style="background-color:#ffffff;color:#333333;font-size:14px;">Install CSF (Config Server Firewall)</b><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">CSF includes many different types of protection and is much more user-friendly than using IPTables directly.</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">If you are not sure whether you have Perl installed issue the following command:</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">perl -v</code><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">If perl is installed, it will return which version. If it is not installed, issue the following command to install it:</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	 
</p>

<div style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">yum install perl-libwww-perl.noarch perl-LWP-Protocol-https.noarch perl-GDGraphyum install perl perl-libwww-perl perl-Time-HiRes -y</code>
</div>

<p>
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">Now you can install CSF with the command below:</span>
</p>

<pre style="border:1px solid #cccccc;color:#333333;font-size:13px;padding:9.5px;vertical-align:baseline;"><code style="border:none;color:inherit;font-size:inherit;padding:0px;vertical-align:baseline;">cd /usr/src
rm -fv csf.tgz
wget https://download.configserver.com/csf.tgz
tar -xzf csf.tgz
cd csf
sh install.sh
</code></pre>

<p>
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">Make sure that you have the required iptable modules by issuing the following command:</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">perl /etc/csf/csftest.pl</code><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">It is possible that you will be missing some modules, but as long as the test does not return a fatal error, you should be fine. You may lose some functionality of CSF with missing modules but it will work.</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">When you install CSF, it automatically whitelists your IP. It also starts in test mode which means it clears the rules every 5 minutes. Make sure you leave it in test mode until you are sure your configuration is working properly. If you do lock yourself out, just wait for 5 minutes and you will be able to log in again. The stock configuration is fine for most servers though some changes should be made.</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">If you changed your SSH port above, you need to make sure to add it to your CSF config. To edit the csf configuration, issue the following command:</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">nano /etc/csf/csf.conf</code><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">The first thing to edit is the TCP ports. You can delete port 22 on inbound and outbound since SSH uses your new port which should already have been added to the end of the inbound line, if not then add it. You will also need to add it to the outbound TCP:</span>
</p>

<pre style="border:1px solid #cccccc;color:#333333;font-size:13px;padding:9.5px;vertical-align:baseline;"><code style="border:none;color:inherit;font-size:inherit;padding:0px;vertical-align:baseline;"># Allow incoming TCP portsTCP_IN = "20,21,25,53,80,110,143,443,465,587,993,995,####"
# Allow outgoing TCP portsTCP_OUT = "20,21,22,25,53,80,110,113,443,####"</code></pre>

<p>
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">Next, locate CONNLIMIT = “”</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">You should limit the number of concurrent connections per IP on the most commonly attacked ports which are 21 (FTP), 80 (HTTP), and your new SSH port. This setting is only for TCP.</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">CONNLIMIT = "21;5,####;5,80;20"</code><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">Next, configure port flood protection located directly under CONNLIMIT. Again, you should add the most commonly attacked ports. This setting limits the number of connections allowed at one time on a specified port.</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">PORTFLOOD = "21;tcp;5;300,80;tcp;20;5,####;tcp;5;300"</code><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">To set the e-mail that CSF will send reports to, find X_ARF_TO = “” and add your email address:</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">X_ARF_TO = "your@email.here"</code><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">That’s all the configuration changes we are going to cover in this guide.</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">Save and exit your editor (Ctrl x) and start CSF by issuing the following command:</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">csf -h (shows a list of csf commands) or csf -s (starts csf)</code><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">You need to open another SSH session and try to connect to your server. If you can connect without error your configuration is good!</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">Now we can disable testing mode so the lfd (login failure daemon) will be able to start.</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">To do this, go back into your csf.conf /etc/csf/csf.conf and find TESTING = “1″ and change it to “0″ then save and exit (Ctrl x). Restart CSF with the following command:</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">csf -r</code><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">Now you should remove the install archive by issuing the following command:</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">cd ../rm -fv csf.tgz</code><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">That's it! Now your server is more secure.</span>
</p>
]]></description><guid isPermaLink="false">50</guid><pubDate>Fri, 21 Apr 2023 08:22:50 +0000</pubDate></item><item><title>Tools to Encrypt/Decrypt and Password Protect Files</title><link>https://www.lcwhost.org/topic/49-tools-to-encryptdecrypt-and-password-protect-files/</link><description><![CDATA[<div style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;text-align:center;vertical-align:baseline;">
	<img class="ipsImage ipsImage_thumbnailed" data-fileid="12" width="650" alt="ogxkjt7ot89m.jpg.1f425883966190f84647c21383660950.jpg" src="https://www.lcwhost.org/uploads/monthly_2025_01/ogxkjt7ot89m.jpg.1f425883966190f84647c21383660950.jpg" loading="lazy" height="143">
</div>

<p>
	<br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<b style="background-color:#ffffff;color:#333333;font-size:14px;">Introduction</b><br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">Encryption is the process of encoding files in such a way that only those who are authorized can access it. Encryption does not of itself prevent interception but denies the file content to the interceptor. In an encryption scheme, the intended files, referred to as plaintext, is encrypted using an encryption algorithm, generating ciphertext that can only be read if decrypted.</span><br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">Linux distribution provides a few standard encryption/decryption tools that can prove to be handy at times. Here in this article, we have covered 3 such tools with proper standard examples, which will help you to encrypt, decrypt and password-protect your files.</span><br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<b style="background-color:#ffffff;color:#333333;font-size:14px;">1. GnuPG</b><br style="background-color:#ffffff;color:#333333;font-size:14px;">
	 
</p>

<div style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;text-align:center;vertical-align:baseline;">
	<img class="ipsImage ipsImage_thumbnailed" data-fileid="13" width="650" alt="dh2um2ik6wpq.webp.ac675b61bc2bc9ba6f09a8170762f687.webp" src="https://www.lcwhost.org/uploads/monthly_2025_01/dh2um2ik6wpq.webp.ac675b61bc2bc9ba6f09a8170762f687.webp" loading="lazy" height="117">
</div>

<p>
	<br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">GnuPG (GNU Privacy Guard, often called GPG) package in most of today’s Linux distributions comes by default, if in-case it’s not installed you may apt or yum it from the repository.</span><br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">Ubuntu/Debian:</span><br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">sudo apt-get install gnupg</code><br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">CentOS/Fedora:</span><br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">yum install gnupg</code><br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<b style="background-color:#ffffff;color:#333333;font-size:14px;">Encrypting</b><br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">Now you can encrypt a file using GPG. As soon as you run the<span> </span></span><i style="background-color:#ffffff;color:#333333;font-size:14px;">gpg</i><span style="background-color:#ffffff;color:#333333;font-size:14px;"><span> </span>command with option<span> </span></span><i style="background-color:#ffffff;color:#333333;font-size:14px;">-c</i><span style="background-color:#ffffff;color:#333333;font-size:14px;"><span> </span>(encryption only with symmetric cipher) it will create a file testfile.txt.gpg.</span><br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">gpg -c /path_to_the_file/testfile.txt</code><br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<b style="background-color:#ffffff;color:#333333;font-size:14px;">Note:</b><span style="background-color:#ffffff;color:#333333;font-size:14px;"><span> </span>Enter<span> </span></span><i style="background-color:#ffffff;color:#333333;font-size:14px;">Paraphrase</i><span style="background-color:#ffffff;color:#333333;font-size:14px;"><span> </span>twice to encrypt the given file. The above encryption was done with CAST5 encryption algorithm automatically. You may specify a different algorithm optionally. To see all the encryption algorithm present you may execute:</span><br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">gpg --version</code><br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<b style="background-color:#ffffff;color:#333333;font-size:14px;">Decrypting</b><br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">Now, if you want to decrypt the above encrypted file, you may use the following command:</span><br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">gpg /path_to_the_file/testfile.txt.gpg</code><br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<b style="background-color:#ffffff;color:#333333;font-size:14px;">Note:</b><span style="background-color:#ffffff;color:#333333;font-size:14px;"><span> </span>You need to provide the same password you gave at encryption to decrypt when prompted.</span><br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">More information about GNU Privacy Guard on official site:</span><br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<a href="https://www.gnupg.org/" rel="external nofollow" style="border:0px;color:#ed1c24;font-size:14px;padding:0px;vertical-align:baseline;">https://www.gnupg.org</a><br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<b style="background-color:#ffffff;color:#333333;font-size:14px;">2. Zip</b><br style="background-color:#ffffff;color:#333333;font-size:14px;">
	 
</p>

<div style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;text-align:center;vertical-align:baseline;">
	<img class="ipsImage ipsImage_thumbnailed" data-fileid="14" width="650" alt="7cajkalc3m6t.webp.0b102f16944896003a6808151c9515a9.webp" src="https://www.lcwhost.org/uploads/monthly_2025_01/7cajkalc3m6t.webp.0b102f16944896003a6808151c9515a9.webp" loading="lazy" height="117">
</div>

<p>
	<br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">It is one of the most famous archive formats and it is so much famous that we generally call archive files as zip files in day-to-day communication. It uses pkzip stream cipher algorithm.</span><br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">If you have not installed zip you can do it with apt or yum.</span><br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">Ubuntu/Debian:</span><br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">sudo apt-get install zip</code><br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">CentOS/Fedora:</span><br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">yum install zip</code><br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<b style="background-color:#ffffff;color:#333333;font-size:14px;">Encrypting</b><br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">Create an encrypted<span> </span></span><i style="background-color:#ffffff;color:#333333;font-size:14px;">zip</i><span style="background-color:#ffffff;color:#333333;font-size:14px;"><span> </span>file using<span> </span></span><i style="background-color:#ffffff;color:#333333;font-size:14px;">zip</i><span style="background-color:#ffffff;color:#333333;font-size:14px;">:</span><br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">zip --password mypassword testarchive.zip testfile.txt</code><br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">Or if you want to add more files into<span> </span></span><i style="background-color:#ffffff;color:#333333;font-size:14px;">zip</i><span style="background-color:#ffffff;color:#333333;font-size:14px;"><span> </span>archive:</span><br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">zip --password mypassword testarchive.zip testfile.txt testfile1.txt testfile2.txt</code><br style="background-color:#ffffff;color:#333333;font-size:14px;">
	 
</p>

<div style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	<b>Note:</b><span> </span>Here mypassword is the password used to encrypt it.
</div>

<p>
	 
</p>

<div style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	<b>Decrypting</b>
</div>

<div style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	 
</div>

<div style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	To decrypt the file, you will need to install unzip:<br>
	<br>
	Ubuntu/Debian:<br>
	<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">sudo apt-get install unzip</code><br>
	<br>
	CentOS/Fedora:<br>
	<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">yum install unzip</code>
</div>

<div style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	 
</div>

<div style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	Decrypt the password-protected zipped file using unzip:
</div>

<div style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">unzip testarchive.zip</code>
</div>

<div style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	 
</div>

<p>
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">You need to provide the same password you provided at encryption.</span><br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<b style="background-color:#ffffff;color:#333333;font-size:14px;">3. OpenSSL</b><br style="background-color:#ffffff;color:#333333;font-size:14px;">
	 
</p>

<div style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;text-align:center;vertical-align:baseline;">
	<img class="ipsImage ipsImage_thumbnailed" data-fileid="15" width="650" alt="qafcwpuai8ki.webp.728bda84318f7ccf908e20ae4b87764d.webp" src="https://www.lcwhost.org/uploads/monthly_2025_01/qafcwpuai8ki.webp.728bda84318f7ccf908e20ae4b87764d.webp" loading="lazy" height="91">
</div>

<p>
	<br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">By default OpenSSL is installed in all our templates, however, if you have removed it you can install it with apt-get or yum.</span><br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">Ubuntu/Debian:</span><br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">sudo apt-get install openssl</code><br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">CentOS/Fedora:</span><br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">yum install openssl</code><br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<b style="background-color:#ffffff;color:#333333;font-size:14px;">Encrypting</b><br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">openssl enc -aes-256-cbc -in /path_to_the_file/testfile.txt -out /path_to_the_file/testfile.dat</code><br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">Explanation of each option used in the above command.</span><br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">enc encryption</span><br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">-aes-256-cbc the algorithm to be used.</span><br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">-in full path of a file to be encrypted.</span><br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">-out the full path where it will be decrypted.</span><br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<b style="background-color:#ffffff;color:#333333;font-size:14px;">Decrypting</b><br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">Decrypt a file using<span> </span></span><i style="background-color:#ffffff;color:#333333;font-size:14px;">OpenSSL</i><span style="background-color:#ffffff;color:#333333;font-size:14px;">:</span><br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">openssl enc -aes-256-cbc -d -in /path_to_the_file/testfile.dat &gt; /path_to_the_file/testfile2.txt</code>
</p>
]]></description><guid isPermaLink="false">49</guid><pubDate>Fri, 21 Apr 2023 08:21:00 +0000</pubDate></item><item><title>Setting up SPF and DKIM on your Ubuntu and Debian OS</title><link>https://www.lcwhost.org/topic/48-setting-up-spf-and-dkim-on-your-ubuntu-and-debian-os/</link><description><![CDATA[<div style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;text-align:center;vertical-align:baseline;">
	<img class="ipsImage ipsImage_thumbnailed" data-fileid="16" width="300" alt="iy56hip79g90.jpg.8fbe4ceed7d1fc4cfe008fc28c9032ac.jpg" src="https://www.lcwhost.org/uploads/monthly_2025_01/iy56hip79g90.jpg.8fbe4ceed7d1fc4cfe008fc28c9032ac.jpg" loading="lazy" height="198">
</div>

<p>
	<b style="background-color:#ffffff;color:#333333;font-size:14px;">Introduction</b><br>
	<br>
	<b style="background-color:#ffffff;color:#333333;font-size:14px;">SPF</b><span style="background-color:#ffffff;color:#333333;font-size:14px;"><span> </span>(Sender Policy Framework) is a DNS text entry which shows a list of servers that should be considered allowed to send mail for a specific domain. Incidentally, the fact that SPF is a DNS entry can also considered a way to enforce the fact that the list is authoritative for the domain, since the owners/administrators are the only people allowed to add/change that main domain zone.</span>
</p>

<ul style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	<li style="border:0px;font-size:14px;padding:0px;vertical-align:baseline;">
		upon receipt, the HELO message and the sender address are fetched by the receiving mail server
	</li>
	<li style="border:0px;font-size:14px;padding:0px;vertical-align:baseline;">
		the receiving mail server runs a TXT DNS query against the claimed domain SPF entry
	</li>
	<li style="border:0px;font-size:14px;padding:0px;vertical-align:baseline;">
		the SPF entry data is then used to verify the sender server
	</li>
	<li style="border:0px;font-size:14px;padding:0px;vertical-align:baseline;">
		in case the check fails a rejection message is given to the sender server
	</li>
</ul>

<p>
	<b style="background-color:#ffffff;color:#333333;font-size:14px;">DKIM</b><span style="background-color:#ffffff;color:#333333;font-size:14px;"><span> </span>(DomainKeys Identified Mail) should be instead considered a method to verify that the messages' content are trustworthy, meaning that they weren't changed from the moment the a message left the initial mail server. This additional layer of trustability is achieved by an implementation of the standard public/private key signing process. Once again the owners of the domain add a DNS entry with the public DKIM key which will be used by receivers to verify that the message DKIM signature is correct, while on the sender side the server will sign the entitled mail messages with the corresponding private key.</span>
</p>

<ul style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	<li style="border:0px;font-size:14px;padding:0px;vertical-align:baseline;">
		when sending an outgoing message, the last server within the domain infrastructure checks against its internal settings if the domain used in the "From:" header is included in its "signing table". If not the process stops here
	</li>
	<li style="border:0px;font-size:14px;padding:0px;vertical-align:baseline;">
		a new header, called "DKIM-Signature", is added to the mail message by using the private part of the key on the message content
	</li>
	<li style="border:0px;font-size:14px;padding:0px;vertical-align:baseline;">
		from here on the message *main* content cannot be modified otherwise the DKIM header won't match anymore
	</li>
	<li style="border:0px;font-size:14px;padding:0px;vertical-align:baseline;">
		upon reception, the receiving server will make a TXT DNS query to retrieve the key used in the DKIM-Signature field
	</li>
	<li style="border:0px;font-size:14px;padding:0px;vertical-align:baseline;">
		the DKIM header check result can be then used when deciding if a message is fraudulent or trustworthy
	</li>
</ul>

<p>
	 
</p>

<p style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	<b>Setting Up SPF</b>
</p>

<p style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	SPF requires only that you add a TXT record to your DNS zone for the domain. How that happens depends on the tools provided by your domain registrar, or the tools you set up yourself should you manage your own nameservers. If using a registrar's web interface to make DNS changes, you may or may not have the option to enter a subdomain for the record. If you do, then leave that field blank.
</p>

<p style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	This generic SPF TXT record authorizes mail originating from mail servers for your domain that is identified by MX records and all other servers associated with your domain that have A records:
</p>

<div style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	<div style="border:0px;font-size:14px;padding:0px;vertical-align:baseline;">
		<pre style="border:1px solid #cccccc;color:#333333;font-size:13px;padding:9.5px;vertical-align:baseline;">"v=spf1 a mx -all"</pre>
	</div>
</div>

<p style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	Note that the double quotes are a necessary part of the SPF TXT record. Much more complicated records than this are possible, as outlined in the<span> </span><a href="http://www.open-spf.org/SPF_Record_Syntax/" rel="external nofollow" style="border:0px;color:#ed1c24;font-size:14px;padding:0px;vertical-align:baseline;">SPF documentation</a>.
</p>

<p>
	<br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<b style="background-color:#ffffff;color:#333333;font-size:14px;">Setting Up DKIM</b><br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">Setting up DKIM is a little more involved than SPF, but still not too challenging if you are already running a Postfix mail server on Ubuntu. First, install the necessary packages:</span>
</p>

<pre style="border:1px solid #cccccc;color:#333333;font-size:13px;padding:9.5px;vertical-align:baseline;">apt-get install opendkim opendkim-tools -y</pre>

<p style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	Open<span> </span><i>/etc/opendkim.conf</i><b>:</b>
</p>

<pre style="border:1px solid #cccccc;color:#333333;font-size:13px;padding:9.5px;vertical-align:baseline;">nano /etc/opendkim.conf
</pre>

<p style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	Add the following:
</p>

<div style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	<div style="border:0px;font-size:14px;padding:0px;vertical-align:baseline;">
		<pre style="border:1px solid #cccccc;color:#333333;font-size:13px;padding:9.5px;vertical-align:baseline;">Domain    your_domain
KeyFile   /etc/postfix/dkim.key
Selector  dkim
SOCKET    inet:8891@localhost</pre>
	</div>
</div>

<p>
	<i style="background-color:#ffffff;color:#333333;font-size:14px;">Open </i><u style="background-color:#ffffff;color:#333333;font-size:14px;"><i>/etc/default/opendkim</i></u><span style="background-color:#ffffff;color:#333333;font-size:14px;">:</span>
</p>

<pre style="border:1px solid #cccccc;color:#333333;font-size:13px;padding:9.5px;vertical-align:baseline;">nano /etc/default/opendkim
</pre>

<p style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	Add the following:
</p>

<div style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	<div style="border:0px;font-size:14px;padding:0px;vertical-align:baseline;">
		<pre style="border:1px solid #cccccc;color:#333333;font-size:13px;padding:9.5px;vertical-align:baseline;">SOCKET="inet:8891@localhost"</pre>
	</div>
</div>

<p>
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">Configure postfix to use this milter:</span>
</p>

<pre style="border:1px solid #cccccc;color:#333333;font-size:13px;padding:9.5px;vertical-align:baseline;">nano /etc/postfix/main.cf</pre>

<p>
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">Make sure that these two lines are present in the Postfix config file and are not commented out:</span>
</p>

<pre style="border:1px solid #cccccc;color:#333333;font-size:13px;padding:9.5px;vertical-align:baseline;">milter_protocol = 2
milter_default_action = accept</pre>

<p>
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">It is likely that a filter (SpamAssasin, Clamav etc.) is already used by Postfix; if the following parameters are present, just append the opendkim milter to them (milters are separated by a comma), the port number should be the same as in opendkim.conf:</span>
</p>

<pre style="border:1px solid #cccccc;color:#333333;font-size:13px;padding:9.5px;vertical-align:baseline;">smtpd_milters = unix:/spamass/spamass.sock, inet:localhost:8891
non_smtpd_milters = unix:/spamass/spamass.sock, inet:localhost:8891</pre>

<p>
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">If the parameters are missing, define them as follows:</span>
</p>

<pre style="border:1px solid #cccccc;color:#333333;font-size:13px;padding:9.5px;vertical-align:baseline;">smtpd_milters = inet:localhost:8891
non_smtpd_milters = inet:localhost:8891</pre>

<p>
	<br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<b style="background-color:#ffffff;color:#333333;font-size:14px;">Generating the Public and Private Keys</b><br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<i style="background-color:#ffffff;color:#333333;font-size:14px;">Now you can generate a private key for signing outgoing mail. Note that in the following command, "dkim" is the value given to Selector in /etc/opendkim.conf</i><span style="background-color:#ffffff;color:#333333;font-size:14px;">. This can be any simple string, provided you are consistent about replacing "dkim" with your desired value everywhere in this recipe. Run the following command to generate the key and associated materials in the form of two files,<span> </span></span><i style="background-color:#ffffff;color:#333333;font-size:14px;">dkim.private</i><span style="background-color:#ffffff;color:#333333;font-size:14px;">, and<span> </span></span><i style="background-color:#ffffff;color:#333333;font-size:14px;">dkim.txt</i><span style="background-color:#ffffff;color:#333333;font-size:14px;">. The former is the RSA private key, while the latter contains the entry you will have to place into your DNS records.</span>
</p>

<pre style="border:1px solid #cccccc;color:#333333;font-size:13px;padding:9.5px;vertical-align:baseline;">opendkim-genkey -t -s dkim -d your_domain</pre>

<p>
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">Move the key into place, but don't forget to take a copy and keep that copy backed up somewhere safe:</span>
</p>

<div style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	<div style="border:0px;font-size:14px;padding:0px;vertical-align:baseline;">
		<pre style="border:1px solid #cccccc;color:#333333;font-size:13px;padding:9.5px;vertical-align:baseline;">mv dkim.private /etc/postfix/dkim.key</pre>
	</div>
</div>

<p>
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">You'll need to restart Postfix and OpenDKIM services to pick up the configuration changes so that outgoing mail is signed using DKIM:</span>
</p>

<div style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	<div style="border:0px;font-size:14px;padding:0px;vertical-align:baseline;">
		<pre style="border:1px solid #cccccc;color:#333333;font-size:13px;padding:9.5px;vertical-align:baseline;">service opendkim start
service postfix restart</pre>
	</div>
</div>

<p>
	<br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<b style="background-color:#ffffff;color:#333333;font-size:14px;">Adding the Public Key to The Domain's DNS Records</b><br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">Next up is the DNS record setup. How you do this is again completely dependent on how you manage DNS or how it is managed for you - everyone's tools are different. Note that some registrars do not let you create raw TXT records with specific subdomains, which will prevent you from creating DKIM TXT records. If this is the case, then you will have to transfer your domain to a real registrar that lets you play with all the toys.<span> </span></span><b style="background-color:#ffffff;color:#333333;font-size:14px;">Or you can simply use our<span> </span></b><a href="https://www.time4vps.com/knowledgebase/working-with-dns-manager/" rel="external nofollow" style="border:0px;color:#ed1c24;font-size:14px;padding:0px;vertical-align:baseline;"><b>DNS management system</b></a><b style="background-color:#ffffff;color:#333333;font-size:14px;">!</b>
</p>

<p style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	You can find information about your public key in<span> </span><i>dkim.txt<span> </span></i>file:<i></i>
</p>

<pre style="border:1px solid #cccccc;color:#333333;font-size:13px;padding:9.5px;vertical-align:baseline;">cat dkim.txt<i>
</i></pre>

<p>
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">Here is how it looks on our DNS management system:</span><br style="background-color:#ffffff;color:#333333;font-size:14px;">
	 
</p>

<p>
	<img class="ipsImage ipsImage_thumbnailed" data-fileid="17" width="960" alt="h7zo10mpr6c9.webp.1448aa893992068dc368d076d8210518.webp" src="https://www.lcwhost.org/uploads/monthly_2025_01/h7zo10mpr6c9.webp.1448aa893992068dc368d076d8210518.webp" loading="lazy" height="230.4">
</p>

<p>
	 
	</p><p>
		<br style="background-color:#ffffff;color:#333333;font-size:14px;">
		<br style="background-color:#ffffff;color:#333333;font-size:14px;">
		<b style="background-color:#ffffff;color:#333333;font-size:14px;">Sharing a DKIM Key for Multiple Domains</b><br style="background-color:#ffffff;color:#333333;font-size:14px;">
		<br style="background-color:#ffffff;color:#333333;font-size:14px;">
		<span style="background-color:#ffffff;color:#333333;font-size:14px;">If you are serving multiple domains from the same mail server, then the contents of<span> </span></span><i style="background-color:#ffffff;color:#333333;font-size:14px;">/etc/opendkim.conf</i><span style="background-color:#ffffff;color:#333333;font-size:14px;">:</span>
	</p>


<pre style="border:1px solid #cccccc;color:#333333;font-size:13px;padding:9.5px;vertical-align:baseline;">nano /etc/opendkim.conf</pre>

<p>
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">Instead of:</span>
</p>

<pre style="border:1px solid #cccccc;color:#333333;font-size:13px;padding:9.5px;vertical-align:baseline;">Domain    your_domain
KeyFile   /etc/postfix/dkim.key
Selector  dkim
SOCKET    inet:8891@localhost</pre>

<p>
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">Should be:</span>
</p>

<pre style="border:1px solid #cccccc;color:#333333;font-size:13px;padding:9.5px;vertical-align:baseline;">Domain    *
KeyFile   /etc/postfix/dkim.key
Selector  dkim
SOCKET    inet:8891@localhost</pre>

<p>
	<br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<b style="background-color:#ffffff;color:#333333;font-size:14px;">Testing</b><br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">First of all, give the DNS changes a chance to propagate before using it. Decent testing service is<span> </span></span><a href="https://www.mail-tester.com/spf-dkim-check" rel="external nofollow" style="border:0px;color:#ed1c24;font-size:14px;padding:0px;vertical-align:baseline;">Mail Tester</a><span style="background-color:#ffffff;color:#333333;font-size:14px;">.</span>
</p>
]]></description><guid isPermaLink="false">48</guid><pubDate>Fri, 21 Apr 2023 08:19:48 +0000</pubDate></item><item><title>How to install Lynis and ClamAV</title><link>https://www.lcwhost.org/topic/47-how-to-install-lynis-and-clamav/</link><description><![CDATA[<p>
	<a href="https://cisofy.com/lynis/" rel="external nofollow" style="border:0px;color:#ed1c24;font-size:14px;padding:0px;vertical-align:baseline;">Lynis</a><span style="background-color:#ffffff;color:#333333;font-size:14px;"><span> </span>is an open-source security auditing tool. Used by system administrators, security professionals, and auditors, to evaluate the security defenses of their Linux and UNIX-based systems. It runs on the host itself, so it performs more extensive security scans than vulnerability scanners.</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<a href="https://www.clamav.net/" rel="external nofollow" style="border:0px;color:#ed1c24;font-size:14px;padding:0px;vertical-align:baseline;">ClamAV</a><span style="background-color:#ffffff;color:#333333;font-size:14px;"><span> </span>is an open-source (GPL) anti-virus engine used in a variety of situations including email scanning, web scanning, and endpoint security. It provides a number of utilities including a flexible and scalable multi-threaded daemon, a command-line scanner and an advanced tool for automatic database updates.</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<b style="background-color:#ffffff;color:#333333;font-size:14px;">0. Preliminary requirements:</b><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">"CentOS 7" template installed on the server;</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">"nano" text editor installed (yum install nano -y).</span>
</p>

<h1 style="background-color:#ffffff;border:0px;color:#555a62;font-size:36px;padding:0px;vertical-align:baseline;">
	1. Installation of Lynis
</h1>

<p>
	<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">mkdir /usr/local/lynis</code><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">cd /usr/local/lynis</code><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	 
</p>

<div style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">wget <a href="https://downloads.cisofy.com/lynis/lynis-2.7.5.tar.gz" rel="external nofollow">https://downloads.cisofy.com/lynis/lynis-2.7.5.tar.gz</a><br />
	<br />
	tar -xvf lynis-2.7.5.tar.gz</code><br />
	<br />
	The newest version can be found at:<span> </span><a href="https://cisofy.com/download/lynis/" rel="external nofollow" style="border:0px;color:#ed1c24;font-size:14px;padding:0px;vertical-align:baseline;">https://cisofy.com/download/lynis/</a><br />
	<br />
	<b>2. Using Lynis</b><br />
	<br />
	To execute Lynis we first have to move to its folder:<br />
	<br />
	<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">cd /usr/local/lynis/lynis</code><br />
	<br />
	In order to see Lynis tutorial execute:<br />
	<br />
	<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">./lynis</code><br />
	<br />
	To check entire VPS execute:<br />
	<br />
	<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">./lynis --check-all</code>

	<h1 style="border:0px;color:#555a62;font-size:36px;padding:0px;vertical-align:baseline;">
		1. Installation of ClamAV
	</h1>
	<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">yum install epel-release</code><br />
	<br />
	<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">yum update</code><br />
	<br />
	<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">yum install clamav-server clamav-data clamav-update clamav-filesystem clamav clamav-scanner-systemd clamav-devel clamav-lib clamav-server-systemd</code><br />
	<br />
	<b>2. Enabling Freshclam</b><br />
	<br />
	Freshclam will keep ClamAV up-to-date. In this tutorial, it is set to check 4 times a day for new files.<br />
	<br />
	<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">cp /etc/freshclam.conf /etc/freshclam.conf.bak</code><br />
	<br />
	<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">sed -i '/Example/d' /etc/freshclam.conf</code><br />
	<br />
	Edit "clam-freshclam.service" file:<br />
	<br />
	<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">nano /usr/lib/systemd/system/clam-freshclam.service</code><br />
	<br />
	And paste the content:
	<blockquote style="border-left-color:rgba(0,0,0,0.1);border-left-style:solid;border-width:0px 0px 0px 4px;font-size:17.5px;padding:1ex 10px;vertical-align:baseline;">
		# Run the freshclam as daemon<br />
		[Unit]<br />
		Description = freshclam scanner<br />
		After = network.target<br />
		<br />
		[Service]<br />
		Type = forking<br />
		ExecStart = /usr/bin/freshclam -d -c 4<br />
		Restart = on-failure<br />
		PrivateTmp = true<br />
		<br />
		[Install]<br />
		WantedBy=multi-user.target
	</blockquote>
	Enabling freshclam to start automatically:<br />
	<br />
	<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">systemctl enable clam-freshclam.service</code><br />
	<br />
	<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">systemctl start clam-freshclam.service</code>
</div>

<div style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	To manually update ClamAV virus database use the following command:<br />
	<br />
	<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">freshclam</code>
</div>

<div style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	 
</div>

<div style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	<b>3. Configuring ClamAV deamon</b><br />
	<br />
	<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">cp /usr/share/clamav/template/clamd.conf /etc/clamd.d/clamd.conf</code><br />
	<br />
	<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">sed -i '/Example/d' /etc/clamd.d/clamd.conf </code><br />
	<br />
	<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">mv /usr/lib/systemd/system/clamd@.service /usr/lib/systemd/system/clamd.service</code><br />
	<br />
	Now we have to change the clamd service file:<br />
	<br />
	<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">nano /usr/lib/systemd/system/clamd.service</code>

	<blockquote style="border-left-color:rgba(0,0,0,0.1);border-left-style:solid;border-width:0px 0px 0px 4px;font-size:17.5px;padding:1ex 10px;vertical-align:baseline;">
		[Unit]<br />
		Description = clamd scanner daemon<br />
		After = syslog.target nss-lookup.target network.target<br />
		<br />
		[Service]<br />
		Type = simple<br />
		ExecStart = /usr/sbin/clamd -c /etc/clamd.d/clamd.conf --nofork=yes<br />
		Restart = on-failure<br />
		PrivateTmp = true<br />
		<br />
		[Install]<br />
		WantedBy=multi-user.target
	</blockquote>
	Now move to "system" directory:<br />
	<br />
	<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">cd /usr/lib/systemd/system</code><br />
	<br />
	And enable clamd to start automatically:<br />
	<br />
	<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">systemctl enable clamd.service</code><br />
	<br />
	<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">systemctl start clamd.service</code>
</div>

<div style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	 
</div>

<div style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	<b>4. Manual scan options</b><br />
	To scan all files on the VPS and show name of each file:<br />
	<br />
	<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">clamscan -r /</code><br />
	<br />
	To scan all files on the VPS, but only show names of infected files when found:<br />
	<br />
	<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">clamscan -r -i /</code><br />
	<br />
	To scan all files on the VPS, but only show names of infected files, while scan running in the background (while in progress, you can check the scan with "<i>jobs</i>" command):<br />
	 
	<div style="border:0px;font-size:14px;padding:0px;vertical-align:baseline;">
		<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">clamscan -r -i / &amp;</code>
	</div>
	<br />
	To scan all files in all users home directories:<br />
	<br />
	<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">clamscan -r /home</code><br />
	<br />
	To scan all files in the USER directory and move infected files to different Quarantine directory:<br />
	<br />
	<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">clamscan -r --move=/home/USER/Quarantine /home/USER</code><br />
	 
	<div style="border:0px;font-size:14px;padding:0px;vertical-align:baseline;">
		To scan all files in the USER directory and delete the infected files:<br />
		 
		<div style="border:0px;font-size:14px;padding:0px;vertical-align:baseline;">
			<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">clamscan -r --remove /home/USER</code>
		</div>
	</div>
</div>
]]></description><guid isPermaLink="false">47</guid><pubDate>Fri, 21 Apr 2023 08:15:28 +0000</pubDate></item><item><title><![CDATA[Installation Of ConfigServer (CSF) Security & Firewall]]></title><link>https://www.lcwhost.org/topic/46-installation-of-configserver-csf-security-firewall/</link><description><![CDATA[<p>
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">ConfigServer Security &amp; Firewall is a popular Linux firewall security suite. It is easy to install, flexible to configure and secure with extra checks. CSF helps to control exactly what traffic is allowed in and out of the server and to protect the server from malicious attacks.</span>
</p>

<h3 style="background-color:#ffffff;border:none;color:#555a62;font-size:24px;padding:0px;vertical-align:baseline;">
	Preliminary Requirements:
</h3>

<ul style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	<li style="border:0px;font-size:14px;padding:0px;vertical-align:baseline;">
		CentOS 7, Fedora 23, Ubuntu 16.04 or Debian 8 OS installed.
	</li>
</ul>

<h3 style="background-color:#ffffff;border:none;color:#555a62;font-size:24px;padding:0px;vertical-align:baseline;">
	<b>Installation Of ConfigServer Security &amp; Firewall</b>
</h3>

<p>
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">For CentOS / Fedora firstly you need to install required for CSF Perl packages:</span>
</p>

<pre style="border:1px solid #cccccc;color:#333333;font-size:13px;padding:9.5px;vertical-align:baseline;">yum install perl-libwww-perl.noarch perl-Time-HiRes perl-core zip unzip bind-utils -y</pre>

<div style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	For Ubuntu and Debian install the following packages:
</div>

<div style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	<pre style="border:1px solid #cccccc;color:#333333;font-size:13px;padding:9.5px;vertical-align:baseline;"><code style="border:none;color:inherit;font-size:inherit;padding:0px;vertical-align:baseline;">apt-get install e2fsprogs dnsutils libwww-perl -y</code></pre>
	Then, download a CSF source archive:
</div>

<pre style="border:1px solid #cccccc;color:#333333;font-size:13px;padding:9.5px;vertical-align:baseline;">wget <a href="http://download.configserver.com/csf.tgz" rel="external nofollow" style="border:0px;color:#ed1c24;font-size:13px;padding:0px;vertical-align:baseline;">http://download.configserver.com/csf.tgz</a></pre>

<pre style="border:1px solid #cccccc;color:#333333;font-size:13px;padding:9.5px;vertical-align:baseline;">tar xzf csf.tgz</pre>

<p>
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">Then we need to run CSF installation script:</span>
</p>

<pre style="border:1px solid #cccccc;color:#333333;font-size:13px;padding:9.5px;vertical-align:baseline;">cd csf</pre>

<pre style="border:1px solid #cccccc;color:#333333;font-size:13px;padding:9.5px;vertical-align:baseline;">sh install.sh</pre>

<p>
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">After installation run the test in order to make sure that all required iptables modules are installed on your VPS:</span>
</p>

<pre style="border:1px solid #cccccc;color:#333333;font-size:13px;padding:9.5px;vertical-align:baseline;">perl /usr/local/csf/bin/csftest.pl</pre>

<p>
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">If all required iptables modules are installed you will receive such result:</span>
</p>

<pre style="border:1px solid #cccccc;color:#333333;font-size:13px;padding:9.5px;vertical-align:baseline;">Testing ip_tables/iptable_filter...OK
Testing ipt_LOG...OK
Testing ipt_multiport/xt_multiport...OK
Testing ipt_REJECT...OK
Testing ipt_state/xt_state...OK
Testing ipt_limit/xt_limit...OK
Testing ipt_recent...OK
Testing xt_connlimit...OK
Testing ipt_owner/xt_owner...OK
Testing iptable_nat/ipt_REDIRECT...OK
Testing iptable_nat/ipt_DNAT...OK

RESULT: csf should function on this server </pre>

<p>
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">After checking iptables modules we need to enable CSF. For this reason, you may open and edit configuration file:</span>
</p>

<pre style="border:1px solid #cccccc;color:#333333;font-size:13px;padding:9.5px;vertical-align:baseline;">vi /etc/csf/csf.conf</pre>

<p>
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">You need to change "TESTING" value to the zero:</span>
</p>

<pre style="border:1px solid #cccccc;color:#333333;font-size:13px;padding:9.5px;vertical-align:baseline;">TESTING = "0"</pre>

<div style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	Also, change the "RESTRICT_SYSLOG" value to 3:
	<pre style="border:1px solid #cccccc;color:#333333;font-size:13px;padding:9.5px;vertical-align:baseline;"><code style="border:none;color:inherit;font-size:inherit;padding:0px;vertical-align:baseline;">RESTRICT_SYSLOG = "3"</code></pre>
	Save the configuration file and execute the following command to restart CSF and reload new changes:
</div>

<pre style="border:1px solid #cccccc;color:#333333;font-size:13px;padding:9.5px;vertical-align:baseline;">csf -r</pre>

<div style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	If after the restart, you would receive a warning that starts with "*WARNING* Binary location for [SENDMAIL]", run the following commands:
	<pre style="border:1px solid #cccccc;color:#333333;font-size:13px;padding:9.5px;vertical-align:baseline;"><code style="border:none;color:inherit;font-size:inherit;padding:0px;vertical-align:baseline;">echo '#!/bin/sh' &gt; /usr/sbin/sendmail
chmod +x /usr/sbin/sendmail</code></pre>
</div>

<div style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	Then, to check if everything is fine, run the restart again:
	<pre style="border:1px solid #cccccc;color:#333333;font-size:13px;padding:9.5px;vertical-align:baseline;">csf -r</pre>
</div>

<div style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	This is it, now ConfigServer Security &amp; Firewall is successfully installed to your server.
</div>

<h3 style="background-color:#ffffff;border:none;color:#555a62;font-size:24px;padding:0px;vertical-align:baseline;">
	<b>Enable ConfigServer Security &amp; Firewall Web UI</b>
</h3>

<div style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	ConfigServer Security &amp; Firewall provides in-built Web UI for the managing firewall via a browser. After enabling Web UI you will be able to access the firewall via a specified port and manage it at the graphical interface. Firstly install Perl modules, required for Web UI:
</div>

<div style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	For CentOS / Fedora execute:
</div>

<pre style="border:1px solid #cccccc;color:#333333;font-size:13px;padding:9.5px;vertical-align:baseline;">yum install perl-IO-Socket-INET6 perl-Socket6 -y</pre>

<p>
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">For Debian / Ubuntu execute:</span>
</p>

<pre style="border:1px solid #cccccc;color:#333333;font-size:13px;padding:9.5px;vertical-align:baseline;">apt-get install libio-socket-ssl-perl libcrypt-ssleay-perl libnet-libidn-perl libio-socket-inet6-perl libsocket6-perl libwww-perl -y</pre>

<p>
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">In order to enable Web UI you need to edit the configuration file:</span>
</p>

<pre style="border:1px solid #cccccc;color:#333333;font-size:13px;padding:9.5px;vertical-align:baseline;">vi /etc/csf/csf.conf</pre>

<p>
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">You need to modify following values:</span>
</p>

<pre style="border:1px solid #cccccc;color:#333333;font-size:13px;padding:9.5px;vertical-align:baseline;"># 1 to enable, 0 to disable
UI = "1"

# Set this to the port that want to bind this service to. You should configure
# this port to be &gt;1023 and different from any other port already being used
#
# Do NOT enable access to this port in TCP_IN, instead only allow trusted IP's
# to the port using Advanced Allow Filters (see readme.txt)
UI_PORT = "7777"

# Optionally set the IP address to bind to. Normally this should be left blank
# to bind to all IP addresses on the server.
#
# If the server is configured for IPv6 but the IP to bind to is IPv4, then the
# IP address MUST use the IPv6 representation. For example 1.2.3.4 must use
# ::ffff:1.2.3.4
#
# Leave blank to bind to all IP addresses on the server
UI_IP = "111.111.111.111"

# This should be a secure, hard to guess username
# 
# This must be changed from the default
UI_USER = "username"

# This should be a secure, hard to guess password. That is, at least 8
# characters long with a mixture of upper and lowercase characters plus 
# numbers and non-alphanumeric characters
#
# This must be changed from the default
UI_PASS = "password"</pre>

<div style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	, where:<i></i>
</div>

<ul style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	<li style="border:0px;font-size:14px;padding:0px;vertical-align:baseline;">
		<i>UI</i><span> </span>- should be "1" for enabled Web UI;<i></i>
	</li>
	<li style="border:0px;font-size:14px;padding:0px;vertical-align:baseline;">
		<i>UI_PORT</i><span> </span>- port for accessing CSF firewall via the browser;
	</li>
	<li style="border:0px;font-size:14px;padding:0px;vertical-align:baseline;">
		<i>UI_IP</i><span> </span>- your server's IP address. Leave it blank to bind to all IP addresses on the server (e.g. if you have additional IPs);<i></i>
	</li>
	<li style="border:0px;font-size:14px;padding:0px;vertical-align:baseline;">
		<i>UI_USER</i><span> </span>- username for accessing CSF firewall via the browser;<i></i>
	</li>
	<li style="border:0px;font-size:14px;padding:0px;vertical-align:baseline;">
		<i>UI_PASS</i><span> </span>- password for accessing CSF firewall via the browser.
	</li>
</ul>

<div style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	 
</div>

<div style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	After it  add your public IP to the /etc/csf/ui/ui.allow file in order to allow access to CSF Web UI:
</div>

<pre style="border:1px solid #cccccc;color:#333333;font-size:13px;padding:9.5px;vertical-align:baseline;">echo "your_public_ip_address" &gt;&gt;  /etc/csf/ui/ui.allow</pre>

<p>
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">Finally restart lfd (Login Failure Daemon) daemon, which uses CSF Web UI:</span>
</p>

<pre style="border:1px solid #cccccc;color:#333333;font-size:13px;padding:9.5px;vertical-align:baseline;">service lfd restart</pre>

<div style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	Now you could access ConfigServer Security &amp; Firewall Web UI via your server's IP address and specified earlier port:<span> </span><a rel="" style="border:0px;color:#ed1c24;font-size:14px;padding:0px;vertical-align:baseline;">https://server_ip_address:port</a>
</div>

<div style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	<b>Note:</b><span> </span>use HTTPS to access Web UI.<a href="https://i.imgur.com/GWiMARF.jpg" rel="external nofollow" style="border:0px;color:#ed1c24;font-size:14px;padding:0px;vertical-align:baseline;"><img alt="GWiMARF.jpg" style="border:0px;font-size:14px;padding:0px;vertical-align:middle;" width="999" src="https://i.imgur.com/GWiMARF.jpg" loading="lazy" height="749.25"></a>
</div>

<h3 style="background-color:#ffffff;border:none;color:#555a62;font-size:24px;padding:0px;vertical-align:baseline;">
	<b>DoS / DDoS Attacks Prevention With ConfigServer Security &amp; Firewall</b>
</h3>

<p>
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">It is possible to configure ConfigServer Security &amp; Firewall to prevent VPS from small and limited DDoS attacks. In order to enable it, you need to edit /etc/csf/csf.conf file. If you have enabled Web UI, you could edit configuration file via it - just go to the "ConfigServer Firewall" and select "Firewall Configuration". In another case you need to edit /etc/csf/csf.conf via SSH:</span>
</p>

<pre style="border:1px solid #cccccc;color:#333333;font-size:13px;padding:9.5px;vertical-align:baseline;">vi /etc/csf/csf.conf</pre>

<p>
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">First of all you need to set up total number of connections allowed from single host:</span>
</p>

<pre style="border:1px solid #cccccc;color:#333333;font-size:13px;padding:9.5px;vertical-align:baseline;">CT_LIMIT = "20"</pre>

<p>
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">Set connection tracking interval (in seconds):</span>
</p>

<pre style="border:1px solid #cccccc;color:#333333;font-size:13px;padding:9.5px;vertical-align:baseline;">CT_INTERVAL = "30"</pre>

<p>
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">Enable email alerts sending for each blocked IP address:</span>
</p>

<pre style="border:1px solid #cccccc;color:#333333;font-size:13px;padding:9.5px;vertical-align:baseline;">CT_EMAIL_ALERT =1</pre>

<p>
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">Enable permanent IP addresses blocking ("1" to enabled, "0" for disabled):</span>
</p>

<pre style="border:1px solid #cccccc;color:#333333;font-size:13px;padding:9.5px;vertical-align:baseline;">CT_PERMANENT = 1</pre>

<p>
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">If you did not enable permanent IP addresses blocking, you could set interval (in seconds) within which IP will remained blocked:</span>
</p>

<pre style="border:1px solid #cccccc;color:#333333;font-size:13px;padding:9.5px;vertical-align:baseline;">CT_BLOCK_TIME = 1800</pre>

<p>
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">If you would like to enable it only for specific ports, you need to provide it in CT_PORTS. If you keep it empty, all ports would be checking:</span>
</p>

<pre style="border:1px solid #cccccc;color:#333333;font-size:13px;padding:9.5px;vertical-align:baseline;">CT_PORTS = "22,23,80,443"</pre>

<p>
	<a href="https://i.imgur.com/VykMPGW.png" rel="external nofollow" style="border:0px;color:#ed1c24;font-size:14px;padding:0px;vertical-align:baseline;"><img alt="VykMPGW.png" style="border:0px;font-size:14px;padding:0px;vertical-align:middle;" width="999" src="https://i.imgur.com/VykMPGW.png" loading="lazy" height="749.25"></a><span style="background-color:#ffffff;color:#333333;font-size:14px;">After it, you need to restart CSF service and lfd daemon. If you have performed changes via Web UI, just press the button "Restart csf+lfd'. Else execute the following command via SSH:</span>
</p>

<pre style="border:1px solid #cccccc;color:#333333;font-size:13px;padding:9.5px;vertical-align:baseline;">csf -r &amp;&amp; service lfd restart</pre>

<div style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	More information about ConfigServer Security &amp; Firewall could be found here:
</div>

<div style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	<a href="https://www.configserver.com/cp/csf.html" rel="external nofollow" style="border:0px;color:#ed1c24;font-size:14px;padding:0px;vertical-align:baseline;">https://www.configserver.com/cp/csf.html</a>
</div>
]]></description><guid isPermaLink="false">46</guid><pubDate>Fri, 21 Apr 2023 08:11:42 +0000</pubDate></item><item><title>How to install and setup in SpamAssassin.</title><link>https://www.lcwhost.org/topic/45-how-to-install-and-setup-in-spamassassin/</link><description><![CDATA[<p>
	<img class="ipsImage ipsImage_thumbnailed" data-fileid="18" width="750" alt="8cu9huj13j07.webp.c6bc9e207753d4f7267fb75be377e0b2.webp" src="https://www.lcwhost.org/uploads/monthly_2025_01/8cu9huj13j07.webp.c6bc9e207753d4f7267fb75be377e0b2.webp" loading="lazy" height="247.5"><br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<i style="background-color:#ffffff;color:#333333;font-size:14px;">SpamAssassin<span> </span></i><span style="background-color:#ffffff;color:#333333;font-size:14px;">is a computer program used for e-mail spam filtering.<span> </span></span><i style="background-color:#ffffff;color:#333333;font-size:14px;">SpamAssassin</i><span style="background-color:#ffffff;color:#333333;font-size:14px;"><span> </span>uses a variety of spam-detection techniques, including DNS-based and fuzzy-checksum-based spam detection, Bayesian filtering, external programs, blacklists, and online databases. It will save your mailbox from many unwanted spam emails.</span><br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">For this tutorial we are using Ubuntu 16.04 distribution, however, you should be able to use it for all Debian and Ubuntu distributions we offer on Time4VPS.</span><br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<b style="background-color:#ffffff;color:#333333;font-size:14px;">Update System</b><br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">First things first. Like always, first of all, we recommend updating your server. It can be done by simply executing:</span><br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">apt-get update</code><br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<b style="background-color:#ffffff;color:#333333;font-size:14px;">Installation</b><br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">After our server is up to date we can start the installation. Use apt-get to install<span> </span></span><i style="background-color:#ffffff;color:#333333;font-size:14px;">Spamassassin</i><span style="background-color:#ffffff;color:#333333;font-size:14px;"><span> </span>and<span> </span></span><i style="background-color:#ffffff;color:#333333;font-size:14px;">spamc</i><span style="background-color:#ffffff;color:#333333;font-size:14px;">:</span><br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">apt-get install spamassassin spamc -y</code><br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">While installing you can get a message about the kernel, we are using stable kernel version 2.6.32 for OpenVZ, so you do not need to worry about that, just click OK.</span><br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<b style="background-color:#ffffff;color:#333333;font-size:14px;">Adding User</b><br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">There are a few steps that has to be taken to make it fully functional. To run<span> </span></span><i style="background-color:#ffffff;color:#333333;font-size:14px;">SpamAssassin</i><span style="background-color:#ffffff;color:#333333;font-size:14px;"><span> </span>you need to create a new user on your VPS. First, add the group<span> </span></span><i style="background-color:#ffffff;color:#333333;font-size:14px;">spamd</i><span style="background-color:#ffffff;color:#333333;font-size:14px;">:</span><br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">groupadd spamd</code><br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">Then add the user spamd with the home directory<span> </span></span><i style="background-color:#ffffff;color:#333333;font-size:14px;">/var/log/spamassassin</i><span style="background-color:#ffffff;color:#333333;font-size:14px;">:</span><br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">useradd -g spamd -s /bin/false -d /var/log/spamassassin spamd</code><br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">Then create the directory<span> </span></span><i style="background-color:#ffffff;color:#333333;font-size:14px;">/var/log/spamassassin</i><span style="background-color:#ffffff;color:#333333;font-size:14px;">:</span><br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">mkdir /var/log/spamassassin</code><br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">And change the ownership of the directory to<span> </span></span><i style="background-color:#ffffff;color:#333333;font-size:14px;">spamd</i><span style="background-color:#ffffff;color:#333333;font-size:14px;">:</span><br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">chown spamd:spamd /var/log/spamassassin</code><br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<b style="background-color:#ffffff;color:#333333;font-size:14px;">Setting Up</b><br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">Open the<span> </span></span><i style="background-color:#ffffff;color:#333333;font-size:14px;">SpamAssassin</i><span style="background-color:#ffffff;color:#333333;font-size:14px;"><span> </span>config file:</span><br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">nano /etc/default/spamassassin</code><br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<b style="background-color:#ffffff;color:#333333;font-size:14px;">Note:</b><span style="background-color:#ffffff;color:#333333;font-size:14px;"><span> </span>If you do not have<span> </span></span><i style="background-color:#ffffff;color:#333333;font-size:14px;">nano</i><span style="background-color:#ffffff;color:#333333;font-size:14px;"><span> </span>installed on your server, you can do it simply with the command:</span><br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">apt-get install nano</code><br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">To enable<span> </span></span><i style="background-color:#ffffff;color:#333333;font-size:14px;">Spamassassin</i><span style="background-color:#ffffff;color:#333333;font-size:14px;"><span> </span>and automatic rule updates in order to get the latest spam filtering rules to find the<span> </span></span><i style="background-color:#ffffff;color:#333333;font-size:14px;">CRON</i><span style="background-color:#ffffff;color:#333333;font-size:14px;"><span> </span>and<span> </span></span><i style="background-color:#ffffff;color:#333333;font-size:14px;">ENABLED</i><span style="background-color:#ffffff;color:#333333;font-size:14px;"><span> </span>variables and change then to:</span>
</p>

<pre style="border:1px solid #cccccc;color:#333333;font-size:13px;padding:9.5px;vertical-align:baseline;"><code style="border:none;color:inherit;font-size:inherit;padding:0px;vertical-align:baseline;">ENABLED=1
CRON=1</code></pre>

<p>
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">Now create a variable named<span> </span></span><i style="background-color:#ffffff;color:#333333;font-size:14px;">SAHOME</i><span style="background-color:#ffffff;color:#333333;font-size:14px;"><span> </span>with the<span> </span></span><i style="background-color:#ffffff;color:#333333;font-size:14px;">Spamassassin</i><span style="background-color:#ffffff;color:#333333;font-size:14px;"><span> </span>home directory:</span><br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">SAHOME="/var/log/spamassassin/"</code><br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">Find and change the<span> </span></span><i style="background-color:#ffffff;color:#333333;font-size:14px;">OPTIONS</i><span style="background-color:#ffffff;color:#333333;font-size:14px;"><span> </span>variable to:</span>
</p>

<pre style="border:1px solid #cccccc;color:#333333;font-size:13px;padding:9.5px;vertical-align:baseline;"><code style="border:none;color:inherit;font-size:inherit;padding:0px;vertical-align:baseline;">OPTIONS="--create-prefs --max-children 2 --username spamd \
-H ${SAHOME} -s ${SAHOME}spamd.log"</code></pre>

<p>
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">After setting up is complete we can start the<span> </span></span><i style="background-color:#ffffff;color:#333333;font-size:14px;">Spamassassin</i><span style="background-color:#ffffff;color:#333333;font-size:14px;"><span> </span>daemon by using the following code:</span><br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">service spamassassin start</code><br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<b style="background-color:#ffffff;color:#333333;font-size:14px;">Configuring Postfix</b><br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">SpamAssassin is set up, however, emails are still not going through it. To enabling that, open<span> </span></span><i style="background-color:#ffffff;color:#333333;font-size:14px;">Postfix</i><span style="background-color:#ffffff;color:#333333;font-size:14px;"><span> </span>config file:</span><br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">nano /etc/postfix/master.cf</code><br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">Find the line:</span><br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">smtp inet n - - - - smtpd</code><br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">And add the following to the end of the line:</span><br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">-o content_filter=spamassassin</code><br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">Now,<span> </span></span><i style="background-color:#ffffff;color:#333333;font-size:14px;">Postfix</i><span style="background-color:#ffffff;color:#333333;font-size:14px;"><span> </span>will pipe the mail through<span> </span></span><i style="background-color:#ffffff;color:#333333;font-size:14px;">SpamAssassin</i><span style="background-color:#ffffff;color:#333333;font-size:14px;">.</span><br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">To setup after-queue content filter add the following line to the end of the file</span>
</p>

<pre style="border:1px solid #cccccc;color:#333333;font-size:13px;padding:9.5px;vertical-align:baseline;"><code style="border:none;color:inherit;font-size:inherit;padding:0px;vertical-align:baseline;">spamassassin unix -     n       n       -       -       pipe
        user=spamd argv=/usr/bin/spamc -f -e  
        /usr/sbin/sendmail -oi -f ${sender} ${recipient}</code></pre>

<p>
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">For the changes to take effect restart<span> </span></span><i style="background-color:#ffffff;color:#333333;font-size:14px;">postfix</i><span style="background-color:#ffffff;color:#333333;font-size:14px;">:</span><br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">service postfix restart</code><br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<b style="background-color:#ffffff;color:#333333;font-size:14px;">Configuration</b><br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">To get the maximum use of<span> </span></span><i style="background-color:#ffffff;color:#333333;font-size:14px;">SpamAssassin</i><span style="background-color:#ffffff;color:#333333;font-size:14px;"><span> </span>you have to create rules. Open the<span> </span></span><i style="background-color:#ffffff;color:#333333;font-size:14px;">SpamAssassin</i><span style="background-color:#ffffff;color:#333333;font-size:14px;"><span> </span>default rules file using:</span><br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">nano /etc/spamassassin/local.cf</code><br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">To activate a rules uncomment line by removing the # symbol in the beginning of the line. Some line we recommend to uncomment:</span><br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">rewrite_header Subject *****SPAM*****</code><span style="background-color:#ffffff;color:#333333;font-size:14px;"><span> </span>- To add a spam header to spam mail.</span><br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">required_score 5.0</code><span style="background-color:#ffffff;color:#333333;font-size:14px;"><span> </span>- Spamassassin gives a score to each mail after running different tests on it. This line marks the mail as spam if the score is more than the value specified in the rule.</span><br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">use_bayes 1</code><span style="background-color:#ffffff;color:#333333;font-size:14px;"><span> </span>- To use Bayes theorem to check mails.</span><br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">bayes_auto_learn 1</code><span style="background-color:#ffffff;color:#333333;font-size:14px;"><span> </span>- To enable Bayes auto-learning.</span><br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">After adding the above details, save the file and restart spam assassin.</span><br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">service spamassassin restart</code><br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<b style="background-color:#ffffff;color:#333333;font-size:14px;">Testing</b><br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">To see if SpamAssassin is working, you can check the SpamAssassin log file using:</span><br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">nano /var/log/spamassassin/spamd.log</code><br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">or send the email from an external server and check the mail headers.</span><br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<b style="background-color:#ffffff;color:#333333;font-size:14px;">Conclusion</b><br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<br style="background-color:#ffffff;color:#333333;font-size:14px;">
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">Using<span> </span></span><i style="background-color:#ffffff;color:#333333;font-size:14px;">SpamAssassin</i><span style="background-color:#ffffff;color:#333333;font-size:14px;">, it is very easy to protect your mailbox from spammers. The best thing about<span> </span></span><i style="background-color:#ffffff;color:#333333;font-size:14px;">SpamAssassin</i><span style="background-color:#ffffff;color:#333333;font-size:14px;"><span> </span>is that we can create rules by ourselves and manage it.</span>
</p>
]]></description><guid isPermaLink="false">45</guid><pubDate>Fri, 21 Apr 2023 08:09:00 +0000</pubDate></item><item><title>How to Make Minimal OS Image</title><link>https://www.lcwhost.org/topic/42-how-to-make-minimal-os-image/</link><description><![CDATA[<div style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;text-align:justify;vertical-align:baseline;">
	In order to make a standard OpenVZ OS image minimal you need to follow these instructions:<br />
	<br />
	1. Install the standard OS from the client area<br />
	2. Login to the VPS SSH and execute one of the following commands (depending on your OS):
</div>

<h3 style="background-color:#ffffff;border:none;color:#555a62;font-size:24px;padding:0px;vertical-align:baseline;">
	CentOS 6 64-Bit
</h3>

<div style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;text-align:justify;vertical-align:baseline;">
	yum remove acl apr apr-util apr-util-ldap aspell attr authconfig avahi-libs bind bind-libs bzip2 centos-indexhtml cronie cronie-noanacron crontabs cups-libs cvs cyrus-sasl dhclient dhcp-common elfutils fetchmail finger finger-server ftp gettext gnutls gpg-pubkey-c105b9de gpm-libs hesiod httpd httpd-tools iptables-ipv6 jwhois libcap-ng libgomp libgssglue libjpeg-turbo libpcap libpng libtalloc libtdb libtevent libtiff libtirpc lm_sensors-libs lsof lynx m4 mailcap mailx man man-pages mlocate ncompress net-snmp net-snmp-libs net-snmp-utils newt newt-python nscd ntsysv perl perl-Module-Pluggable perl-Pod-Escapes perl-Pod-Simple perl-libs perl-version portreserve procmail rpcbind rsync samba-client samba-common samba-winbind samba-winbind-clients screen sendmail sendmail-cf setuptool slang stunnel sudo talk talk-server tcpdump tcsh telnet time traceroute unzip usermode vim-common vim-enhanced which xinetd xz xz-lzma-compat -y; yum clean all<br />
	 
</div>

<h3 style="background-color:#ffffff;border:none;color:#555a62;font-size:24px;padding:0px;vertical-align:baseline;">
	CentOS 7 64-Bit
</h3>

<div style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;text-align:justify;vertical-align:baseline;">
	For CentOS 7 64-bit, login to the VPS SSH and execute the following command:<br />
	 
</div>

<div style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;text-align:justify;vertical-align:baseline;">
	yum remove tcpdump mailx stunnel vim-enhanced vim-filesystem elfutils ntsysv bzip2 lsof traceroute telnet ethtool man-pages libtevent httpd bind-libs-lite apr hunspell apr-util libldb slang libss make libselinux-utils procmail gpm-libs libpcap json-c dhcp-common pytalloc policycoreutils usermode centos-logos cups-libs samba-libs cronie-noanacron libsmbclient cyrus-sasl libpipeline libaio rsyslog sendmail-cf samba-client rpcbind nscd talk-server setuptool screen sudo tcsh fetchmail mailcap hunspell-en ftp attr unzip time talk ncompress bind-license bind-libs libtalloc httpd-tools libtdb bind hunspell-en-US hesiod newt hunspell-en-GB avahi-libs which m4 vim-common finger dhcp-libs newt-python logrotate openssl libwbclient libtirpc samba-common crontabs cronie sendmail libestr man-db xinetd dhclient iptables-services mlocate finger-server rsync authconfig e2fsprogs -y; yum clean all<br />
	 
</div>

<h3 style="background-color:#ffffff;border:none;color:#555a62;font-size:24px;padding:0px;vertical-align:baseline;">
	Debian 7 64-Bit
</h3>

<div style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;text-align:justify;vertical-align:baseline;">
	If you are using Debian 7 64-bit, login to your VPS SSH and type in the following command:<br />
	 
</div>

<div style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;text-align:justify;vertical-align:baseline;">
	DEBIAN_FRONTEND=noninteractive apt-get remove --purge -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" apache2 apache2-doc apache2-mpm-prefork apache2-utils apache2.2-bin apache2.2-common apt-utils bind9 bind9-host bind9utils binutils bsd-mailx bsdmainutils bzip2 ca-certificates console-common console-data cracklib-runtime cron db-util db5.1-util debconf-utils debian-keyring dialog expat fetchmail file finger fontconfig fontconfig-config fonts-freefont-ttf ftp gettext groff-base info install-info iputils-arping iputils-tracepath isc-dhcp-client isc-dhcp-common kbd ldap-utils less libapr1 libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap libapt-inst1.5:amd64 libavahi-client3:amd64 libavahi-common-data:amd64 libavahi-common3:amd64 libbind9-80 libcap2:amd64 libcrack2 libcroco3:amd64 libcups2:amd64 libdns88 libfile-copy-recursive-perl libfontconfig1:amd64 libfreetype6:amd64 libgeoip1 libgettextpo0:amd64 libgomp1:amd64 libgssglue1:amd64 libisc84 libisccc80 libisccfg82 liblockfile-bin liblockfile1:amd64 libltdl7:amd64 liblwres80 libmagic1:amd64 libodbc1:amd64 libpaper1:amd64 libpcap0.8:amd64 libperl5.14 libpipeline1:amd64 libpopt0:amd64 libsensors4:amd64 libsnmp-base libsnmp15 libsysfs2:amd64 libtalloc2:amd64 libtdb1:amd64 libtirpc1:amd64 libunistring0:amd64 libwbclient0:amd64 libxml2:amd64 locales-all logrotate lynx lynx-cur m4 make man-db manpages memtester mlocate mtools ncurses-term odbcinst odbcinst1debian2:amd64 openssl openssl-blacklist procmail psutils pwgen rmail rpcbind rsync sasl2-bin screen sendmail sendmail-base sendmail-bin sendmail-cf sendmail-doc sensible-mda sharutils snmp ssl-cert sudo syslinux syslinux-common tcpdump tcsh telnet tofrodos traceroute ttf-dejavu ttf-dejavu-core ttf-dejavu-extra ttf-freefont unixodbc unzip update-inetd uuid-runtime whois wide-dhcpv6-client xinetd; apt-get clean; apt-get remove --purge -y sendmail-base<br />
	 
</div>

<h3 style="background-color:#ffffff;border:none;color:#555a62;font-size:24px;padding:0px;vertical-align:baseline;">
	Debian 8 64-Bit
</h3>

<div style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;text-align:justify;vertical-align:baseline;">
	Debian 8 64-bit users need to login to their VPS SSH and type in this command:<br />
	 
	<div style="border:0px;font-size:14px;padding:0px;text-align:justify;vertical-align:baseline;">
		DEBIAN_FRONTEND=noninteractive apt-get remove --purge -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" apache2 apache2-bin apache2-data apache2-doc apache2-mpm-prefork apache2-utils apt-utils bind9 bind9-host bind9utils binutils bsd-mailx bsdmainutils bzip2 ca-certificates cifs-utils console-common console-data cracklib-runtime cron db-util db5.3-util debconf-utils dh-python dialog expat fetchmail file finger fontconfig fontconfig-config fonts-dejavu fonts-dejavu-core fonts-dejavu-extra fonts-freefont-ttf ftp gettext groff-base info iputils-arping iputils-tracepath isc-dhcp-client isc-dhcp-common kbd ldap-utils less libapr1:amd64 libaprutil1:amd64 libaprutil1-dbd-sqlite3:amd64 libaprutil1-ldap:amd64 libapt-inst1.5:amd64 libasn1-8-heimdal:amd64 libavahi-client3:amd64 libavahi-common-data:amd64 libavahi-common3:amd64 libbind9-90 libcap-ng0:amd64 libcrack2:amd64 libcroco3:amd64 libcups2:amd64 libdns-export100 libdns100 libfile-copy-recursive-perl libfontconfig1:amd64 libfreetype6:amd64 libgeoip1:amd64 libglib2.0-0:amd64 libgomp1:amd64 libgssapi3-heimdal:amd64 libhcrypto4-heimdal:amd64 libhdb9-heimdal:amd64 libheimbase1-heimdal:amd64 libheimntlm0-heimdal:amd64 libhx509-5-heimdal:amd64 libirs-export91 libisc-export95 libisc95 libisccc90 libisccfg-export90 libisccfg90 libkdc2-heimdal:amd64 libkrb5-26-heimdal:amd64 libldb1:amd64 liblockfile-bin liblockfile1:amd64 libltdl7:amd64 liblua5.1-0:amd64 liblwres90 libmagic1:amd64 libmpdec2:amd64 libntdb1:amd64 libodbc1:amd64 libpaper1:amd64 libpcap0.8:amd64 libpci3:amd64 libperl5.20 libpipeline1:amd64 libpng12-0:amd64 libpopt0:amd64 libpython2.7:amd64 libpython3-stdlib:amd64 libpython3.4-stdlib:amd64 libroken18-heimdal:amd64 libsensors4:amd64 libsnmp-base libsnmp30:amd64 libtalloc2:amd64 libtdb1:amd64 libtevent0:amd64 libunistring0:amd64 libwbclient0:amd64 libwind0-heimdal:amd64 libxml2:amd64 logrotate lynx lynx-cur m4 make man-db manpages memtester mlocate mtools ncurses-term odbcinst odbcinst1debian2:amd64 openssl openssl-blacklist patch postfix procmail psutils pwgen python-crypto python-dnspython python-ldb python-ntdb python-samba python-talloc python-tdb python3 python3-minimal python3.4 rpcbind rsync samba-common samba-common-bin samba-dsdb-modules samba-libs:amd64 sasl2-bin screen sharutils snmp ssl-cert sudo syslinux tcpdump tcsh tdb-tools telnet tofrodos traceroute ttf-dejavu ttf-dejavu-core ttf-dejavu-extra ttf-freefont unixodbc unzip update-inetd uuid-runtime whois wide-dhcpv6-client xinetd<br />
		 
	</div>
</div>

<h3 style="background-color:#ffffff;border:none;color:#555a62;font-size:24px;padding:0px;vertical-align:baseline;">
	Ubuntu 12.04 64-Bit
</h3>

<div style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;text-align:justify;vertical-align:baseline;">
	Those that use Ubuntu 12.04 64-bit, need to login to their VPS SSH and execute the following:<br />
	 
	<div style="border:0px;font-size:14px;padding:0px;text-align:justify;vertical-align:baseline;">
		DEBIAN_FRONTEND=noninteractive apt-get remove --purge -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" apache2 apache2-doc apache2-mpm-prefork apache2-utils apache2.2-bin apache2.2-common apt-utils bind9 bind9-host bind9utils binutils bsd-mailx bsdmainutils bzip2 ca-certificates console-common console-data console-tools console-tools-dev cracklib-runtime cron db-util db5.1-util debconf-utils defoma expat fetchmail file finger fontconfig fontconfig-config ftp gettext groff-base info install-info iputils-arping iputils-tracepath isc-dhcp-client isc-dhcp-common klogd ldap-utils less libapr1 libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap libapt-inst1.4 libavahi-client3 libavahi-common-data libavahi-common3 libbind9-80 libcap2 libclass-isa-perl libconsole libcrack2 libcroco3 libcups2 libdb4.8 libdns81 libfile-copy-recursive-perl libfontconfig1 libfreetype6 libgdbm3 libgeoip1 libgettextpo0 libgomp1 libgssglue1 libisc83 libisccc80 libisccfg82 liblockfile-bin liblockfile1 libltdl7 liblwres80 libmagic1 libnewt0.52 libodbc1 libpaper1 libpcap0.8 libperl5.14 libpipeline1 libpopt0 libsensors4 libsnmp-base libsnmp15 libswitch-perl libsysfs2 libtalloc2 libtdb1 libtirpc1 libunistring0 libwbclient0 libxml2 logrotate lynx lynx-cur m4 make man-db manpages memtester mlocate mtools ncurses-term odbcinst odbcinst1debian2 openssl openssl-blacklist perl perl-modules procmail psutils pwgen rmail rpcbind rsync sasl2-bin screen sendmail sendmail-base sendmail-bin sendmail-cf sendmail-doc sensible-mda sharutils snmp ssl-cert sudo sysklogd syslinux syslinux-common tcpdump tcsh telnet tofrodos traceroute ttf-dejavu ttf-dejavu-core ttf-dejavu-extra ttf-freefont unixodbc unzip update-inetd uuid-runtime whiptail whois wide-dhcpv6-client xinetd; apt-get clean<br />
		 
	</div>
</div>

<h3 style="background-color:#ffffff;border:none;color:#555a62;font-size:24px;padding:0px;vertical-align:baseline;">
	Ubuntu 14.04 64-Bit
</h3>

<div style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;text-align:justify;vertical-align:baseline;">
	On Ubuntu 14.04 64-bit, login to the VPS SSH and write in this command:<br />
	 
</div>

<div style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;text-align:justify;vertical-align:baseline;">
	DEBIAN_FRONTEND=noninteractive apt-get remove --purge -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" apache2 apache2-bin apache2-data apache2-doc apache2-mpm-prefork apache2-utils apt-utils bind9 bind9-host bind9utils binutils bsd-mailx bsdmainutils bzip2 ca-certificates console-common console-data console-setup cracklib-runtime cron db-util db5.3-util debconf-utils dialog expat fetchmail file finger fontconfig fontconfig-config fonts-dejavu fonts-dejavu-core fonts-dejavu-extra fonts-freefont-ttf ftp gettext groff-base info iputils-arping iputils-tracepath isc-dhcp-client isc-dhcp-common kbd keyboard-configuration ldap-utils less libapr1:amd64 libaprutil1:amd64 libaprutil1-dbd-sqlite3:amd64 libaprutil1-ldap:amd64 libapt-inst1.5:amd64 libavahi-client3:amd64 libavahi-common-data:amd64 libavahi-common3:amd64 libbind9-90 libbsd0:amd64 libcrack2:amd64 libcroco3:amd64 libcups2:amd64 libdns100 libfile-copy-recursive-perl libfontconfig1:amd64 libfreetype6:amd64 libgeoip1:amd64 libglib2.0-0:amd64 libgmp10:amd64 libgomp1:amd64 libgssglue1:amd64 libhdb9-heimdal:amd64 libisc95 libisccc90 libisccfg90 libkdc2-heimdal:amd64 libldb1:amd64 liblockfile-bin liblockfile1:amd64 libltdl7:amd64 liblwres90 libmagic1:amd64 libntdb1:amd64 libodbc1:amd64 libpaper1:amd64 libpcap0.8:amd64 libperl5.18 libpipeline1:amd64 libpopt0:amd64 libpython-stdlib:amd64 libsensors4:amd64 libsnmp-base libsnmp30:amd64 libtalloc2:amd64 libtdb1:amd64 libtevent0:amd64 libtirpc1:amd64 libunistring0:amd64 libwbclient0:amd64 libxml2:amd64 logrotate lynx lynx-cur m4 make man-db manpages memtester mlocate mtools ncurses-term odbcinst odbcinst1debian2:amd64 openssl openssl-blacklist postfix procmail psutils pwgen python python-crypto python-dnspython python-ldb python-minimal python-ntdb python-talloc python-tdb python2.7 python2.7-minimal rpcbind rsync sasl2-bin screen sharutils snmp ssl-cert sudo syslinux syslinux-common tcpdump tcsh tdb-tools telnet tofrodos traceroute ttf-dejavu ttf-dejavu-core ttf-dejavu-extra ttf-freefont unixodbc unzip update-inetd uuid-runtime whois wide-dhcpv6-client xinetd xkb-data; apt-get clean<br />
	 
</div>

<h3 style="background-color:#ffffff;border:none;color:#555a62;font-size:24px;padding:0px;vertical-align:baseline;">
	Ubuntu 15.04 64-Bit
</h3>

<div style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;text-align:justify;vertical-align:baseline;">
	If you use Ubuntu 15.04 64-bit, login to your VPS SSH and use:<br />
	 
	<div style="border:0px;font-size:14px;padding:0px;text-align:justify;vertical-align:baseline;">
		DEBIAN_FRONTEND=noninteractive apt-get remove --purge -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" apache2 apache2-bin apache2-data apache2-doc apache2-mpm-prefork apache2-utils apt-utils bind9 bind9-host bind9utils binutils bsd-mailx bsdmainutils bsdutils bzip2 ca-certificates cifs-utils console-common console-data console-setup console-setup-linux cracklib-runtime cron db-util db5.3-util debconf-utils dialog expat fetchmail file finger fontconfig fontconfig-config fonts-dejavu fonts-dejavu-core fonts-dejavu-extra fonts-freefont-ttf ftp gettext groff-base info iputils-arping iputils-tracepath isc-dhcp-client isc-dhcp-common kbd keyboard-configuration ldap-utils less libapr1:amd64 libaprutil1:amd64 libaprutil1-dbd-sqlite3:amd64 libaprutil1-ldap:amd64 libapt-inst1.5:amd64 libavahi-client3:amd64 libavahi-common-data:amd64 libavahi-common3:amd64 libbind9-90 libbsd0:amd64 libcrack2:amd64 libcroco3:amd64 libcups2:amd64 libdns-export100 libdns100 libfile-copy-recursive-perl libfontconfig1:amd64 libfreetype6:amd64 libgeoip1:amd64 libglib2.0-0:amd64 libgomp1:amd64 libhdb9-heimdal:amd64 libicu52:amd64 libirs-export91 libisc-export95 libisc95 libisccc90 libisccfg-export90 libisccfg90 libkdc2-heimdal:amd64 libldb1:amd64 liblockfile-bin liblockfile1:amd64 libltdl7:amd64 liblua5.1-0:amd64 liblwres90 libmagic1:amd64 libntdb1:amd64 libodbc1:amd64 libpaper1:amd64 libpcap0.8:amd64 libperl5.20 libpipeline1:amd64 libpopt0:amd64 libpython-stdlib:amd64 libsensors4:amd64 libsnmp-base libsnmp30:amd64 libtalloc2:amd64 libtdb1:amd64 libtevent0:amd64 libtirpc1:amd64 libunistring0:amd64 libwbclient0:amd64 libxml2:amd64 logrotate lynx lynx-cur m4 make man-db manpages memtester mlocate mtools ncurses-term odbcinst odbcinst1debian2:amd64 openssl openssl-blacklist patch postfix procmail psutils pwgen python python-crypto python-dnspython python-ldb python-minimal python-ntdb python-samba python-talloc python-tdb python2.7 python2.7-minimal rpcbind rsync samba-common samba-common-bin samba-dsdb-modules samba-libs:amd64 sasl2-bin screen sharutils snmp ssl-cert sudo syslinux tcpdump tcsh tdb-tools telnet tofrodos traceroute ttf-dejavu ttf-dejavu-core ttf-dejavu-extra ttf-freefont unixodbc unzip update-inetd uuid-runtime whois wide-dhcpv6-client xinetd xkb-data<br />
		 
	</div>
</div>

<h3 style="background-color:#ffffff;border:none;color:#555a62;font-size:24px;padding:0px;vertical-align:baseline;">
	Ubuntu 16.04 64-Bit
</h3>

<div style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;text-align:justify;vertical-align:baseline;">
	For Ubuntu 16.04 64-bit operating system, login to your VPS SSH and complete as follows:<br />
	 
	<div style="border:0px;font-size:14px;padding:0px;text-align:justify;vertical-align:baseline;">
		DEBIAN_FRONTEND=noninteractive apt-get remove --purge -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" apache2 apache2-bin apache2-data apache2-doc apache2-utils bind9 bind9-host bind9utils libbind9-140 bind9-host bind9utils binutils bsd-mailx bsdmainutils bzip2 ca-certificates console-data cracklib-runtime cron db-util db5.3-util debconf-utils dialog expat libexpat1 fetchmail file libfile-copy-recursive-perl liblockfile-bin liblockfile1 finger fontconfig fontconfig-config libfontconfig1 fontconfig-config fonts-dejavu fonts-dejavu-core fonts-dejavu-extra fonts-dejavu-core fonts-dejavu-extra fonts-freefont-ttf ftp gettext gettext-base liblocale-gettext-perl groff-base distro-info-data info install-info procinfo iputils-arping iputils-tracepath isc-dhcp-client isc-dhcp-common ldap-utils less libfile-copy-recursive-perl liblockfile-bin libsnmp-base logrotate lynx lynx-common m4 make makedev man-db manpages memtester mlocate mtools odbcinst odbcinst1debian2 libgnutls-openssl27 openssl openssl-blacklist openssl-blacklist postfix procmail psutils pwgen dh-python libpython-stdlib libpython2.7 libpython2.7-minimal libpython2.7-stdlib libpython3-stdlib libpython3.5 libpython3.5-minimal libpython3.5-stdlib python python-crypto python-dnspython python-ldb python-minimal python-samba python-talloc python-tdb python2.7 python2.7-minimal python3 python3-minimal python3.5 python3.5-minimal python-crypto python-dnspython python-ldb python-minimal python-talloc python-tdb libpython2.7 libpython2.7-minimal libpython2.7-stdlib python2.7 python2.7-minimal libpython2.7-minimal python2.7-minimal rpcbind rsync sasl2-bin screen sharutils libsnmp-base libsnmp30 snmp ssl-cert sudo syslinux tcpdump tcsh tdb-tools telnet tofrodos traceroute ttf-dejavu ttf-dejavu-core ttf-dejavu-extra ttf-dejavu-core ttf-dejavu-extra ttf-freefont unixodbc unzip update-inetd uuid-runtime whois wide-dhcpv6-client xinetd; apt-get clean<br />
		 
	</div>
</div>

<h3 style="background-color:#ffffff;border:none;color:#555a62;font-size:24px;padding:0px;vertical-align:baseline;">
	OpenSuse 13.1 64-Bit
</h3>

<div style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;text-align:justify;vertical-align:baseline;">
	If you own an openSuse 13.1 64-bit operating system, login to your VPS SSH and execute:<br />
	<br />
	for i in SuSEfirewall2* aaa_base* adjtimex* apache2* aspell* autoyast2* bind* binutils* branding* bundle* ca* cantarell* checkmedia* cifs* command* cryptsetup* cups* curl* dconf* dhcp* dmraid* fetchmail* finger* fontconfig* gd* ghostscript* gio* glib* glib2* groff* gsettings* hwinfo* initviocons* keyutils* kpartx* less* libICE6* libSM6* libX11* libXau6* libXext6* libXmuu1* libXpm4* libXt6* libaio1* libapr* libapr1* libarchive13* libaspell15* libavahi* libdcerpc* libdcerpc0* libdconf1* libelf0* libenca0* libevent* libfam0* libffi4* libfreetype6* libgdbm4* libgensec0* libgio* libglib* libgmodule* libgnutls28* libgobject* libguess1-1.1-2.1.2.x86_64* libhogweed2* libicu51_2* libjasper1* libjavascriptcoregtk* libjbig2* libjpeg8* libldapcpp1* libldb1* liblua5_2* libmowgli2* libmysqlclient18* libndr* libndr0* libnetapi0* libnetpbm11* libnettle4* libp11* libparted0* libpcap1* libpci3* libpdb0* libpipeline1* libpng16* libpython2_7* librcc0* librcd0* libregistry0* libreiserfs* libsamba* libsamdb0* libsensors4* libsmbclient* libsmbclient0* libsmbconf0* libsmbldap0* libsmi* libsmi2* libsnmp30* libsoup* libsqlite3* libstorage* libstorage4* libtalloc2* libtasn1* libtdb1* libtevent* libtevent0* libtiff5* libtirpc1* libtranslate0* libwbclient0* libx86emu1* libxcb1* libyaml* libyui* libyui5* lsscsi* lvm2* lynx* m4* mailx* make* man* mdadm* mlocate* module* mtools* multipath* ncftp* ncurses* netcfg* netpbm* nfs* nfsidmap* openSUSE* openslp* p11* parted* pciutils* pkg* procmail* psmisc* psutils* pytalloc* python* rcc* release* rpcbind* rsync* ruby* ruby20* rubygem* samba* scout* screen* sendmail* shared* sharutils* snmp* sudo* syslinux* tcpdump* tcsh* telnet* time* timezone* traceroute* unzip* vim* wallpaper* which* words* xauth* xdg* xinetd* xli* yast2*; do zypper --non-interactive remove -n $i; done; zypper cc --all
</div>

<p style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	 
</p>

<p style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	3. Restart VPS 
</p>

<div style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;text-align:justify;vertical-align:baseline;">
	<b>Note</b>: Some operating systems (openSuse 13.01 and CentOS 7) will require you to wait for upgrade process finish in order to execute OS minimalization command.
</div>

<p style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	 
</p>

<p style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;text-align:justify;vertical-align:baseline;">
	<i>Have any difficulties following these instructions? Got additional questions about making standard OpenVZ OS image minimal?<span> </span><a href="https://www.time4vps.com/contact/" rel="external nofollow" style="border:0px;color:#ed1c24;font-size:14px;padding:0px;vertical-align:baseline;">Let us know!</a><span> </span>Our customer support team is ready to help 24/7.</i>
</p>
]]></description><guid isPermaLink="false">42</guid><pubDate>Sat, 04 Feb 2023 12:35:57 +0000</pubDate></item><item><title>Working with a Compromised VPS</title><link>https://www.lcwhost.org/topic/22-working-with-a-compromised-vps/</link><description><![CDATA[<p>
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">An exploited or hacked VPS is one that is no longer fully under your control. Someone else is now partially controlling your VPS and using it for their own purposes. Here are some common reasons to exploit a VPS:</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">• To send out spam email;</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">• To launch attacks against other servers (thus, consuming your CPU, memory, and bandwidth resources);</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">• To install a phishing website on your VPS to gain access to sensitive information.</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<b style="background-color:#ffffff;color:#333333;font-size:14px;">Background</b><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">There are two primary ways a VPS may be compromised:</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">A. If the hacker has guessed a password of a user on the VPS. This may be an email, FTP, or SSH use;</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">B. If the hacker has gained access through a security hole in a web application (or its addons/plugins) such as WordPress, Joomla, Drupal, etc.</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">1. How do I know if my service has been exploited?</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">Many times, customers may not notice that they have been compromised until they are contacted by the Time4VPS Abuse Department. To prevent any delays in learning about a breach, you must periodically check your VPS log files.</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">2. What steps can I take to prevent my service from being hacked?</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">A. Use Strong Passwords:</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">Be sure to use strong passwords. This would include passwords for the Client Area, VPS, any of your control panels, etc. The stronger the password the better protected your service will be. GRC (Gibson Research Corporation) provides a<span> </span></span><a href="https://www.grc.com/passwords.htm" rel="external nofollow" style="border:0px;color:#ed1c24;font-size:14px;padding:0px;vertical-align:baseline;">free tool</a><span style="background-color:#ffffff;color:#333333;font-size:14px;"><span> </span>that will generate strong passwords for you that are a mixture of lowercase, uppercase, numerical, and symbols..</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">B. Use Secure Protocols:</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">When connecting to your services, it is best to use secure connections whenever possible. This would include SSL connections for email and using sFTP instead of the more common FTP protocol.</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">C. Maintain Regular Backups:</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">Be sure to backup your data on a regular basis. If a domain, or your entire service, becomes compromised, it may go unnoticed for a while. You would not want to restore a compromised backup. You always want to restore from the last known clean backup.</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">D. Harden Your PHP Settings:</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">Just making a few changes to your php.ini file can greatly increase the security of your service. Here are a few settings we recommend:</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">• Enable Safe Mode;</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">• Disable allow_url_fopen;</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">• Increase PHP security with PHPSecInfo.</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">E. Working with Third-Party Applications:</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">When you are working with third-party software such as Wordpress, Drupal, or Joomla, please consider these points. This is also very important with applications that rely on plug-ins for extended functionality:</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">• Be careful with what third-party tools you choose to use. Pick software that is known to have a reliable reputation for security. Consider using software packages that have frequent updates to patch security holes;</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">• Be sure to update your software regularly. Subscribe to the RSS feeds of any applications you use. This is a fantastic, effortless way to stay aware of any new updates that you may need to stay secure.</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<b style="background-color:#ffffff;color:#333333;font-size:14px;">I've been hacked. What can I do?</b><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">Backup your domains and service, but please remember that this backup will probably contain compromised scripts. You do not want to restore directly from this backup.</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">How can you backup and restore a MySQL database:</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">• Take your website offline temporarily, or until you know you have resolved the issue. Alternatively, consider displaying an "Under Construction" page. This should be done to prevent any hacked pages from being served to your customers;</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">• Start performing a damage assessment. What is the scope of the problem? Is only one domain affected? Are other domains on your service affected also?</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">• Start the recovery process. The best thing you can do is to reinstall your environment from a known clean source;</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">• Finally, take the steps to restore your websites.</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<b style="background-color:#ffffff;color:#333333;font-size:14px;">Useful Links</b><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">Join and contribute to online communities that are dedicated to helping fight badware/phishing. Here are a few examples:</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">•<span> </span></span><a href="https://www.stopbadware.org/" rel="external nofollow" style="border:0px;color:#ed1c24;font-size:14px;padding:0px;vertical-align:baseline;" title="Link: http://www.stopbadware.org">http://www.stopbadware.org</a><span style="background-color:#ffffff;color:#333333;font-size:14px;">;</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">•<span> </span></span><a href="https://www.antiphishing.org/" rel="external nofollow" style="border:0px;color:#ed1c24;font-size:14px;padding:0px;vertical-align:baseline;" title="Link: http://www.antiphishing.org">http://www.antiphishing.org</a><span style="background-color:#ffffff;color:#333333;font-size:14px;">;</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">•<span> </span></span><a href="http://www.phishtank.com/" rel="external nofollow" style="border:0px;color:#ed1c24;font-size:14px;padding:0px;vertical-align:baseline;" title="Link: http://www.phishtank.com">http://www.phishtank.com</a><span style="background-color:#ffffff;color:#333333;font-size:14px;">.</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">--</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">Artice source: mediatemple (MT)</span>
</p>
]]></description><guid isPermaLink="false">22</guid><pubDate>Sat, 04 Feb 2023 11:49:00 +0000</pubDate></item><item><title>Basic and most common iptables rules</title><link>https://www.lcwhost.org/topic/21-basic-and-most-common-iptables-rules/</link><description><![CDATA[<p>
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">Iptables is basically a powerful firewall, which can allow a user to set specific rules to control incoming and outgoing traffic. You can use it to block the specific port, IP addresses and much more. In this article, we present the most common uses of iptables.</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">The iptables rules can be specified with 3 blocks, which are used for a specific purpose (called<span> </span></span><b style="background-color:#ffffff;color:#333333;font-size:14px;">Chains</b><span style="background-color:#ffffff;color:#333333;font-size:14px;"><span class="ipsEmoji">😞</span></span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<b style="background-color:#ffffff;color:#333333;font-size:14px;">INPUT</b><span style="background-color:#ffffff;color:#333333;font-size:14px;"><span> </span>- All packets destined for the host computer.</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<b style="background-color:#ffffff;color:#333333;font-size:14px;">OUTPUT</b><span style="background-color:#ffffff;color:#333333;font-size:14px;"><span> </span>- All packets originating from the host computer.</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<b style="background-color:#ffffff;color:#333333;font-size:14px;">FORWARD</b><span style="background-color:#ffffff;color:#333333;font-size:14px;"><span> </span>- All packets neither destined for nor originating from the host computer, but passing through (routed by) the host computer. This chain is used if you are using your computer as a router.</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">The first command we present is used to flush the existing iptables rules, this can be useful if we want to start with new rules or if we have accidentally blocked ourselves (Our Clients Area has a button for this case specifically - "</span><b style="background-color:#ffffff;color:#333333;font-size:14px;">Flush iptables</b><span style="background-color:#ffffff;color:#333333;font-size:14px;">"):</span>
</p>

<pre style="border:1px solid #cccccc;color:#333333;font-size:13px;padding:9.5px;vertical-align:baseline;">iptables -F</pre>

<p>
	<b style="background-color:#ffffff;color:#333333;font-size:14px;">Note</b><span style="background-color:#ffffff;color:#333333;font-size:14px;">. If you want to flush a single Chain, specific rules. You can use this:</span>
</p>

<pre style="border:1px solid #cccccc;color:#333333;font-size:13px;padding:9.5px;vertical-align:baseline;">sudo iptables -F INPUT</pre>

<p>
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">Next commands are used to check current rules that are active within your server:</span>
</p>

<pre style="border:1px solid #cccccc;color:#333333;font-size:13px;padding:9.5px;vertical-align:baseline;">iptables -L</pre>

<pre style="border:1px solid #cccccc;color:#333333;font-size:13px;padding:9.5px;vertical-align:baseline;">iptables -S</pre>

<p>
	<b style="background-color:#ffffff;color:#333333;font-size:14px;">Note</b><span style="background-color:#ffffff;color:#333333;font-size:14px;">. You can add specific words, like INPUT, FORWARD OR OUTPUT. For example:</span>
</p>

<pre style="border:1px solid #cccccc;color:#333333;font-size:13px;padding:9.5px;vertical-align:baseline;">iptables -L INPUT</pre>

<p>
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">This will let you specify the rules by their purpose (Chains).</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<b style="background-color:#ffffff;color:#333333;font-size:14px;">Note.</b><span style="background-color:#ffffff;color:#333333;font-size:14px;"><span> </span>You can also add "-v" to your command (</span><i style="background-color:#ffffff;color:#333333;font-size:14px;">iptables -L -v</i><span style="background-color:#ffffff;color:#333333;font-size:14px;">), this will let you check the packets and their size matched with each rule.</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">Now we can continue with more specific rules to make some simple rules. Usually, a Firewall is used to block something first, and only then to allow something. So here are some rules which help you to block the connections.</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">In order to block a connection from the specific IP address you can use this:</span>
</p>

<pre style="border:1px solid #cccccc;color:#333333;font-size:13px;padding:9.5px;vertical-align:baseline;">iptables -A INPUT -s 1.1.1.1 -j DROP </pre>

<pre style="border:1px solid #cccccc;color:#333333;font-size:13px;padding:9.5px;vertical-align:baseline;">iptables -A OUTPUT -s 1.1.1.1 -j DROP</pre>

<pre style="border:1px solid #cccccc;color:#333333;font-size:13px;padding:9.5px;vertical-align:baseline;">iptables -A INPUT -s 1.1.1.1 -j REJECT</pre>

<p>
	<b style="background-color:#ffffff;color:#333333;font-size:14px;">Note.</b><span style="background-color:#ffffff;color:#333333;font-size:14px;"><span> </span>REJECT is used to give a response that the connection is not blocked and sends a message "connection refused".</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">If you want to block a specific port, for example, SMTP port 25, you can use this:</span>
</p>

<pre style="border:1px solid #cccccc;color:#333333;font-size:13px;padding:9.5px;vertical-align:baseline;">iptables -A INPUT -p tcp --dport 25 -j DROP
iptables -I OUTPUT -p tcp --dport 25 -j DROP</pre>

<p>
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">Allow Incoming SSH connection only from a specific IP:</span>
</p>

<pre style="border:1px solid #cccccc;color:#333333;font-size:13px;padding:9.5px;vertical-align:baseline;">iptables -A INPUT -i <code style="border:none;color:inherit;font-size:inherit;padding:0px;vertical-align:baseline;">venet0</code> -p tcp -s 1.1.1.1 --dport 22 -m state --state NEW,ESTABLISHED -j ACCEPT</pre>

<pre style="border:1px solid #cccccc;color:#333333;font-size:13px;padding:9.5px;vertical-align:baseline;">iptables -A OUTPUT -o <code style="border:none;color:inherit;font-size:inherit;padding:0px;vertical-align:baseline;">venet0</code> -p tcp --sport 22 -m state --state ESTABLISHED -j ACCEPT</pre>

<p>
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">This actually allows only specific IP to connect to the server using 22 port. Also, every time it happens, it establishes a status, which will be used in the second rule to allow the same IP the outgoing traffic.</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">Following sets of rules are for HTTP and HTTPS connections:</span>
</p>

<pre style="border:1px solid #cccccc;color:#333333;font-size:13px;padding:9.5px;vertical-align:baseline;">iptables -A INPUT -i <code style="border:none;color:inherit;font-size:inherit;padding:0px;vertical-align:baseline;">venet0</code> -p tcp --dport 80 -m state --state NEW,ESTABLISHED -j ACCEPT</pre>

<pre style="border:1px solid #cccccc;color:#333333;font-size:13px;padding:9.5px;vertical-align:baseline;">iptables -A OUTPUT -o <code style="border:none;color:inherit;font-size:inherit;padding:0px;vertical-align:baseline;">venet0</code> -p tcp --sport 80 -m state --state ESTABLISHED -j ACCEPT</pre>

<p>
	 
</p>

<pre style="border:1px solid #cccccc;color:#333333;font-size:13px;padding:9.5px;vertical-align:baseline;">iptables -A INPUT -i <code style="border:none;color:inherit;font-size:inherit;padding:0px;vertical-align:baseline;">venet0</code> -p tcp --dport 443 -m state --state NEW,ESTABLISHED -j ACCEPT</pre>

<pre style="border:1px solid #cccccc;color:#333333;font-size:13px;padding:9.5px;vertical-align:baseline;">iptables -A OUTPUT -o <code style="border:none;color:inherit;font-size:inherit;padding:0px;vertical-align:baseline;">venet0</code> -p tcp --sport 443 -m state --state ESTABLISHED -j ACCEPT</pre>

<p>
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">The first set of rules allows HTTP and the second set of rules allows HTTPS connection using the default ports 80 and 443</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">Next rules allow outside users to ping to your server:</span>
</p>

<pre style="border:1px solid #cccccc;color:#333333;font-size:13px;padding:9.5px;vertical-align:baseline;">iptables -A INPUT -p icmp --icmp-type echo-request -j ACCEPT</pre>

<pre style="border:1px solid #cccccc;color:#333333;font-size:13px;padding:9.5px;vertical-align:baseline;">iptables -A OUTPUT -p icmp --icmp-type echo-reply -j ACCEPT</pre>

<p>
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">The same applies to block it:</span>
</p>

<pre style="border:1px solid #cccccc;color:#333333;font-size:13px;padding:9.5px;vertical-align:baseline;">iptables -A INPUT -p icmp --icmp-type echo-request -j DROP</pre>

<pre style="border:1px solid #cccccc;color:#333333;font-size:13px;padding:9.5px;vertical-align:baseline;">iptables -A OUTPUT -p icmp --icmp-type echo-reply -j DROP
</pre>

<p>
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">To allow loopback access to your server, for example using localhost:</span>
</p>

<pre style="border:1px solid #cccccc;color:#333333;font-size:13px;padding:9.5px;vertical-align:baseline;">iptables -A INPUT -i lo -j ACCEPT
iptables -A OUTPUT -o lo -j ACCEPT</pre>

<p>
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">Allowing MySQL connection from specific IP address:</span>
</p>

<pre style="border:1px solid #cccccc;color:#333333;font-size:13px;padding:9.5px;vertical-align:baseline;">iptables -A INPUT -i <code style="border:none;color:inherit;font-size:inherit;padding:0px;vertical-align:baseline;">venet0</code> -p tcp -s 1.1.1.1 --dport 3306 -m state --state NEW,ESTABLISHED -j ACCEPT</pre>

<pre style="border:1px solid #cccccc;color:#333333;font-size:13px;padding:9.5px;vertical-align:baseline;">iptables -A OUTPUT -o <code style="border:none;color:inherit;font-size:inherit;padding:0px;vertical-align:baseline;">venet0</code> -p tcp --sport 3306 -m state --state ESTABLISHED -j ACCEPT</pre>

<p>
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">Allowing POP3 or IMAP traffic:</span>
</p>

<pre style="border:1px solid #cccccc;color:#333333;font-size:13px;padding:9.5px;vertical-align:baseline;">iptables -A INPUT -i <code style="border:none;color:inherit;font-size:inherit;padding:0px;vertical-align:baseline;">venet0</code> -p tcp --dport 143 -m state --state NEW,ESTABLISHED -j ACCEPT</pre>

<pre style="border:1px solid #cccccc;color:#333333;font-size:13px;padding:9.5px;vertical-align:baseline;">iptables -A OUTPUT -o <code style="border:none;color:inherit;font-size:inherit;padding:0px;vertical-align:baseline;">venet0</code> -p tcp --sport 143 -m state --state ESTABLISHED -j ACCEPT</pre>

<p>
	 
</p>

<pre style="border:1px solid #cccccc;color:#333333;font-size:13px;padding:9.5px;vertical-align:baseline;">iptables -A INPUT -i <code style="border:none;color:inherit;font-size:inherit;padding:0px;vertical-align:baseline;">venet0</code> -p tcp --dport 110 -m state --state NEW,ESTABLISHED -j ACCEPT</pre>

<pre style="border:1px solid #cccccc;color:#333333;font-size:13px;padding:9.5px;vertical-align:baseline;">iptables -A OUTPUT -o <code style="border:none;color:inherit;font-size:inherit;padding:0px;vertical-align:baseline;">venet0</code> -p tcp --sport 110 -m state --state ESTABLISHED -j ACCEPT</pre>

<p>
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">Also, this can be applied for POP3/IMAP using a secure connection:</span>
</p>

<pre style="border:1px solid #cccccc;color:#333333;font-size:13px;padding:9.5px;vertical-align:baseline;">iptables -A INPUT -i <code style="border:none;color:inherit;font-size:inherit;padding:0px;vertical-align:baseline;">venet0</code> -p tcp --dport 993 -m state --state NEW,ESTABLISHED -j ACCEPT</pre>

<pre style="border:1px solid #cccccc;color:#333333;font-size:13px;padding:9.5px;vertical-align:baseline;">iptables -A OUTPUT -o <code style="border:none;color:inherit;font-size:inherit;padding:0px;vertical-align:baseline;">venet0</code> -p tcp --sport 993 -m state --state ESTABLISHED -j ACCEPT</pre>

<p>
	 
</p>

<pre style="border:1px solid #cccccc;color:#333333;font-size:13px;padding:9.5px;vertical-align:baseline;">iptables -A INPUT -i <code style="border:none;color:inherit;font-size:inherit;padding:0px;vertical-align:baseline;">venet0</code> -p tcp --dport 995 -m state --state NEW,ESTABLISHED -j ACCEPT</pre>

<pre style="border:1px solid #cccccc;color:#333333;font-size:13px;padding:9.5px;vertical-align:baseline;">iptables -A OUTPUT -o <code style="border:none;color:inherit;font-size:inherit;padding:0px;vertical-align:baseline;">venet0</code> -p tcp --sport 995 -m state --state ESTABLISHED -j ACCEPT</pre>

<p>
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<b style="background-color:#ffffff;color:#333333;font-size:14px;">Note.</b><span style="background-color:#ffffff;color:#333333;font-size:14px;"><span> </span>When you describe network interface in the rules, for example,<span> </span></span><i style="background-color:#ffffff;color:#333333;font-size:14px;">venet0</i><span style="background-color:#ffffff;color:#333333;font-size:14px;">, do not forget to change it, if your server uses different network interfaces, for example,<span> </span></span><i style="background-color:#ffffff;color:#333333;font-size:14px;">eth0</i><span style="background-color:#ffffff;color:#333333;font-size:14px;"><span> </span>or other.</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">One last use of iptables  is that it can be used to prevent the DDoS as well, by limiting the connections per minute:</span>
</p>

<pre style="border:1px solid #cccccc;color:#333333;font-size:13px;padding:9.5px;vertical-align:baseline;">iptables -A INPUT -p tcp --dport 80 -m limit --limit 10/minute --limit-burst 100 -j ACCEPT</pre>

<p>
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">More details about this one:</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">-m limit: This uses the limit iptables extension</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">–limit 25/minute: This limits only a maximum of 10 connections per minute.</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">–limit-burst 100: This value indicates that the limit/minute will be enforced only after the total number of connection have reached the limit-burst level.</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">You can change the details based on your requirements, to prevent some attacks.</span>
</p>
]]></description><guid isPermaLink="false">21</guid><pubDate>Sat, 04 Feb 2023 11:45:51 +0000</pubDate></item><item><title>Quickly Allowing/Denying IP&#x2019;s Using Iptables</title><link>https://www.lcwhost.org/topic/20-quickly-allowingdenying-ip%E2%80%99s-using-iptables/</link><description><![CDATA[<p>
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">How do you block an IP using iptables?</span>
</p>

<pre style="border:1px solid #cccccc;color:#333333;font-size:13px;padding:9.5px;vertical-align:baseline;"><code style="border:none;color:inherit;font-size:inherit;padding:0px;vertical-align:baseline;"><code style="border:none;color:inherit;font-size:inherit;padding:0px;vertical-align:baseline;">iptables -A INPUT -s xx.xx.xx.xx -j DROP</code></code></pre>

<p>
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">How do you block an IP from a specific port?</span>
</p>

<pre style="border:1px solid #cccccc;color:#333333;font-size:13px;padding:9.5px;vertical-align:baseline;"><code style="border:none;color:inherit;font-size:inherit;padding:0px;vertical-align:baseline;"><code style="border:none;color:inherit;font-size:inherit;padding:0px;vertical-align:baseline;">iptables -A INPUT -p tcp -s xx.xx.xx.xx --dport PORT -j DROP</code></code></pre>

<div style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	(xx.xx.xx.xx is the remote IP address and PORT is the port number you wish to allow/deny access to.)
</div>

<p>
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">How do you allow access to an IP?</span>
</p>

<pre style="border:1px solid #cccccc;color:#333333;font-size:13px;padding:9.5px;vertical-align:baseline;"><code style="border:none;color:inherit;font-size:inherit;padding:0px;vertical-align:baseline;"><code style="border:none;color:inherit;font-size:inherit;padding:0px;vertical-align:baseline;">iptables -A INPUT -s xx.xx.xx.xx -j ACCEPT</code></code></pre>

<p>
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">How do you allow access to an IP to a specific port using iptables?</span>
</p>

<pre style="border:1px solid #cccccc;color:#333333;font-size:13px;padding:9.5px;vertical-align:baseline;"><code style="border:none;color:inherit;font-size:inherit;padding:0px;vertical-align:baseline;"><code style="border:none;color:inherit;font-size:inherit;padding:0px;vertical-align:baseline;">iptables -A INPUT -p tcp -s xx.xx.xx.xx --dport PORT -j ACCEPT</code></code></pre>

<p>
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">(Again, xx.xx.xx.xx is the remote IP address and PORT is the port number you wish to allow/deny access to.)</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">How do you block a scanner on a server for example "blablabla.at.ISC.SANS" using iptables?</span>
</p>

<pre style="border:1px solid #cccccc;color:#333333;font-size:13px;padding:9.5px;vertical-align:baseline;"><code style="border:none;color:inherit;font-size:inherit;padding:0px;vertical-align:baseline;">iptables -I INPUT -p tcp --dport 80 -m string --algo bm \
--string 'GET /blablabla.at.ISC.SANS.' -j DROP
</code></pre>

<p>
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">More information can be found in our article about the most common iptables rules:</span><br />
	<a href="https://www.lcwhost.org/topic/21-basic-and-most-common-iptables-rules/" rel="">https://www.lcwhost.org/topic/21-basic-and-most-common-iptables-rules/</a>
</p>

<p>
	 
</p>
]]></description><guid isPermaLink="false">20</guid><pubDate>Sat, 04 Feb 2023 11:44:54 +0000</pubDate></item><item><title>How to a Identify a DoS/DDoS Attack</title><link>https://www.lcwhost.org/topic/19-how-to-a-identify-a-dosddos-attack/</link><description><![CDATA[<p>
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">If your server appears pretty slow, there could be many things wrong such as poorly written scripts - but sometimes it could be because someone is flooding your server with traffic known as DoS (Denial of Service) or DDoS (Distributed Denial of Service). It could also be that your server itself is part of a botnet and is being used to attack other networks. In this case, it is always a good idea to run scans with software such as ClamAV and RootKit Hunter as a precaution.</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">Furthermore, whenever a client connects to a server via a network, a connection is established and opened on the system. On a busy high-load server, the number of connections connected to the server can be hundreds if not thousands. Find out and get a list of connections on the server.</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">Take a look at these handy netstat commands below that will surely help you determine whether your under attack or are part of an attack.</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">netstat -na</code><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">Displays all active Internet connections to the server and only established connections are included.</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">netstat -an | grep :80 | sort</code><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">Shows only active Internet connections to the server on port 80 and sorts the results. This is useful in detecting a single flood by allowing you to recognize many connections coming from one IP.</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">netstat -n -p|grep SYN_RECV | wc -l</code><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">This command is useful to determine how many active SYN_RECV are occurring on the server. The number should be pretty low, preferably less than 5. On DoS attack incidents or mail bombs, the number can jump pretty high. However, the value always depends on the system, so a high value may be average on another server.</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">netstat -n -p | grep SYN_RECV | sort -u</code><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">Lists all IP addresses involved.</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">netstat -n -p | grep SYN_RECV | awk '{print $5}' | awk -F: '{print $1}'</code><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">Lists all the unique IP addresses that are sending SYN_RECV connection statuses.</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">netstat -ntu | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -n</code><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">Uses the netstat command to calculate and count the number of connections each IP address makes to the server.</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">netstat -anp |grep 'tcp\|udp' | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -n</code><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">Lists the number of connections the IP's are making to the server using the TCP or UDP protocol.</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">netstat -ntu | grep ESTAB | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -nr</code><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">Checks on ESTABLISHED connections instead of all connections, and displays the number of connections for each IP.</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">netstat -plan|grep :80|awk {'print $5'}|cut -d: -f 1|sort|uniq -c|sort -nk 1</code><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">Shows a list of IP addresses and the number of connections that are connecting to port 80 on the server. Port 80 is used mainly by the HTTP protocol.</span>
</p>
]]></description><guid isPermaLink="false">19</guid><pubDate>Sat, 04 Feb 2023 11:42:22 +0000</pubDate></item><item><title>Optimize Apache server</title><link>https://www.lcwhost.org/topic/18-optimize-apache-server/</link><description><![CDATA[<p>
	<span style="background-color:#ffffff;color:#333333;font-size:14px;"><a href="https://www.lcwhost.com/" rel="external nofollow">LCwHost Ltd</a> support department receives a lot of questions about how to optimize the Apache service. This article introduces basic, simple and yet effective ways to optimize Apache service according to VPS resources. By default, Apache "prefork" module is used. When this module is in use, one process serves one query. Those processes must be defined in strict numerical values to avoid VPS resource allocation to Apache only.</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<b style="background-color:#ffffff;color:#333333;font-size:14px;">For traditional Apache optimization, there are four variables used by Apache:</b><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">• StartServers: number of child server processes created at startup;</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">• MinSpareServers: minimum number of idle child server processes;</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">• MaxSpareServers: maximum number of idle child server processes;</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">• MaxClients: maximum number of connections that will be processed simultaneously.</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<b style="background-color:#ffffff;color:#333333;font-size:14px;">We can calculate optimal values for those variables:</b><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">• StartServers: RAM/128;</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">• MinSpareServers: RAM/256;</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">• MaxSpareServers: RAM/64;</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">• MaxClients: RAM/32.</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">• RAM: your server total Random Access Memory value;</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<b style="background-color:#ffffff;color:#333333;font-size:14px;">Practical example in VPS plan with 4 GHz CPU | 4 GB RAM | 50 GB storage | 4 TB bandwidth:</b><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">• StartServers: 4096/128=32</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">• MinSpareServers: 4096/256=16</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">• MaxSpareServers: 4096/64=64</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">• MaxClients: 4096/32=128</span>
</p>

<div style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	 
</div>

<div style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	Variables must be set in the Apache server configuration file. To edit this file, execute the following command:
</div>

<p>
	<code style="border:1px solid #eeeecc;color:#c7254e;font-size:12.6px;padding:2px 4px;vertical-align:baseline;">nano /etc/httpd/conf/httpd.conf</code><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	 
</p>

<div style="background-color:#ffffff;border:0px;color:#333333;font-size:14px;padding:0px;vertical-align:baseline;">
	Find the variables described above and change them according to the formula. If you can not find the variables, at the end of the file, add the following lines with your optimized limits being set:
</div>

<pre style="border:1px solid #cccccc;color:#333333;font-size:13px;padding:9.5px;vertical-align:baseline;"><code style="border:none;color:inherit;font-size:inherit;padding:0px;vertical-align:baseline;">&lt;/IfModule&gt;
KeepAlive Off
&lt;IfModule prefork.c&gt;
   StartServers        32
   MinSpareServers     16
   MaxSpareServers     64
   MaxClients         128
&lt;/IfModule&gt;</code></pre>

<p>
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">After modification, do not forget to restart apache server:</span>
</p>

<pre style="border:1px solid #cccccc;color:#333333;font-size:13px;padding:9.5px;vertical-align:baseline;"><code style="border:none;color:inherit;font-size:inherit;padding:0px;vertical-align:baseline;"><code style="border:none;color:inherit;font-size:inherit;padding:0px;vertical-align:baseline;">service httpd restart</code></code></pre>
]]></description><guid isPermaLink="false">18</guid><pubDate>Sat, 04 Feb 2023 11:40:51 +0000</pubDate></item><item><title>Secure Mail Server Checklist</title><link>https://www.lcwhost.org/topic/17-secure-mail-server-checklist/</link><description><![CDATA[<p>
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">Setup of email server in Linux is simple, but your job does not end there. Customer had experiences where mail gateway has been misconfigured and has caused open relay for a spammer attack. Always pay extra careful attention when you deal with related internet services such as web and email.</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">1. MX record</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">The Mail Exchanger (MX) is critical to email related information in your DNS. The MX record tells the internet email servers how to handle the your email routing. If you host your own DNS server, please remember to add a MX record. You can perform a simple MX record test. Please change your internal dns server to an external dns server.</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">2. IP address</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">Use the mail security tool below to check your IP status:</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<a href="https://www.mxtoolbox.com/SuperTool.aspx" rel="external nofollow" style="border:0px;color:#ed1c24;font-size:14px;padding:0px;vertical-align:baseline;">http://www.mxtoolbox.com/SuperTool.aspx</a><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">3. Secure Mail Test tool</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<a href="https://www.checktls.com/index.html" rel="external nofollow" style="border:0px;color:#ed1c24;font-size:14px;padding:0px;vertical-align:baseline;">http://www.checktls.com/index.html</a><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">4. Reverse DNS</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">Usually anti-spam applications check if you have a valid reverse DNS IP. If you are sending mail from a non reverse DNS IP mail server, your 'mail reputation' will be lower than those who have a valid reserve IP. You might not see the impact instantly, however, since it might have a consequence in the long run such as sending valid bulk emails that might get your IP blacklisted or dropped.</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">5. SPF DNS Record</span><br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<br style="background-color:#ffffff;color:#333333;font-size:14px;" />
	<span style="background-color:#ffffff;color:#333333;font-size:14px;">Most anti-spam application / gateway applies a Sender Policy Framework (SPF) checking. This is an additonal layer of spam filtering, where it checks if the mail is genuinely from a domain. It is advised to include SPF record in your DNS.</span>
</p>
]]></description><guid isPermaLink="false">17</guid><pubDate>Sat, 04 Feb 2023 11:38:57 +0000</pubDate></item></channel></rss>
