<?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>Fedora &#187; Security</title>
	<atom:link href="http://gofedora.com/archives/category/security/feed/" rel="self" type="application/rss+xml" />
	<link>http://gofedora.com</link>
	<description>How Tos, Tutorials, Tips and Tricks</description>
	<lastBuildDate>Wed, 14 Sep 2011 15:10:52 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>My New Book on Squid Proxy Server (A Beginner&#8217;s Guide)</title>
		<link>http://gofedora.com/book-squid-proxy-server-beginners-guide/</link>
		<comments>http://gofedora.com/book-squid-proxy-server-beginners-guide/#comments</comments>
		<pubDate>Mon, 18 Apr 2011 03:32:19 +0000</pubDate>
		<dc:creator>Kulbir Saini</dc:creator>
				<category><![CDATA[Configuration]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[Installation]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Proxy Server]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[Squid]]></category>
		<category><![CDATA[Beginner Guide]]></category>
		<category><![CDATA[Configure]]></category>
		<category><![CDATA[Install]]></category>
		<category><![CDATA[Reverse Proxy]]></category>
		<category><![CDATA[Squid 3.1]]></category>
		<category><![CDATA[Squid 3.2]]></category>
		<category><![CDATA[Squid Book]]></category>
		<category><![CDATA[Squid Guide]]></category>
		<category><![CDATA[Squid Proxy Server]]></category>
		<category><![CDATA[Transparent Proxy]]></category>

		<guid isPermaLink="false">http://gofedora.com/?p=1072</guid>
		<description><![CDATA[
I have not blogged since a long time mainly because I was a bit busy authoring a book Squid Proxy Server 3.1: Beginner&#8217;s Guide for Packt Publications. The book is an introductory guide to Squid (especially the new features in Squid-3 series) covering both the basic aspects as well as the in dept details for [...]<p><a href="http://gofedora.com/">Fedora Tutorials</a> and <a href="http://cachevideos.com/">Videocache</a> by <a href="http://saini.co.in/">Kulbir Saini</a>.</p>
]]></description>
			<content:encoded><![CDATA[<p><a class="post_image_link" href="http://gofedora.com/book-squid-proxy-server-beginners-guide/" title="Permanent link to My New Book on Squid Proxy Server (A Beginner&#8217;s Guide)"><img class="post_image alignnone" src="http://gofedora.com/wp-content/uploads/2011/04/Squid-Proxy-Server-3.1-Beginner-Guide-by-Kulbir-Saini.jpg" width="240" height="300" alt="Squid Proxy Server 3.1: Beginner's Guide" title="My New Book on Squid Proxy Server (A Beginners Guide)" /></a>
</p><p>I have not blogged since a long time mainly because I was a bit busy authoring a book <a href="http://link.packtpub.com/K7JQGy" target="_blank">Squid Proxy Server 3.1: Beginner&#8217;s Guide</a> for Packt Publications. The book is an introductory guide to <a href="http://www.squid-cache.org/" target="_blank">Squid</a> (especially the new features in Squid-3 series) covering both the basic aspects as well as the in dept details for advanced users. The book focuses on learning by doing and provides example scenarios for the concepts discussed throughout the book. Access control configuration, reverse proxying, interception proxying, authentication and other features have been discussed in details with examples.</p>
<p>Checkout the links below:</p>
<ul>
<li><a href="http://www.packtpub.com/toc/squid-proxy-server-31-beginners-guide-table-contents" target="_blank">Table of contents</a></li>
<li><a href="http://www.packtpub.com/sites/default/files/3906-chapter-3-running-squid.pdf?utm_source=packtpub&amp;utm_medium=free&amp;utm_campaign=pdf" target="_blank">Sample Chapter : Running Squid</a></li>
<li><a href="http://www.amazon.co.uk/Squid-Proxy-Server-3-1-Beginner-27s/dp/1849513902/" target="_blank">Amazon link</a></li>
</ul>
<p><a href="http://gofedora.com/">Fedora Tutorials</a> and <a href="http://cachevideos.com/">Videocache</a> by <a href="http://saini.co.in/">Kulbir Saini</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://gofedora.com/book-squid-proxy-server-beginners-guide/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Crack: Google Authentication Services are Vulnerable</title>
		<link>http://gofedora.com/crack-google-authentication-services-vulnerable/</link>
		<comments>http://gofedora.com/crack-google-authentication-services-vulnerable/#comments</comments>
		<pubDate>Fri, 05 Dec 2008 18:41:58 +0000</pubDate>
		<dc:creator>Kulbir Saini</dc:creator>
				<category><![CDATA[Bug]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[Hacks]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[Proxy Server]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[Squid]]></category>
		<category><![CDATA[Authentication]]></category>
		<category><![CDATA[Vulnerability]]></category>

		<guid isPermaLink="false">http://172.17.8.64/gofedora/?p=306</guid>
		<description><![CDATA[
There is a vulnerability in the way Google authentication service works. Whenever you login to any of the Google&#8217;s online services like GMail, Orkut, Groups, Docs, Youtube, Calendar etc., you are redirected to an authentication server which authenticates against the entered username and password and redirect back to the required service (GMail, Youtube etc.) setting [...]<p><a href="http://gofedora.com/">Fedora Tutorials</a> and <a href="http://cachevideos.com/">Videocache</a> by <a href="http://saini.co.in/">Kulbir Saini</a>.</p>
]]></description>
			<content:encoded><![CDATA[<p><a class="post_image_link" href="http://gofedora.com/crack-google-authentication-services-vulnerable/" title="Permanent link to Crack: Google Authentication Services are Vulnerable"><img class="post_image alignnone" src="http://gofedora.com/wp-content/uploads/2008/12/Google-Services-Authentication.jpg" width="384" height="192" alt="Google Services Authentication" title="Crack: Google Authentication Services are Vulnerable" /></a>
</p><p>There is a vulnerability in the way Google authentication service works. Whenever you login to any of the Google&#8217;s online services like GMail, Orkut, Groups, Docs, Youtube, Calendar etc., you are redirected to an authentication server which authenticates against the entered username and password and redirect back to the required service (GMail, Youtube etc.) setting the session variables.</p>
<p>Now, if you are able to grab the url used to set the session variables, you can login as the user to whom that url belongs from any machine on the Internet (need not be the machine belonging to the same subnet) without entering the username and password of the user.</p>
<p>The proxy servers in the organizations can be used to exploit this vulnerability. Squid is the most popular proxy server used. In the default configuration, squid strips the query terms of a url before logging. So, this vulnerability can&#8217;t be exploited. But if you turn off the stripping mechanism by adding the line shown below, then squid will log the complete url.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">strip_query_terms off</pre></div></div>

<p>So, after turning stripping mechanism off, the log will contain urls which will look like this</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">http:<span style="color: #000000; font-weight: bold;">//</span>www.google.co.in<span style="color: #000000; font-weight: bold;">/</span>accounts<span style="color: #000000; font-weight: bold;">/</span>SetSID?<span style="color: #007800;">ssdc</span>=<span style="color: #000000;">1</span><span style="color: #000000; font-weight: bold;">&amp;</span>amp;<span style="color: #007800;">sidt</span>=Q5UrfB0BAAA<span style="color: #000000; font-weight: bold;">%</span>3D.oHVGErODzffQ<span style="color: #000000; font-weight: bold;">%</span>2Bms<span style="color: #000000; font-weight: bold;">%</span>2FOKfk53g5naReDKehRNHOBsmJlBu3VTNXjF03SbgX<span style="color: #000000; font-weight: bold;">%</span>2FVEEhmImhR4mlu5IAAjM<span style="color: #000000; font-weight: bold;">%</span>2BdbuXvMMSIb0oU8IGCYpnLcSNkbCIrG<span style="color: #000000; font-weight: bold;">%</span>2BQnm81YmX5<span style="color: #000000; font-weight: bold;">%</span>2Brcrq7U6Qx65<span style="color: #000000; font-weight: bold;">%</span>2F1yaQ2NzgmKD94jg0Iw13iXDen3qD5qn6L<span style="color: #000000; font-weight: bold;">%</span>2FhmmYWwTrcOeuTzGbO<span style="color: #000000; font-weight: bold;">%</span>2BAehpjEU3mrWapRafaq3b4kxyigJ68s8QrGQqZTINNE<span style="color: #000000; font-weight: bold;">%</span>2Bs<span style="color: #000000; font-weight: bold;">%</span>2BoIkZWmGt5kNzoT8fkVAsWJeu3CKFkxj4oVMngeDvpwb1nyFpsJCltOzmAr46fTxVJSpvQdx0<span style="color: #000000; font-weight: bold;">%</span>3D.BMLtjUdIDCcuszktZSvYzA<span style="color: #000000; font-weight: bold;">%</span>3D<span style="color: #000000; font-weight: bold;">%</span>3D<span style="color: #000000; font-weight: bold;">&amp;</span>amp;<span style="color: #007800;"><span style="color: #7a0874; font-weight: bold;">continue</span></span>=http<span style="color: #000000; font-weight: bold;">%</span>3A<span style="color: #000000; font-weight: bold;">%</span>2F<span style="color: #000000; font-weight: bold;">%</span>2Fwww.orkut.com<span style="color: #000000; font-weight: bold;">%</span>2FRedirLogin.aspx<span style="color: #000000; font-weight: bold;">%</span>3Fmsg<span style="color: #000000; font-weight: bold;">%</span>3D0<span style="color: #000000; font-weight: bold;">%</span>26ts<span style="color: #000000; font-weight: bold;">%</span>3D1226148773097<span style="color: #000000; font-weight: bold;">%</span>3A1226148773386<span style="color: #000000; font-weight: bold;">%</span>3A1226148774868<span style="color: #000000; font-weight: bold;">%</span>26auth<span style="color: #000000; font-weight: bold;">%</span>3DDQAAAIcAAAC1pPE1QT4chKgrU4B3oyKZrQRkEVPtYlclpESQoXV_d9x9gdoe75Z0hfJ_22Pn5tVMR7j-uV5YCps3NB48L0bFlDeX-4PGHVT6Loztp_ru3tAy_gxDa9_YAEbz4d9CO4wD2VTKtzax9zvpGgrnJVZQfoWPkkIomUmxDtVGoH7g3fA3UjS0vdBJ2PJtgFMElso</pre></div></div>

<p>Replace <em>.co.in</em> with your tld specific to your country. If you paste this url in any browser, it&#8217;ll directly log you in and you can do whatever you want to that account. Remember that all such urls remains valid only for two minutes. So, if you use that url after two minutes, it&#8217;ll lead nowhere.</p>
<p>At the time of writing this post Orkut, Google Docs, Google Calendar, Google Books and Youtube are vulnerable.</p>
<p>So, make sure your squid has stripping mechanism turned on and your squid server is properly firewalled.</p>
<p>You can watch the Video proof for Orkut on <a href="http://blip.tv/file/1541246/">Blip.tv</a>, <a href="http://in.youtube.com/watch?v=5u81XNqSHJ4">Youtube</a>.</p>
<p><a href="http://gofedora.com/">Fedora Tutorials</a> and <a href="http://cachevideos.com/">Videocache</a> by <a href="http://saini.co.in/">Kulbir Saini</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://gofedora.com/crack-google-authentication-services-vulnerable/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>How To: Write Custom Basic Authentication Plugin for Squid in Python</title>
		<link>http://gofedora.com/how-to-write-custom-basic-authentication-plugin-squid-python/</link>
		<comments>http://gofedora.com/how-to-write-custom-basic-authentication-plugin-squid-python/#comments</comments>
		<pubDate>Wed, 23 Apr 2008 19:37:19 +0000</pubDate>
		<dc:creator>Kulbir Saini</dc:creator>
				<category><![CDATA[Hacks]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Proxy Server]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[Squid]]></category>
		<category><![CDATA[Tips - Tricks]]></category>
		<category><![CDATA[Basic Authentication]]></category>
		<category><![CDATA[LDAP]]></category>
		<category><![CDATA[NTLM]]></category>
		<category><![CDATA[Plugin]]></category>

		<guid isPermaLink="false">http://172.17.8.64/gofedora/?p=217</guid>
		<description><![CDATA[Mission
To write a Python program which can be used to authenticate for Squid proxy server. This is useful when you don&#8217;t want to configure complex systems like LDAP, ntlm etc.
Use Cases

When you want to authenticate clients using mysql database.
When you want to authenticate clients using flat files or /etc/passwd file or some custom service on [...]<p><a href="http://gofedora.com/">Fedora Tutorials</a> and <a href="http://cachevideos.com/">Videocache</a> by <a href="http://saini.co.in/">Kulbir Saini</a>.</p>
]]></description>
			<content:encoded><![CDATA[<p></p><h4><b>Mission</b></h4>
<p>To write a Python program which can be used to authenticate for Squid proxy server. This is useful when you don&#8217;t want to configure complex systems like LDAP, ntlm etc.</p>
<h4><b>Use Cases</b></h4>
<ol>
<li>When you want to authenticate clients using mysql database.</li>
<li>When you want to authenticate clients using flat files or /etc/passwd file or some custom service on your network.</li>
</ol>
<h4><b>How to proceed</b></h4>
<p>From auth_param section in squid.conf file:</p>
<blockquote><p><i>Specify the command for the external authenticator. Such a program reads a line containing &quot;username password&quot; and replies &quot;OK&quot; or &quot;ERR&quot; in an endless loop. &quot;ERR&quot; responses may optionally be followed by a error description available as %m in the returned error page.</p>
<p> By default, the basic authentication scheme is not used unless a program is specified.</i></p></blockquote>
<p>That clearly states that our python program should read a line from standard input (stdin) and write the appropriate response to the standard output (stdout). But there are some issues with I/O. The output should be unbuffered and should be flushed to standard output immediately after the response is known.</p>
<p>So, lets see a small program where we authenticate using a function &#8216;<i>matchpassword()</i>&#8216;. This function returns <i>True</i> when username, password pair matches and returns <i>False</i> when they mismatch.</p>
<p>
<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
</pre></td><td class="code"><pre class="python" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">#!/usr/bin/python</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">sys</span>
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">socket</span>
<span style="color: #483d8b;">&quot;&quot;&quot;USAGE:The function returns True if the user and passwd match False otherwise&quot;&quot;&quot;</span>
<span style="color: #ff7700;font-weight:bold;">def</span> matchpasswd<span style="color: black;">&#40;</span>login,passwd<span style="color: black;">&#41;</span>:
    <span style="color: #808080; font-style: italic;"># Write your own function definition. </span>
    <span style="color: #808080; font-style: italic;"># Use mysql, files, /etc/passwd or some service or whatever you want</span>
    <span style="color: #ff7700;font-weight:bold;">pass</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">while</span> <span style="color: #008000;">True</span>:
    <span style="color: #808080; font-style: italic;"># read a line from stdin</span>
    line = <span style="color: #dc143c;">sys</span>.<span style="color: black;">stdin</span>.<span style="color: #dc143c;">readline</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
    <span style="color: #808080; font-style: italic;"># remove '\n' from line</span>
    line = line.<span style="color: black;">strip</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
    <span style="color: #808080; font-style: italic;"># extract username and password from line</span>
    username = line<span style="color: black;">&#91;</span>:line.<span style="color: black;">find</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">' '</span><span style="color: black;">&#41;</span><span style="color: black;">&#93;</span>
    password = line<span style="color: black;">&#91;</span>line.<span style="color: black;">find</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">' '</span><span style="color: black;">&#41;</span>+<span style="color: #ff4500;">1</span>:<span style="color: black;">&#93;</span>
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">if</span> matchpasswd<span style="color: black;">&#40;</span>username, password<span style="color: black;">&#41;</span>:
        <span style="color: #dc143c;">sys</span>.<span style="color: black;">stdout</span>.<span style="color: black;">write</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'OK<span style="color: #000099; font-weight: bold;">\n</span>'</span><span style="color: black;">&#41;</span>
    <span style="color: #ff7700;font-weight:bold;">else</span>:
        <span style="color: #dc143c;">sys</span>.<span style="color: black;">stdout</span>.<span style="color: black;">write</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'ERR<span style="color: #000099; font-weight: bold;">\n</span>'</span><span style="color: black;">&#41;</span>
    <span style="color: #808080; font-style: italic;"># Flush the output to stdout.</span>
    <span style="color: #dc143c;">sys</span>.<span style="color: black;">stdout</span>.<span style="color: black;">flush</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></pre></td></tr></table></div>

</p>
<p>Save the above file somewhere. We save this example file in <i>/etc/squid/custom_auth.py</i> .Now, we have the function for authenticating clients. We need to configure squid to use custom_auth.py . Below is the squid configuration for telling squid to use the above program as basic authenticator.</p>
<p>
<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># you need to specify /usr/bin/python if your file is not executable and needs an interpreter to be invoked.</span>
<span style="color: #666666; font-style: italic;"># Replace /usr/bin/python with /usr/bin/php , if you write auth program in php.</span>
auth_param basic program <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>python <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>squid<span style="color: #000000; font-weight: bold;">/</span>custom_auth.py
<span style="color: #666666; font-style: italic;"># how many instances of the above program should run concurrently</span>
auth_param basic children <span style="color: #000000;">5</span>
<span style="color: #666666; font-style: italic;"># display some message to clients when they are asked for username, password</span>
auth_param basic realm Please enter your proxy server username and password
<span style="color: #666666; font-style: italic;"># for how much time the authentication should be valid</span>
auth_param basic credentialsttl <span style="color: #000000;">2</span> hours
<span style="color: #666666; font-style: italic;"># whether username, password should be case sensitive or not</span>
auth_param basic casesensitive on</pre></td></tr></table></div>

</p>
<p>Now, to force clients to authenticate, configure the acls as follow. Below we assume, you want to force all clients on your lan to authenticate for using proxy server.</p>
<p>
<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># acl to force proxy authentication</span>
acl authenticated proxy_auth REQUIRED
<span style="color: #666666; font-style: italic;"># acl to define IPs from your lan</span>
acl lan src 192.168.0.0<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">16</span>
<span style="color: #666666; font-style: italic;"># acl to force clients on your lan to authenticate</span>
http_access allow lan authenticated</pre></td></tr></table></div>

</p>
<p>Now, reload/restart squid. That&#8217;s all we need to write and use a custom authentication plugin for squid.</p>
<h4><b>Limitation</b></h4>
<p>Username can&#8217;t contain spaces. Otherwise program will not be able to parse/extract username, password from standard input.</p>
<p><a href="http://gofedora.com/">Fedora Tutorials</a> and <a href="http://cachevideos.com/">Videocache</a> by <a href="http://saini.co.in/">Kulbir Saini</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://gofedora.com/how-to-write-custom-basic-authentication-plugin-squid-python/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How To: Configure Secure FTP Server (VSFTPD)</title>
		<link>http://gofedora.com/how-to-configure-secure-ftp-server-vsftpd/</link>
		<comments>http://gofedora.com/how-to-configure-secure-ftp-server-vsftpd/#comments</comments>
		<pubDate>Fri, 07 Sep 2007 19:53:48 +0000</pubDate>
		<dc:creator>Kulbir Saini</dc:creator>
				<category><![CDATA[Administration]]></category>
		<category><![CDATA[Configuration]]></category>
		<category><![CDATA[FTP]]></category>
		<category><![CDATA[FTP Server]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[Automount]]></category>
		<category><![CDATA[Secure FTP]]></category>
		<category><![CDATA[Upload]]></category>
		<category><![CDATA[VSFTPD]]></category>

		<guid isPermaLink="false">http://172.17.8.64/gofedora/?p=227</guid>
		<description><![CDATA[This post is totally dedicated to vsftpd configuration with uploads enabled. vsftpd stands for Very Secure FTP Daemon. It is shipped with almost all the latest Red Hat based OS. vsftpd for rpm based Linux distros can be downloaded from here. Also, one can install vsftpd by issuing &#8216;yum install vsftpd&#8217; or &#8216;apt-get install vsftpd&#8217; [...]<p><a href="http://gofedora.com/">Fedora Tutorials</a> and <a href="http://cachevideos.com/">Videocache</a> by <a href="http://saini.co.in/">Kulbir Saini</a>.</p>
]]></description>
			<content:encoded><![CDATA[<p></p><p>This post is totally dedicated to vsftpd configuration with uploads enabled. vsftpd stands for Very Secure FTP Daemon. It is shipped with almost all the latest Red Hat based OS. vsftpd for rpm based Linux distros can be downloaded from <a href="http://fr.rpmfind.net/linux/rpm2html/search.php?query=vsftpd&amp;submit=Search+..." target="_blank">here</a>. Also, one can install vsftpd by issuing &#8216;yum install vsftpd&#8217; or &#8216;apt-get install vsftpd&#8217; command. After installing vsftpd, you just need to start the vsftpd service.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>bordeaux saini<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ service vsftpd start <span style="color: #7a0874; font-weight: bold;">&#91;</span>Enter<span style="color: #7a0874; font-weight: bold;">&#93;</span></pre></div></div>

<p>And you are done. Your computer is now a FTP server. You can browse your ftp server by pointing your favourite browser to ftp://localhost/ or ftp://127.0.0.1/ or ftp://&lt;IP_ADDRESS_OF_YOUR_MACHINE&gt; .</p>
<p>If you see access denied or some error related to access. Issue &#8216;iptables &#8211;flush&#8217; and &#8217;setenforce 0&#8242; commands.</p>
<p>By default the files and directories in /var/ftp/ directory will be shown at ftp://localhost/ .  Now, there are two ways to share your files on ftp.</p>
<p>1. Copy/move files that you want to share to /var/ftp/ directory.</p>
<p>2. Mount directories you want to share to /var/ftp/SharedDirName. Suppose you want to share /home/saini/Movies/ folder on your ftp, then follow the following steps:</p>
<h4><strong>Step 1</strong></h4>
<p>Login as root.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>saini<span style="color: #000000; font-weight: bold;">@</span>bordeaux saini<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">su</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>Enter<span style="color: #7a0874; font-weight: bold;">&#93;</span>
Enter Password <span style="color: #000000; font-weight: bold;">for</span> root.</pre></td></tr></table></div>

<h4><strong>Step 2</strong></h4>
<p>Go to /var/ftp/ and create the directory that you want to share.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>bordeaux saini<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>ftp<span style="color: #000000; font-weight: bold;">/</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>Enter<span style="color: #7a0874; font-weight: bold;">&#93;</span>
<span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>bordeaux <span style="color: #c20cb9; font-weight: bold;">ftp</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">mkdir</span> SharedMovies <span style="color: #7a0874; font-weight: bold;">&#91;</span>Enter<span style="color: #7a0874; font-weight: bold;">&#93;</span></pre></td></tr></table></div>

<h4><strong>Step 3</strong></h4>
<p>Bind the original directory to SharedMovies.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>bordeaux <span style="color: #c20cb9; font-weight: bold;">ftp</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">mount</span> <span style="color: #660033;">--bind</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>saini<span style="color: #000000; font-weight: bold;">/</span>Movies<span style="color: #000000; font-weight: bold;">/</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>ftp<span style="color: #000000; font-weight: bold;">/</span>SharedMovies<span style="color: #000000; font-weight: bold;">/</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>Enter<span style="color: #7a0874; font-weight: bold;">&#93;</span></pre></div></div>

<p>If you browse your ftp now, you&#8217;ll see SharedMovies folder as well.  You can remove default pub directory if you don&#8217;t like it.</p>
<p>The current ftp server will be a very basic one and will allow only downloads. Below we will see how to configure it so that others are allowed to upload files/directories to your server.</p>
<h4><strong>Step 1</strong></h4>
<p>Create a directory say &#8216;Upload&#8217;.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>bordeaux saini<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">mkdir</span> Upload <span style="color: #7a0874; font-weight: bold;">&#91;</span>Enter<span style="color: #7a0874; font-weight: bold;">&#93;</span></pre></div></div>

<p>Note that this Upload directory can be anywhere either in your home directory or in /var/ftp/ or even on some other partitions.</p>
<h4><strong>Step 2</strong></h4>
<p>Change the ownership of Upload to ftp and change the permissions to 777.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>bordeaux saini<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">chown</span> <span style="color: #c20cb9; font-weight: bold;">ftp</span>:<span style="color: #c20cb9; font-weight: bold;">ftp</span> Upload <span style="color: #7a0874; font-weight: bold;">&#91;</span>Enter<span style="color: #7a0874; font-weight: bold;">&#93;</span>
<span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>bordeaux saini<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #000000;">777</span> Upload <span style="color: #7a0874; font-weight: bold;">&#91;</span>Enter<span style="color: #7a0874; font-weight: bold;">&#93;</span></pre></td></tr></table></div>

<h4><strong>Step 3</strong></h4>
<p>If you created Upload at any place other than /var/ftp/ , then bind it to a dir in /var/ftp/ .</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>bordeaux saini<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>ftp<span style="color: #000000; font-weight: bold;">/</span>Uploads <span style="color: #7a0874; font-weight: bold;">&#91;</span>Enter<span style="color: #7a0874; font-weight: bold;">&#93;</span>
<span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>bordeaux saini<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">mount</span> <span style="color: #660033;">--bind</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>saini<span style="color: #000000; font-weight: bold;">/</span>Upload<span style="color: #000000; font-weight: bold;">/</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>ftp<span style="color: #000000; font-weight: bold;">/</span>Uploads<span style="color: #000000; font-weight: bold;">/</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>Enter<span style="color: #7a0874; font-weight: bold;">&#93;</span></pre></td></tr></table></div>

<h4><strong>Step 4</strong></h4>
<p>Configure vsftpd.conf . The default configuration files for vsftpd lives in /etc/vsftpd/ . vsftpd.conf is configuration file for vsftpd.<br />
Open /etc/vsftpd/vsftpd.conf in any editor and add/uncomment the following lines :</p>
<p>Lines to be added or uncomments in /etc/vsftpd/vsftpd.conf</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #007800;">anonymous_enable</span>=YES
<span style="color: #007800;">write_enable</span>=YES
<span style="color: #007800;">write_enable</span>=YES
<span style="color: #007800;">anon_upload_enable</span>=YES
<span style="color: #007800;">anon_mkdir_write_enable</span>=YES
<span style="color: #007800;">anon_other_write_enable</span>=YES
<span style="color: #007800;">dirmessage_enable</span>=YES
<span style="color: #007800;">dirlist_enable</span>=YES
<span style="color: #007800;">no_anon_password</span>=YES
<span style="color: #007800;">file_open_mode</span>=0777
<span style="color: #007800;">guest_enable</span>=YES</pre></td></tr></table></div>

<p>Save vsftpd.conf file and restart the vsftpd service with the command &#8217;service vsftpd restart&#8217;. Now anyone can upload files to your ftp server, but only to Upload folder.</p>
<p>There are certain more configurations which are related to restricting bandwidth, upload/download speed, connections etc.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #007800;">max_per_ip</span>=<span style="color: #000000;">2</span> <span style="color: #666666; font-style: italic;"># Max no. of allowed connections per IP Address.</span>
<span style="color: #007800;">max_clients</span>=<span style="color: #000000;">3</span> <span style="color: #666666; font-style: italic;"># Max no. of different IP Addressed which are allowed to connect.</span>
<span style="color: #007800;">anon_max_rate</span>=<span style="color: #000000;">1097152</span> <span style="color: #666666; font-style: italic;"># Max bytes/sec a user can upload/download to/from your ftp server.</span>
<span style="color: #007800;">banner_file</span>=<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>vsftpd<span style="color: #000000; font-weight: bold;">/</span>ftp_banner <span style="color: #666666; font-style: italic;"># The file containing the welcome message to be displayed to the clients.</span></pre></td></tr></table></div>

<p>For more configuration options, refer man pages for vsftpd.conf and vsftpd.</p>
<p>Note :</p>
<ul>
<li> Whenever you restart your computer, you have to bind the directories everytime, so that they are shown on the ftp server. To skip binding every time, write everything (all commands for binding) in a <a href="http://gofedora.com/wp-content/uploads/linux/mount.sh" target="_blank">mount.sh</a> file and run it whenever you  restart your computer.</li>
<li>You can view my vsftpd.conf file <a href="http://gofedora.com/wp-content/uploads/linux/vsftpd.conf" target="_blank">here</a>.</li>
<li>Sometime, uploaded files doesn&#8217;t have 777 permissions. You can run this <a href="http://gofedora.com/wp-content/uploads/linux/chown.sh" target="_blank">shell script</a> in background forever.</li>
</ul>
<p>PS0 : Absence of compat-libstdc++-33(libstdc++.so.5) is breaking a large no. of applications in Fedora 7. Here&#8217;s a solution <a href="http://gofedora.com/archives/2007/08/22/bug-strange-libstdcso5-problem-fedora-7/">anyway</a>.</p>
<p><a href="http://gofedora.com/">Fedora Tutorials</a> and <a href="http://cachevideos.com/">Videocache</a> by <a href="http://saini.co.in/">Kulbir Saini</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://gofedora.com/how-to-configure-secure-ftp-server-vsftpd/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>How To: Recover/Crack Root Password when Grub is Locked</title>
		<link>http://gofedora.com/how-to-recover-crack-root-password-grub-locked/</link>
		<comments>http://gofedora.com/how-to-recover-crack-root-password-grub-locked/#comments</comments>
		<pubDate>Sat, 03 Dec 2005 21:21:18 +0000</pubDate>
		<dc:creator>Kulbir Saini</dc:creator>
				<category><![CDATA[Grub]]></category>
		<category><![CDATA[Hacks]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Crack Password]]></category>
		<category><![CDATA[Recover Password]]></category>
		<category><![CDATA[Rescue System]]></category>

		<guid isPermaLink="false">http://172.17.8.64/gofedora/?p=256</guid>
		<description><![CDATA[The only essential thing is that you should have a Linux boot CD of the same operating system for which you want to crack root password. Some other Linux boot CD may work in some cases. If system is able to boot from the CD, it will take you to a command prompt as shown.

boot:

Type [...]<p><a href="http://gofedora.com/">Fedora Tutorials</a> and <a href="http://cachevideos.com/">Videocache</a> by <a href="http://saini.co.in/">Kulbir Saini</a>.</p>
]]></description>
			<content:encoded><![CDATA[<p></p><p>The only essential thing is that you should have a Linux boot CD of the same operating system for which you want to crack root password. Some other Linux boot CD may work in some cases. If system is able to boot from the CD, it will take you to a command prompt as shown.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">boot:</pre></div></div>

<p>Type &#8216;linux rescue&#8217; at this command prompt and enter as shown</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">boot: linux rescue <span style="color: #7a0874; font-weight: bold;">&#91;</span>Enter<span style="color: #7a0874; font-weight: bold;">&#93;</span></pre></div></div>

<p>It will take you to some interface with some questions,  answer them properly. The system will go to temporary command prompt. Then issue the following commands</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #c20cb9; font-weight: bold;">bash</span>$<span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #c20cb9; font-weight: bold;">chroot</span> <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>sysimage <span style="color: #7a0874; font-weight: bold;">&#91;</span>Enter<span style="color: #7a0874; font-weight: bold;">&#93;</span>
<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #c20cb9; font-weight: bold;">bash</span>$<span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>boot<span style="color: #000000; font-weight: bold;">/</span>grub <span style="color: #7a0874; font-weight: bold;">&#91;</span>Enter<span style="color: #7a0874; font-weight: bold;">&#93;</span>
<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #c20cb9; font-weight: bold;">bash</span>$<span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #c20cb9; font-weight: bold;">vi</span> menu.lst <span style="color: #7a0874; font-weight: bold;">&#91;</span>Enter<span style="color: #7a0874; font-weight: bold;">&#93;</span></pre></td></tr></table></div>

<p>Now in this file you can see a line beginning with the word &#8216;password&#8217; remove this line and save the file.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #c20cb9; font-weight: bold;">bash</span>$<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">exit</span>
<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #c20cb9; font-weight: bold;">bash</span>$<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">exit</span></pre></td></tr></table></div>

<p>Now system will be rebooted and you can see the grub without a password. Don&#8217;t forget to remove the CD.</p>
<p>Press &#8216;e&#8217; at boot screen and again by taking the pointer to the second line press e. Now you can see yourself on a command prompt. Remove &#8216;rhgb quiet&#8217; from there and write single and press enter.</p>
<p>Now you will come back to the boot screen. Press &#8216;b&#8217; and system will appear to boot and leave you in command line interface like this.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">-bash2-$</pre></div></div>

<p>Just type passwd like this</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">-bash2-$ <span style="color: #c20cb9; font-weight: bold;">passwd</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>Enter<span style="color: #7a0874; font-weight: bold;">&#93;</span>
new password:
retype new password:
<span style="color: #c20cb9; font-weight: bold;">passwd</span>: All authentication updated successfully.</pre></td></tr></table></div>

<p>Now you have set a new password. Now exit from the shell and system will boot properly in graphical interface.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">-bash2-$ <span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>Enter<span style="color: #7a0874; font-weight: bold;">&#93;</span></pre></div></div>

<p>If there is any error in the procedure please post your suggestions.</p>
<p><a href="http://gofedora.com/">Fedora Tutorials</a> and <a href="http://cachevideos.com/">Videocache</a> by <a href="http://saini.co.in/">Kulbir Saini</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://gofedora.com/how-to-recover-crack-root-password-grub-locked/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
	</channel>
</rss>

