<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Control WebPanel Wiki &#187; High Secure Linux Instructions</title>
	<atom:link href="https://wiki.centos-webpanel.com/tag/high-secure-linux-instructions/feed" rel="self" type="application/rss+xml" />
	<link>https://wiki.centos-webpanel.com</link>
	<description>CentOS WebPanel Wiki</description>
	<lastBuildDate>Wed, 12 Feb 2025 20:38:16 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=4.1.1</generator>
	<item>
		<title>CWP Security Instructions</title>
		<link>https://wiki.centos-webpanel.com/cwp-security-instructions</link>
		<comments>https://wiki.centos-webpanel.com/cwp-security-instructions#comments</comments>
		<pubDate>Wed, 17 May 2017 23:06:55 +0000</pubDate>
		<dc:creator><![CDATA[publisher]]></dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[High Secure Linux Instructions]]></category>

		<guid isPermaLink="false">http://wiki.centos-webpanel.com/?p=750</guid>
		<description><![CDATA[Website Protection ======================== Please note that by allowing users to have week site security your server overall security can be compromised. Most of the hackers will be denied by ModSecurity and FileSystemLock. Set for all .php files permissions to 640. You can also use in cwp admin left menu User Accounts -> Fix Permissions - [&#8230;]]]></description>
				<content:encoded><![CDATA[<p><a href="http://wiki.centos-webpanel.com/cwp-secure-centos-kernel"><img class="alignnone size-large wp-image-1474" src="/wp-content/uploads/2020/10/ban1_665px.png" alt="CWP Secure CentOS Kernel" width="665" /></a></p>
<p><object width="700" height="425"><param name="movie" value="https://www.youtube.com/v/A5PFoi7Wu28?version=3&amp;showinfo=0&amp;theme=light&amp;fs=1&amp;rel=0&amp;iv_load_policy=3&amp;modestbranding=1"></param><param name="allowScriptAccess" value="always"></param><param name="allowFullScreen" value="true"></param><embed src="https://www.youtube.com/v/A5PFoi7Wu28?version=3&amp;showinfo=0&amp;theme=light&amp;fs=1&amp;rel=0&amp;iv_load_policy=3&amp;modestbranding=1" type="application/x-shockwave-flash" allowScriptAccess="always" allowfullscreen="true" width="700" height="425"></embed></object></p>
<p><object width="700" height="425"><param name="movie" value="https://www.youtube.com/v/VhX7nv44etM?version=3&amp;showinfo=0&amp;theme=light&amp;fs=1&amp;rel=0&amp;iv_load_policy=3&amp;modestbranding=1"></param><param name="allowScriptAccess" value="always"></param><param name="allowFullScreen" value="true"></param><embed src="https://www.youtube.com/v/VhX7nv44etM?version=3&amp;showinfo=0&amp;theme=light&amp;fs=1&amp;rel=0&amp;iv_load_policy=3&amp;modestbranding=1" type="application/x-shockwave-flash" allowScriptAccess="always" allowfullscreen="true" width="700" height="425"></embed></object></p>
<p><strong>Website Protection</strong><br />
========================<br />
Please note that by allowing users to have week site security your server overall security can be compromised.<br />
Most of the hackers will be denied by ModSecurity and FileSystemLock.</p>
<p>Set for all .php files permissions to 640.<br />
You can also use in cwp admin left menu User Accounts -> Fix Permissions</p>
<p><strong>- Disable dangerus PHP functions</strong><br />
<a href="http://wiki.centos-webpanel.com/how-to-disable-dangerous-php-functions" title="Disable dangerous php functions" target="_blank">http://wiki.centos-webpanel.com/how-to-disable-dangerous-php-functions</a><br />
<em>* If you are hosting multiple sites for your clients then some sites might need some of this disabled functions.</em></p>
<p><strong>- PHP Open_Basedir protection</strong><br />
<a href="http://wiki.centos-webpanel.com/php-open_basedir" title="PHP Open BaseDir Protection" target="_blank">http://wiki.centos-webpanel.com/php-open_basedir</a><br />
<em>* We recommend to use option per user.</em></p>
<p>- <strong>ModSecurity for CWP</strong>: It will block many malware infections.<br />
<a href="http://wiki.centos-webpanel.com/mod_security-for-cwp" title="Mod Security for Apache" target="_blank">http://wiki.centos-webpanel.com/mod_security-for-cwp</a></p>
<p>- <strong>File System Lock</strong>: It will deny any kind of change on the files system and also disable any file uploads, and that means no more malware infections and website hacks.</p>
<p>- <strong>Hide system processes</strong>: This will hide all system process from the users. <a href="/hide-system-processes-from-users" title="Linux how to hide system process from users" target="_blank">http://wiki.centos-webpanel.com/hide-system-processes-from-users</a></p>
<p>- <strong>CloudLinux</strong>: It provides very high security and resource limiting per user, recommended for servers having many different clients.<br />
<a href="http://wiki.centos-webpanel.com/how-to-install-cloudlinux-on-the-cwp-servers" title="How to install CloudLinux" target="_blank">http://wiki.centos-webpanel.com/how-to-install-cloudlinux-on-the-cwp-servers</a></p>
<p>- <strong>CWP SECURE Linux</strong>: this is a custom kernel which works similar to <a href="https://en.wikipedia.org/wiki/Security-Enhanced_Linux" title="SeLinux" target="_blank">SeLinux</a> and provides very high security at the kernel level.<br />
<a href="/cwp-secure-centos-kernel" title="CWP Secure CentOS Kernel" target="_blank">http://wiki.centos-webpanel.com/cwp-secure-centos-kernel</a></p>
<p><strong>Cgroups</strong><br />
- cgroups can be used only with CentOS default kernel or CWP Secure Kernel.<br />
- cgroups allow you to limit each user with cpu, memory, and disk IO limits.<br />
Cgroups detailed info: <a href="http://wiki.centos-webpanel.com/cgroups-limits-per-user" title="Linux Cgroups - resource limits per user" target="_blank">http://wiki.centos-webpanel.com/cgroups-limits-per-user</a></p>
<p>Compared to Cloudlinux in some cases, it's better and has many more rules you can custom modify by yourself and in some cases, Cloudlinux is better.<br />
*Can't work with Cloudlinux since both use a custom kernel<br />
*Can't work with OpenVZ/Virtuozzo servers, same reason custom kernel.<br />
*It can work only with servers having the ability to install centos default kernel.<br />
*It can set many different limits for any file, service, process, network, or socket on the server.<br />
CWP SECURE Linux currently can be installed only by CWP Managed support as they will set up custom rules for your server so you could have the best server security, you need to have a support service for that.</p>
<p>Recommended for all servers which need to have the highest security.</p>
<p><strong>CWP Security</strong><br />
========================<br />
- CWP IP Access control: <a href="http://wiki.centos-webpanel.com/ip-access-control" title="IP access control" target="_blank">http://wiki.centos-webpanel.com/ip-access-control</a></p>
<p><strong>Server Security</strong><br />
========================<br />
- <strong>Change ssh port</strong>: in file /etc/ssh/sshd_config and restart sshd<br />
** Don't forget to change the port in CSF firewall!!!</p>
<p><a href="http://wiki.centos-webpanel.com/how-to-change-ssh-port" title="How to change ssh port" target="_blank">http://wiki.centos-webpanel.com/how-to-change-ssh-port</a></p>
<p>- <strong>CSF/LFD Firewall</strong> configuration: <a href="http://wiki.centos-webpanel.com/csflfd-firewall-configuration" title="CSF/LFD Firewall Configuration" target="_blank">http://wiki.centos-webpanel.com/csflfd-firewall-configuration</a></p>
<p>- <strong>tmpfs Security</strong>: <a href="https://en.wikipedia.org/wiki/Tmpfs" title="What is tmpfs?" target="_blank">What is tmpfs?</a><br />
Edit your /etc/fstab file and add <strong>,nodev,nosuid,noexec</strong> after <strong>defaults</strong> ,old:</p>
<pre>tmpfs /dev/shm tmpfs defaults 0 0</pre>
<p>new:</p>
<pre>tmpfs /dev/shm tmpfs defaults,nodev,nosuid,noexec 0 0</pre>
<p>- <strong>Kernel panic reboot</strong>: Reboot server if <a href="https://en.wikipedia.org/wiki/Kernel_panic" title="What is Kernel panic ?" target="_blank">kernel panic</a><br />
Add the following into /etc/sysctl.conf</p>
<pre>vm.panic_on_oom=1
kernel.panic=10</pre>
<p>After that load new kernel settings</p>
<pre>sysctl -p</pre>
<p><strong>Limiting Users</strong><br />
========================<br />
- <strong>Shell Access</strong>: Default is disabled, don't allow users to use shell access since that is NOT secure if not using one of the following: Jailkit, Cloudlinux, CWP Secure Kernel<br />
<a href="http://wiki.centos-webpanel.com/ftp-ftps-ftpes-sftp-explained" title="Shell Manager" target="_blank">http://wiki.centos-webpanel.com/ftp-ftps-ftpes-sftp-explained</a></p>
<p>- <strong>Processes Limit per user</strong>: Limit number of processes user can have, this will limit IMAP process number, cron's... it will also limit PHP process number if using suphp, note that apache/PHP process number and other process are not sharing the same limit, this means if the limit is set to 25, user can have 25 IMAP/shell processes and 25 PHP processes.</p>
<p>- <strong>Open Files</strong>: 	(Limit number of open files)<br />
This limits the number of open files the user can have, it's recommended to have it at 100 or higher as users/applications in many cases can have many files open at the same time.</p>
<p>- <strong>Apache mod_limits</strong>: This apache module is aimed at protecting the webserver during attacks.</p>
<p>It provides a few, very useful, functionalities:<br />
* Limit the maximum number of simultaneous connections<br />
* Limit the maximum number of simultaneous connections per Vhost<br />
* Limit the maximum number of spawned processes with the same UID<br />
* Do not serve request if the load is over a certain value</p>
<p><a href="http://wiki.centos-webpanel.com/how-to-install-mod_limits" title="Apache mod_limits" target="_blank">http://wiki.centos-webpanel.com/how-to-install-mod_limits</a></p>
<p>- <strong>MySQL/MariaDB Limit per user</strong> - Prevent MySQL abuse from the clients by setting the limit of maximum simultaneous connections permitted for a user account.</p>
<p>In this example, we will have it set to a fair limit of 45 connection. Some global shared hosting providers have it in the range of 20-30.</p>
<p>Find line starting with <strong>[mysqld]</strong> in file <strong>/etc/my.cnf</strong> or <strong>/etc/my.cnf.d/server.cnf</strong> and add the following line under:</p>
<pre>max_user_connections=45</pre>
<p>Don't forget to restart MySQL after adding that line:<br />
service mysql restart</p>
<div class="st-alert st-alert- "> Please note that you probably don't need all of these security and limit features as this can decrease the server performances.</p>
<p>The best would be that you select only what you need or try to consult with our support for assistance as each server needs a different configuration depending on the purpose and usage of it.
</p></div>
<p>Don't forget about the backups as that is one of the most important ways to keep your server data secure.</p>
<p>...more info coming soon.</p>
]]></content:encoded>
			<wfw:commentRss>https://wiki.centos-webpanel.com/cwp-security-instructions/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
