<?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>Linux Servers cPanel webhosting blog &#187; Server Security</title>
	<atom:link href="http://www.theperfectarts.com/category/server-security/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.theperfectarts.com</link>
	<description>Basics cPanel tutorials / issue,mysql,php errors etc</description>
	<lastBuildDate>Sat, 04 Feb 2012 17:18:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>How to block referrer from single domain and multiple domains</title>
		<link>http://www.theperfectarts.com/2012/01/how-to-block-referrer-from-single-domain-and-multiple-domains/</link>
		<comments>http://www.theperfectarts.com/2012/01/how-to-block-referrer-from-single-domain-and-multiple-domains/#comments</comments>
		<pubDate>Sun, 08 Jan 2012 00:59:46 +0000</pubDate>
		<dc:creator>Gunjan</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Linux Administrator Interview Questions]]></category>
		<category><![CDATA[Server Security]]></category>
		<category><![CDATA[block referrer]]></category>
		<category><![CDATA[block referrer from .htaccess file]]></category>
		<category><![CDATA[block referrer from multiple domain]]></category>
		<category><![CDATA[block referrer from single domain]]></category>
		<category><![CDATA[how to block referrer]]></category>
		<category><![CDATA[steps to block referrer]]></category>

		<guid isPermaLink="false">http://www.theperfectarts.com/?p=1849</guid>
		<description><![CDATA[Use the following rewrite rule to block the referrer from single domain/web site. RewriteEngine on # Options +FollowSymlinks RewriteCond %{HTTP_REFERER} test\.com [NC] RewriteRule .* &#8211; [F] Similarly you can block the referrer from the multiple sites by using the following rewrite rule in the .htaccess file. RewriteEngine on # Options +FollowSymlinks RewriteCond %{HTTP_REFERER} test\.com [NC,OR] RewriteCond [...]]]></description>
			<content:encoded><![CDATA[<p>Use the following rewrite rule to block the referrer from single domain/web site.<br />
<script type="text/javascript">// <![CDATA[
   google_ad_client = "ca-pub-1685490665026631"; /* images */ google_ad_slot = "1433358698"; google_ad_width = 300; google_ad_height = 250;
// ]]&gt;</script><br />
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">// <![CDATA[</p>
<p>// ]]&gt;</script><br />
<script type="text/javascript">// <![CDATA[
        var _gaq = _gaq || [];   _gaq.push(['_setAccount', 'UA-27772211-1']);   _gaq.push(['_trackPageview']);   (function() {     var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;     ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';     var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);   })();
// ]]&gt;</script></p>
<blockquote><p><strong>RewriteEngine on</strong><br />
<strong># Options +FollowSymlinks</strong><br />
<strong>RewriteCond %{HTTP_REFERER} test\.com [NC]</strong><br />
<strong>RewriteRule .* &#8211; [F]</strong></p></blockquote>
<p>Similarly you can block the referrer from the multiple sites by using the following rewrite rule in the .htaccess file.<br />
<script type="text/javascript">// <![CDATA[
   google_ad_client = "ca-pub-1685490665026631"; /* images */ google_ad_slot = "1433358698"; google_ad_width = 300; google_ad_height = 250;
// ]]&gt;</script><br />
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">// <![CDATA[</p>
<p>// ]]&gt;</script><br />
<script type="text/javascript">// <![CDATA[
        var _gaq = _gaq || [];   _gaq.push(['_setAccount', 'UA-27772211-1']);   _gaq.push(['_trackPageview']);   (function() {     var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;     ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';     var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);   })();
// ]]&gt;</script></p>
<blockquote><p><strong>RewriteEngine on</strong><br />
<strong># Options +FollowSymlinks</strong><br />
<strong>RewriteCond %{HTTP_REFERER} test\.com [NC,OR]</strong><br />
<strong>RewriteCond %{HTTP_REFERER} test123\.com</strong><br />
<strong>RewriteRule .* &#8211; [F]</strong></p></blockquote>
<p>&copy;2012 <a href="http://www.theperfectarts.com">Linux Servers cPanel webhosting blog</a>. All Rights Reserved.</p>.]]></content:encoded>
			<wfw:commentRss>http://www.theperfectarts.com/2012/01/how-to-block-referrer-from-single-domain-and-multiple-domains/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Set alternative SMTP port in Plesk Linux server</title>
		<link>http://www.theperfectarts.com/2011/12/set-alternative-smtp-port-in-plesk-linux-server/</link>
		<comments>http://www.theperfectarts.com/2011/12/set-alternative-smtp-port-in-plesk-linux-server/#comments</comments>
		<pubDate>Sat, 10 Dec 2011 10:19:00 +0000</pubDate>
		<dc:creator>Gunjan</dc:creator>
				<category><![CDATA[Linux Administrator Interview Questions]]></category>
		<category><![CDATA[Plesk]]></category>
		<category><![CDATA[Server Security]]></category>
		<category><![CDATA[Alternative port for SMTP]]></category>
		<category><![CDATA[block smtp port in plesk server]]></category>
		<category><![CDATA[change smtp port for qmail]]></category>
		<category><![CDATA[change smtp port on plesk Linux server]]></category>
		<category><![CDATA[configure new smtp port on plesk linux server]]></category>
		<category><![CDATA[default smtp port not working on plesk server]]></category>
		<category><![CDATA[how to set smtp port in plesk linux server]]></category>
		<category><![CDATA[isp blocked smtp 25 port]]></category>
		<category><![CDATA[linux plesk server smtp port]]></category>
		<category><![CDATA[new qmail smtp port]]></category>
		<category><![CDATA[new smtp port configuration with plesk server]]></category>
		<category><![CDATA[open new smtp for ISP end issue with port 25]]></category>
		<category><![CDATA[open new smtp port]]></category>
		<category><![CDATA[plesk linux server with qmail on new smtp port]]></category>
		<category><![CDATA[plesk queue mail on another port]]></category>
		<category><![CDATA[plesk server linux smtp issue]]></category>
		<category><![CDATA[plesk server smtp posrt issue]]></category>
		<category><![CDATA[plesk smtp issue]]></category>
		<category><![CDATA[qmail issue with default port]]></category>
		<category><![CDATA[qmail on new smtp port]]></category>
		<category><![CDATA[set new smtp port for plesk server]]></category>
		<category><![CDATA[set new smtp port on plesk linux server]]></category>
		<category><![CDATA[set smtp port /etcservices file]]></category>
		<category><![CDATA[set smtp qmail port]]></category>
		<category><![CDATA[set smtp service port other then 25]]></category>
		<category><![CDATA[smtp on another port]]></category>
		<category><![CDATA[smtp on new port]]></category>
		<category><![CDATA[smtp port block]]></category>
		<category><![CDATA[smtp port on plesk linux server]]></category>

		<guid isPermaLink="false">http://www.theperfectarts.com/?p=1736</guid>
		<description><![CDATA[Some time local ISP blocked default SMTP port 25 in the local network therefore we have to configure the alternative smtp port for SMTP service, so that SMTP will work on default port 25 as well as other new port. For example we are configuring the SMTP service on port 2626. Refer to the following [...]]]></description>
			<content:encoded><![CDATA[<p>Some time local ISP blocked default SMTP port 25 in the local network therefore we have to configure the alternative smtp port for SMTP service, so that SMTP will work on default port 25 as well as other new port. For example we are configuring the SMTP service on port 2626. Refer to the following steps to configure SMTP service on another port.</p>
<p>Change directory to the /etc/xinetd.d</p>
<p><strong>root@server [~]#cd /etc/xinetd.d</strong></p>
<p>Now copy the current working smtp_psa file to the new file smtp_psa_new</p>
<p><strong>root@server [/etc/xinetd.d]#cp -p smtp_psa smtp_psa_new</strong></p>
<p>open the file smtp_psa_new and change the value in the first line</p>
<p><strong>From</strong><script type="text/javascript"><!--
google_ad_client = "ca-pub-1685490665026631";
/* Big images */
google_ad_slot = "0185136902";
google_ad_width = 336;
google_ad_height = 280;
//-->
</script><br />
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script><br />
<script type="text/javascript">// <![CDATA[
     var _gaq = _gaq || [];   _gaq.push(['_setAccount', 'UA-27772211-1']);   _gaq.push(['_trackPageview']);   (function() {     var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;     ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';     var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);   })();
// ]]&gt;</script><strong>service smtp</strong><br />
<strong>to</strong><br />
<strong>service smtp_psa_new</strong></p>
<p>Save the file  and add the new smpt port in the /etc/services file</p>
<p>For example we want to set new smtp port 2626, you can change the port as per your requirement</p>
<p><strong>smtp_psa_new 2626/tcp mail</strong><br />
<strong>smtp_psa_new 2626/udp mail</strong></p>
<p>Save the file and restart the xinetd service</p>
<p><strong>root@server [/etc/xinetd.d]#/etc/init.d/xinetd restart</strong></p>
<p>Make sure that you have opened new port in the server firewall and then try to telenet the new SMTP port</p>
<p><strong>root@server [/etc/xinetd.d]#telnet localhost 2626</strong></p>
<p>It will show you the SMTP service banner</p>
<p>&copy;2012 <a href="http://www.theperfectarts.com">Linux Servers cPanel webhosting blog</a>. All Rights Reserved.</p>.]]></content:encoded>
			<wfw:commentRss>http://www.theperfectarts.com/2011/12/set-alternative-smtp-port-in-plesk-linux-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Critical: exim security update</title>
		<link>http://www.theperfectarts.com/2010/12/critical-exim-security-update/</link>
		<comments>http://www.theperfectarts.com/2010/12/critical-exim-security-update/#comments</comments>
		<pubDate>Sat, 11 Dec 2010 23:46:34 +0000</pubDate>
		<dc:creator>Gunjan</dc:creator>
				<category><![CDATA[E-mails issue]]></category>
		<category><![CDATA[Server Security]]></category>
		<category><![CDATA[/usr/mscpanel/msswitch.pl inout]]></category>
		<category><![CDATA[Critical: exim security update]]></category>
		<category><![CDATA[exim -d option]]></category>
		<category><![CDATA[exim isue]]></category>
		<category><![CDATA[exim not startimng]]></category>
		<category><![CDATA[exim starting problem]]></category>
		<category><![CDATA[exim: -D is not available in this Exim binary]]></category>
		<category><![CDATA[Starting exim alt spool: exim: -D]]></category>
		<category><![CDATA[vulnerability issue]]></category>

		<guid isPermaLink="false">http://www.theperfectarts.com/?p=1204</guid>
		<description><![CDATA[To resolve exim vulnerability issue exim upgraded to latest version but its throwing following error message aftre restarting exim service. root@server [/tmp]# /etc/init.d/exim restart Shutting down exim:                                        [  OK  ] Shutting down spamd:                                       [FAILED] Starting exim:                                             [  OK  ] Starting exim alt spool: exim: -D is not available in this Exim binary [FAILED] To resolve [...]]]></description>
			<content:encoded><![CDATA[<p>To resolve exim vulnerability issue exim upgraded to latest version but its throwing following error message aftre restarting exim service.</p>
<p><strong>root@server [/tmp]# /etc/init.d/exim restart<br />
Shutting down exim:                                        [  OK  ]<br />
Shutting down spamd:                                       [FAILED]<br />
Starting exim:                                             [  OK  ]<br />
Starting exim alt spool: exim: -D is not available in this Exim binary</strong><strong> [FAILED]</strong><br />
To resolve above error simply run following command from shell.</p>
<p><strong>root@server [/tmp]<strong>#</strong></strong><strong>/usr/mscpanel/msswitch.pl inout</strong></p>
<blockquote></blockquote>
<blockquote></blockquote>
<p><strong><br />
</strong><br />
<script type="text/javascript"><!--
google_ad_client = "ca-pub-1685490665026631";
/* images */
google_ad_slot = "1433358698";
google_ad_width = 300;
google_ad_height = 250;
//-->
</script><br />
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<p>&copy;2012 <a href="http://www.theperfectarts.com">Linux Servers cPanel webhosting blog</a>. All Rights Reserved.</p>.]]></content:encoded>
			<wfw:commentRss>http://www.theperfectarts.com/2010/12/critical-exim-security-update/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to turn off CGI execution server wide</title>
		<link>http://www.theperfectarts.com/2010/09/how-to-turn-off-cgi-execution-server-wide/</link>
		<comments>http://www.theperfectarts.com/2010/09/how-to-turn-off-cgi-execution-server-wide/#comments</comments>
		<pubDate>Thu, 02 Sep 2010 06:08:33 +0000</pubDate>
		<dc:creator>Gunjan</dc:creator>
				<category><![CDATA[Server Security]]></category>
		<category><![CDATA[Apache web server]]></category>
		<category><![CDATA[cgi disbale]]></category>
		<category><![CDATA[disbale cgi]]></category>
		<category><![CDATA[how to block cgi]]></category>
		<category><![CDATA[httpd.conf]]></category>
		<category><![CDATA[Options -ExecCGI]]></category>
		<category><![CDATA[shut down cgi server wide]]></category>
		<category><![CDATA[turn off CGI execution]]></category>
		<category><![CDATA[web server file]]></category>

		<guid isPermaLink="false">http://www.theperfectarts.com/?p=1164</guid>
		<description><![CDATA[Most servers owners do not allow there clients to run cgi. We can disable the cgi by using following code in server main Apache configuration file. Login in to shell as root user and open  httpd.conf file and following line. Options -ExecCGI Save file and restart the Apache web server. &#169;2012 Linux Servers cPanel webhosting [...]]]></description>
			<content:encoded><![CDATA[<p>Most servers owners do not allow there clients to run cgi. We can disable the cgi by using following code in server main Apache configuration file.</p>
<p>Login in to shell as root user and open  httpd.conf file and following line.</p>
<blockquote><p><strong><span style="color: #800000;">Options -ExecCGI</span></strong></p></blockquote>
<p>Save file and restart the Apache web server.</p>
<input type="hidden" name="IL_RELATED_TAGS" value="1" />
<script type="text/javascript">// <![CDATA[
 google_ad_client = "ca-pub-1685490665026631"; /* images */ google_ad_slot = "1433358698"; google_ad_width = 300; google_ad_height = 250;
// ]]&gt;</script></p>
<p><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">// <![CDATA[</p>
<p>// ]]&gt;</script></p>
<p>&copy;2012 <a href="http://www.theperfectarts.com">Linux Servers cPanel webhosting blog</a>. All Rights Reserved.</p>.]]></content:encoded>
			<wfw:commentRss>http://www.theperfectarts.com/2010/09/how-to-turn-off-cgi-execution-server-wide/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Horde Failed to connect to localhost:25 error message</title>
		<link>http://www.theperfectarts.com/2010/08/horde-failed-to-connect-to-localhost25-error-message/</link>
		<comments>http://www.theperfectarts.com/2010/08/horde-failed-to-connect-to-localhost25-error-message/#comments</comments>
		<pubDate>Fri, 06 Aug 2010 06:02:26 +0000</pubDate>
		<dc:creator>Gunjan</dc:creator>
				<category><![CDATA[Common errors]]></category>
		<category><![CDATA[E-mails issue]]></category>
		<category><![CDATA[Linux Administrator Interview Questions]]></category>
		<category><![CDATA[Server Security]]></category>
		<category><![CDATA[VPS]]></category>
		<category><![CDATA[/usr/local/cpanel/base/horde/imp/config]]></category>
		<category><![CDATA[block smtpport 25 port]]></category>
		<category><![CDATA[change SMTP port from 25 to new SMTP port]]></category>
		<category><![CDATA[change smtpport]]></category>
		<category><![CDATA[enable secondary port for exim]]></category>
		<category><![CDATA[exim conf]]></category>
		<category><![CDATA[hoarde config file]]></category>
		<category><![CDATA[Hoarde Failed to connect to localhost:25]]></category>
		<category><![CDATA[hoarde smtpport issue]]></category>
		<category><![CDATA[Hoarde webmail SMTP: Invalid response code received from server (code: 421]]></category>
		<category><![CDATA[Hoarde webmailerror sending your message]]></category>
		<category><![CDATA[how to enable smtpport]]></category>
		<category><![CDATA[open another smtp for Squirrelmail]]></category>
		<category><![CDATA[open another smtp port]]></category>
		<category><![CDATA[response: Too many concurrent SMTP connections; please try again later]]></category>
		<category><![CDATA[servers.php for hoarde]]></category>
		<category><![CDATA[smtpport]]></category>
		<category><![CDATA[Squirrelmail]]></category>
		<category><![CDATA[Squirrelmail error]]></category>
		<category><![CDATA[Squirrelmail issue]]></category>
		<category><![CDATA[Squirrelmail mail issue]]></category>
		<category><![CDATA[Squirrelmail not able to send mail]]></category>
		<category><![CDATA[Squirrelmail port 25 block]]></category>
		<category><![CDATA[what is smtpport]]></category>
		<category><![CDATA[why smtpport 25 connectoin error]]></category>
		<category><![CDATA[why smtpport block]]></category>

		<guid isPermaLink="false">http://www.theperfectarts.com/?p=1111</guid>
		<description><![CDATA[On Shared server as well  as on Dedicated server some time we are facing large connection issue to SMTP port 25 at that time mostly we disable SMTP port 25 and enable any other port for SMTP but after changing SMTP port mostly we receive following error message in Horde webmail. There was an error [...]]]></description>
			<content:encoded><![CDATA[<p>On Shared server as well  as on Dedicated server some time we are facing large connection issue to SMTP port 25 at that time mostly we disable SMTP port 25 and enable any other port for SMTP but after changing SMTP port mostly we receive following error message in Horde webmail.</p>
<blockquote><p><span style="color: #800080;">There was an error sending your message: Failed to connect  to localhost:25 [SMTP: Invalid response code received from server (code: 421,  response: Too many concurrent SMTP connections; please try again  later.)]</span></p></blockquote>
<p>To resolve above error simply change SMTP port from 25 to new SMTP port  in following file.</p>
<p><strong>root@server [/usr/local/cpanel/base/horde/imp/config</strong><strong>]# Pico servers.php</strong></p>
<p><strong>And change following line</strong></p>
<p><strong>From</strong></p>
<p><strong>&#8216;smtpport&#8217; =&gt; 25,</strong></p>
<p><strong>To</strong></p>
<p><strong>&#8216;smtpport&#8217; =&gt; 26,</strong></p>
<p>We have taken new port as 26 for example you can use any port as per your requirement.</p>
<p>Similar problem with<strong> &#8220;Squirrelmail</strong>&#8221; then refer following steps.</p>
<p><strong>root@server [/usr/local/cpanel/base/3rdparty/squirrelmail/config]#pico c</strong><strong>onfig_default.php</strong></p>
<p><strong>Change following line </strong></p>
<p><strong>From</strong></p>
<p><strong>$smtpPort = 25;</strong></p>
<p><strong>To </strong></p>
<p><strong>$smtpPort = 26;</strong></p>
<p>Save file and exit and now open the webmail.</p>
<p><strong><br />
</strong><br />
<script type="text/javascript">// <![CDATA[
 google_ad_client = "ca-pub-1685490665026631"; /* images */ google_ad_slot = "1433358698"; google_ad_width = 300; google_ad_height = 250;
// ]]&gt;</script></p>
<p><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">// <![CDATA[</p>
<p>// ]]&gt;</script></p>
<p>&copy;2012 <a href="http://www.theperfectarts.com">Linux Servers cPanel webhosting blog</a>. All Rights Reserved.</p>.]]></content:encoded>
			<wfw:commentRss>http://www.theperfectarts.com/2010/08/horde-failed-to-connect-to-localhost25-error-message/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to disable root login and enable key authentication on Dedicated server?</title>
		<link>http://www.theperfectarts.com/2010/07/how-to-disable-root-login-and-enable-key-authentication-on-dedicated-server/</link>
		<comments>http://www.theperfectarts.com/2010/07/how-to-disable-root-login-and-enable-key-authentication-on-dedicated-server/#comments</comments>
		<pubDate>Sun, 11 Jul 2010 23:00:12 +0000</pubDate>
		<dc:creator>Gunjan</dc:creator>
				<category><![CDATA[Basic Linux]]></category>
		<category><![CDATA[Linux Administrator Interview Questions]]></category>
		<category><![CDATA[Server Security]]></category>
		<category><![CDATA[VPS]]></category>
		<category><![CDATA[/etc/ssh/sshd_config]]></category>
		<category><![CDATA[chmod comamnd]]></category>
		<category><![CDATA[disable root login]]></category>
		<category><![CDATA[enable key authentication]]></category>
		<category><![CDATA[generate the key]]></category>
		<category><![CDATA[mkdir command]]></category>
		<category><![CDATA[ppk file]]></category>
		<category><![CDATA[PuTTYgen software]]></category>
		<category><![CDATA[security on dedicated server]]></category>
		<category><![CDATA[ssh file]]></category>
		<category><![CDATA[ssh Protocol]]></category>
		<category><![CDATA[sshd restart]]></category>
		<category><![CDATA[sudoers file]]></category>
		<category><![CDATA[useradd command]]></category>
		<category><![CDATA[usermod coammnd]]></category>
		<category><![CDATA[which command]]></category>

		<guid isPermaLink="false">http://www.theperfectarts.com/?p=1089</guid>
		<description><![CDATA[How to disable root login and enable key authentication on Dedicated server? Refer following steps to disable direct root login. 1. SSH into your server as root user. 2. Open file sshd_config in your favorite editor pico /etc/ssh/sshd_config 3. Find the line Protocol 2, 1 4. Uncomment line and change it to look like Protocol [...]]]></description>
			<content:encoded><![CDATA[<p>How to disable root login and enable key authentication on Dedicated server?</p>
<p>Refer following steps to disable direct root login.</p>
<p>1. SSH into your server as root user.</p>
<p>2. Open file sshd_config in your favorite editor</p>
<p><strong>pico /etc/ssh/sshd_config</strong></p>
<p>3. Find the line</p>
<p><strong>Protocol 2, 1</strong></p>
<p>4. Uncomment line and change it to look like</p>
<p><strong>Protocol 2</strong></p>
<p>5. Now find the line<br />
<strong>PermitRootLogin yes</strong></p>
<p>6. And Uncomment libe and make it look like as<br />
<strong>PermitRootLogin no</strong></p>
<p>7. Save the file sshd_config file,</p>
<p>8. Restart SSH service<br />
<strong>/etc/rc.d/init.d/sshd restart</strong></p>
<p>Once root login disabled on server generate authentication key by using following steps.</p>
<p>1. Add user for example we will add user support</p>
<p><strong>useradd support</strong></p>
<p>2.Assigne user support in wheel group.</p>
<p><strong>usermod -G wheel support</strong></p>
<p>3. Set correct permission for sudoers files.</p>
<p><strong>chmod 644 /etc/sudoers</strong></p>
<p>4. Now open sudoers file and set followings line in sudoers file.</p>
<p><strong>pico /etc/sudoers</strong></p>
<p># User privilege specification<br />
<strong>root    ALL=(ALL) ALL</strong></p>
<p># Same thing without a password<br />
<strong>%wheel        ALL=(ALL)       NOPASSWD: ALL</strong></p>
<p>5. Make sure that sudo file binery file is secure.</p>
<p><strong>chmod 4111 /usr/bin/sudo</strong></p>
<p>If you are not sure about sudo binery path then run commamd to confirm the path.</p>
<p><strong>which sudo</strong></p>
<p>6.Now create .ssh directory in support users home directory.</p>
<p><strong>cd /home/support</strong></p>
<p><strong>mkdir .ssh</strong></p>
<p><strong> cd </strong><strong>.ssh</strong></p>
<p>7. Now generate the key by using <a href="http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html">PuTTYgen software </a>and save the key on your local machine as support.ppk file.</p>
<p>8. Create authorized_keys file in .ssh directory and copy content from file support.ppk to authorized_keys file.</p>
<p>9. Confirm permission and ownership for files.</p>
<p><strong>cd /home</strong></p>
<p><strong>ll | grep support</strong></p>
<p>The ownership shuold be</p>
<blockquote><p><strong>drwx&#8212;&#8212;    7 support support          4096 Jul 10 03:44 support</strong></p></blockquote>
<p><strong>cd /home/support</strong></p>
<p><strong>ll | grep .ssh</strong></p>
<blockquote><p><strong>drwxr-xr-x    2 root   root        4096 Jul 12  3:34 .ssh/</strong></p></blockquote>
<p><strong>cd /home/support/</strong><strong>.ssh</strong></p>
<p><strong>ll</strong></p>
<p>The ownership shoud be</p>
<blockquote><p><strong>drwxr-xr-x 2 root    root    4096 Jul 12 03:22 ./<br />
drwx&#8212;&#8212; 7 support support 4096 Jul 12 03:44 ../<br />
-rw-r&#8211;r&#8211; 1 root    root    224  Jul 12 03:40 authorized_keys</strong></p></blockquote>
<p><strong>Note : Do not close current Shell until you are able to access server with the support.ppk key.</strong></p>
<p><script type="text/javascript">// <![CDATA[
 google_ad_client = "ca-pub-1685490665026631"; /* images */ google_ad_slot = "1433358698"; google_ad_width = 300; google_ad_height = 250;
// ]]&gt;</script></p>
<p><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">// <![CDATA[</p>
<p>// ]]&gt;</script></p>
<p>&copy;2012 <a href="http://www.theperfectarts.com">Linux Servers cPanel webhosting blog</a>. All Rights Reserved.</p>.]]></content:encoded>
			<wfw:commentRss>http://www.theperfectarts.com/2010/07/how-to-disable-root-login-and-enable-key-authentication-on-dedicated-server/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>SuExec server permission issue?</title>
		<link>http://www.theperfectarts.com/2010/07/suexec-server-permission-issue/</link>
		<comments>http://www.theperfectarts.com/2010/07/suexec-server-permission-issue/#comments</comments>
		<pubDate>Sat, 03 Jul 2010 21:56:09 +0000</pubDate>
		<dc:creator>Gunjan</dc:creator>
				<category><![CDATA[Common errors]]></category>
		<category><![CDATA[Linux Permissions]]></category>
		<category><![CDATA[Server Security]]></category>
		<category><![CDATA[/etc/trueuserdomains file]]></category>
		<category><![CDATA[500 Internal Server Error]]></category>
		<category><![CDATA[cat /etc/trueuserdomains file]]></category>
		<category><![CDATA[cPanel users files/directories ownership]]></category>
		<category><![CDATA[files directories ownership]]></category>
		<category><![CDATA[permission issue]]></category>
		<category><![CDATA[set 644 permission]]></category>
		<category><![CDATA[set 755 permission]]></category>
		<category><![CDATA[set default permission for files/directories]]></category>
		<category><![CDATA[SuExec server permission issue]]></category>
		<category><![CDATA[trueuserdomains]]></category>

		<guid isPermaLink="false">http://www.theperfectarts.com/?p=1077</guid>
		<description><![CDATA[After enabling SuExec on server most users getting &#8220;500 Internal Server Error&#8221; at that time refer following steps. 1st)  Correct cPanel users files/directories ownership. —— for i  in `cat /etc/trueuserdomains   &#124; awk ‘{print $2}’` do chown $i.$i /home/$i -R; chown $i.mail /home/$i/etc -R; chown $i.nobody /home/$i/public_html; done; —– 2nd) Correct permission for files and directories [...]]]></description>
			<content:encoded><![CDATA[<p>After enabling SuExec on server most users getting &#8220;500 Internal Server Error&#8221; at that time refer following steps.</p>
<p>1st)  Correct cPanel users files/directories ownership.</p>
<p>——</p>
<p><strong>for i  in `cat /etc/trueuserdomains   | awk ‘{print $2}’`<br />
do<br />
chown $i.$i /home/$i -R;<br />
chown $i.mail /home/$i/etc -R;<br />
chown $i.nobody /home/$i/public_html;<br />
done;</strong></p>
<p>—–</p>
<p>2nd) Correct permission for files and directories for cPanel users from shell but make sure that you logged in as root user and running following command in /home partition.</p>
<p><strong>—–</strong></p>
<p><strong>find . -type d  -perm 777 -exec chmod 755 {} \;</strong></p>
<p><strong>find . -type  f  -perm 644 -exec chmod 755 {} \;</strong></p>
<p><strong>—–</strong></p>
<p><script type="text/javascript">// <![CDATA[
 google_ad_client = "ca-pub-1685490665026631"; /* images */ google_ad_slot = "1433358698"; google_ad_width = 300; google_ad_height = 250;
// ]]&gt;</script></p>
<p><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">// <![CDATA[</p>
<p>// ]]&gt;</script></p>
<p>&copy;2012 <a href="http://www.theperfectarts.com">Linux Servers cPanel webhosting blog</a>. All Rights Reserved.</p>.]]></content:encoded>
			<wfw:commentRss>http://www.theperfectarts.com/2010/07/suexec-server-permission-issue/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>&#8220;unauthenticated user&#8221; problem in mysql logs?</title>
		<link>http://www.theperfectarts.com/2010/06/unauthenticated-user-problem-in-mysql-logs/</link>
		<comments>http://www.theperfectarts.com/2010/06/unauthenticated-user-problem-in-mysql-logs/#comments</comments>
		<pubDate>Wed, 30 Jun 2010 19:54:11 +0000</pubDate>
		<dc:creator>Gunjan</dc:creator>
				<category><![CDATA[Linux Administrator Interview Questions]]></category>
		<category><![CDATA[Mysql + phpmyadmin]]></category>
		<category><![CDATA[Server Security]]></category>
		<category><![CDATA[VPS]]></category>
		<category><![CDATA[check running mysql process]]></category>
		<category><![CDATA[disable remote mysql acces. /etc/my.cnf]]></category>
		<category><![CDATA[mysql issue with unauthenticated user login]]></category>
		<category><![CDATA[mysqladmin -i3 pr]]></category>
		<category><![CDATA[mysqladmin command]]></category>
		<category><![CDATA[problem with unauthenticated user login]]></category>
		<category><![CDATA[skip-host-cache]]></category>
		<category><![CDATA[skip-locking]]></category>
		<category><![CDATA[skip-name-resolve]]></category>
		<category><![CDATA[skip-networking]]></category>
		<category><![CDATA[solution for mysql unauthenticated user login]]></category>
		<category><![CDATA[solution for unauthenticated user problem]]></category>
		<category><![CDATA[unauthenticated user]]></category>
		<category><![CDATA[unauthenticated user access]]></category>
		<category><![CDATA[unauthenticated user issue]]></category>
		<category><![CDATA[unauthenticated user mysql issue]]></category>
		<category><![CDATA[unauthenticated user problem]]></category>
		<category><![CDATA[unauthenticated user resolve]]></category>

		<guid isPermaLink="false">http://www.theperfectarts.com/?p=1074</guid>
		<description><![CDATA[While running following command. mysqladmin -i3 pr We are getting result. 056 &#124; unauthenticated user &#124; localhost &#124;    &#124; Connect &#124;      &#124; Reading from net &#124; To avoid such problem add following lines in /etc/my.cnf file to avoid access for unauthenticated user. root@server [~]# pico /etc/my.cnf skip-networking skip-name-resolve skip-host-cache skip-locking Now restart the mysql service [...]]]></description>
			<content:encoded><![CDATA[<p>While running following command.</p>
<blockquote><p><strong><span style="color: #800000;">mysqladmin -i3 pr</span></strong></p></blockquote>
<p>We are getting result.</p>
<blockquote><p><strong><span style="color: #800000;">056 | unauthenticated user | localhost |    | Connect |      | Reading from net |</span></strong></p></blockquote>
<p>To avoid such problem add following lines in /etc/my.cnf file to avoid access for unauthenticated user.</p>
<blockquote><p><strong><span style="color: #800000;">root@server [~]# pico /etc/my.cnf</span></strong></p></blockquote>
<blockquote><p><strong><span style="color: #800000;">skip-networking</span></strong><br />
<strong><span style="color: #800000;"> skip-name-resolve</span></strong><br />
<strong><span style="color: #800000;"> skip-host-cache</span></strong><br />
<strong><span style="color: #800000;"> skip-locking</span></strong></p></blockquote>
<p>Now restart the mysql service and check mysql process logs again.</p>
<p><script type="text/javascript">// <![CDATA[
     google_ad_client = "ca-pub-1685490665026631"; /* images */ google_ad_slot = "1433358698"; google_ad_width = 300; google_ad_height = 250;
// ]]&gt;</script></p>
<p><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">// <![CDATA[</p>
<p>// ]]&gt;</script></p>
<p>&copy;2012 <a href="http://www.theperfectarts.com">Linux Servers cPanel webhosting blog</a>. All Rights Reserved.</p>.]]></content:encoded>
			<wfw:commentRss>http://www.theperfectarts.com/2010/06/unauthenticated-user-problem-in-mysql-logs/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Secure server from WHM?</title>
		<link>http://www.theperfectarts.com/2010/06/secure-server-from-whm/</link>
		<comments>http://www.theperfectarts.com/2010/06/secure-server-from-whm/#comments</comments>
		<pubDate>Thu, 03 Jun 2010 10:16:02 +0000</pubDate>
		<dc:creator>Gunjan</dc:creator>
				<category><![CDATA[Linux Administrator Interview Questions]]></category>
		<category><![CDATA[Server Security]]></category>
		<category><![CDATA[VPS]]></category>
		<category><![CDATA[Analog]]></category>
		<category><![CDATA[Awstats from cPanel]]></category>
		<category><![CDATA[FormMail-clon]]></category>
		<category><![CDATA[jailshell]]></category>
		<category><![CDATA[open_basedir Protection Spamassasssin]]></category>
		<category><![CDATA[Secur server frOM WHM]]></category>
		<category><![CDATA[SMTP Tweak]]></category>
		<category><![CDATA[twek settings]]></category>

		<guid isPermaLink="false">http://www.theperfectarts.com/?p=1055</guid>
		<description><![CDATA[We can secure Server from WHM by making following changes from WHM. Tweak Settings : Number (or all) of accounts to display per page in list accounts == 30 Disable : Allow users to park subdomains of the server&#8217;s hostname main domain Disable : Allow users to Park/Addon Domains on top of domains owned by [...]]]></description>
			<content:encoded><![CDATA[<p>We can secure Server from WHM by making following changes from WHM.</p>
<p>Tweak Settings :<br />
Number (or all) of accounts to display per page in list accounts == 30<br />
Disable : Allow users to park subdomains of the server&#8217;s hostname main domain<br />
Disable : Allow users to Park/Addon Domains on top of domains owned by other users.<br />
Disable : Allow users to Park/Addon Domains on top of domains owned by other users.<br />
Disable : Allow resellers to create accounts with subdomains of the server&#8217;s hostname main domain<br />
Disable : Allow Creation of Parked/Addon Domains that are not registered<br />
Disable : When adding a new domain, automatically create A entries for the registered nameservers if they would be contained in the zone<br />
Enable : Prevent users from parking/adding on common internet domain</p>
<p>Enable : Silently Discard all FormMail-clone requests with a bcc: header in the subject line<br />
Set Default Mail to FAIL.<br />
Disable : Track the origin of messages sent though the mail server by adding the X-Source headers.<br />
The maximum each domain can send out per hour = 300</p>
<p>Prevent the user &#8220;nobody&#8221; from sending out mail to remote addresses : Disable should enabled on server with phpsuexec.<br />
Disable : BoxTrapper Spam Trap<br />
Disable : Add the mail. prefix for mailman urls</p>
<p>Disable : Send passwords in plaintext over email when creating a new acccount</p>
<p>Disable : Awstats Reverse Dns Resolution<br />
Disable : Analog<br />
Disable : Allow users to update Awstats from cPanel<br />
Number of days between processing log files and bandwidth usage = 1<br />
Enable : Delete each domain&#8217;s access logs after stats run<br />
The load average above the number of cpus at which logs file processing should be suspended = 10<br />
Enable : Keep Stats Log between cPanel restarts</p>
<p>Disable : Allow Perl updates from RPM based linux vendors<br />
Enable : Use jailshell as the default shell for all new accounts and modified accounts<br />
Disable : Allow cPanel users to reset their password via email<br />
Enable : Spamassasssin</p>
<p>Tweak Security :<br />
Enable PHP open_basedir Protection.<br />
Enable mod_userdir Protection.<br />
Enable SMTP Tweak<br />
Disable Compilers for unprivileged users.<br />
<script type="text/javascript">// <![CDATA[
 google_ad_client = "ca-pub-1685490665026631"; /* images */ google_ad_slot = "1433358698"; google_ad_width = 300; google_ad_height = 250;
// ]]&gt;</script></p>
<p><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">// <![CDATA[</p>
<p>// ]]&gt;</script></p>
<p>&copy;2012 <a href="http://www.theperfectarts.com">Linux Servers cPanel webhosting blog</a>. All Rights Reserved.</p>.]]></content:encoded>
			<wfw:commentRss>http://www.theperfectarts.com/2010/06/secure-server-from-whm/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Install clamAV?</title>
		<link>http://www.theperfectarts.com/2010/05/install-clamav/</link>
		<comments>http://www.theperfectarts.com/2010/05/install-clamav/#comments</comments>
		<pubDate>Thu, 13 May 2010 18:24:45 +0000</pubDate>
		<dc:creator>Gunjan</dc:creator>
				<category><![CDATA[Install server side software / script]]></category>
		<category><![CDATA[Server Security]]></category>
		<category><![CDATA[VPS]]></category>
		<category><![CDATA[calmv antivirus]]></category>
		<category><![CDATA[clamAV]]></category>
		<category><![CDATA[clamv scanner]]></category>
		<category><![CDATA[Install clamAV on cPanel server]]></category>

		<guid isPermaLink="false">http://www.theperfectarts.com/?p=1030</guid>
		<description><![CDATA[We can install clamAV by using following three options. First Download ClamAV from www.clamav.net in default locations under /usr/local/[bin,man,share] Run following from shell. root@server[]perl -MCPAN -e shell root@server[]install Parse::RecDescent root@server[]install Inline root@server[]install Mail::ClamAV Second option run /scripts/perlinstaller from shell root@server[]/scripts/perlinstaller Net::CIDR Archive::Zip Compress::Zlib Convert::BinHex Inline::C or root@server[]/scripts/perlinstaller Mail::ClamAV Third you can install ClamAV from WHM [...]]]></description>
			<content:encoded><![CDATA[<p>We can install clamAV by using following three options.</p>
<p>First Download ClamAV from www.clamav.net in default locations under /usr/local/[bin,man,share]<br />
Run following from shell.</p>
<blockquote><p>root@server[]perl -MCPAN -e shell<br />
root@server[]install Parse::RecDescent<br />
root@server[]install Inline<br />
root@server[]install Mail::ClamAV</p></blockquote>
<p>Second option run /scripts/perlinstaller from shell</p>
<blockquote><p>root@server[]/scripts/perlinstaller Net::CIDR Archive::Zip Compress::Zlib Convert::BinHex Inline::C<br />
or</p>
<p><script type="text/javascript">// <![CDATA[
 google_ad_client = "ca-pub-1685490665026631"; /* images */ google_ad_slot = "1433358698"; google_ad_width = 300; google_ad_height = 250;
// ]]&gt;</script></p>
<p><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">// <![CDATA[</p>
<p>// ]]&gt;</script><br />
root@server[]/scripts/perlinstaller Mail::ClamAV</p></blockquote>
<p>Third you can install ClamAV from WHM</p>
<blockquote><p>Select Main &gt;&gt; Software &gt;&gt; Install a Perl Module from WHM .</p>
<p>install perl module:-<br />
search for Mail::clamAV<br />
install it</p></blockquote>
<p>We can also enabled virus scanner feature to cPanel user from WHM &gt;&gt; Main &gt;&gt; cPanel&gt;&gt; Manage Plugins</p>
<p>Select  &#8220;Name: clamavconnector&#8221; from list and install it.</p>
<p>&copy;2012 <a href="http://www.theperfectarts.com">Linux Servers cPanel webhosting blog</a>. All Rights Reserved.</p>.]]></content:encoded>
			<wfw:commentRss>http://www.theperfectarts.com/2010/05/install-clamav/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

