<?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>Root777 &#187; Unix / Linux</title>
	<atom:link href="http://www.root777.com/category/unix-linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.root777.com</link>
	<description>Computer Security &#38; Technology</description>
	<lastBuildDate>Tue, 27 Jul 2010 02:25:48 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
<image>
  <link>http://www.root777.com</link>
  <url>http://www.root777.com/favicon.ico</url>
  <title>Root777</title>
</image>
		<item>
		<title>The Great Zero Challenge</title>
		<link>http://www.root777.com/unix-linux/the-great-zero-challenge/</link>
		<comments>http://www.root777.com/unix-linux/the-great-zero-challenge/#comments</comments>
		<pubDate>Sun, 07 Sep 2008 13:25:14 +0000</pubDate>
		<dc:creator>Ajit Gaddam</dc:creator>
				<category><![CDATA[Unix / Linux]]></category>
		<category><![CDATA[challenge]]></category>
		<category><![CDATA[data recovery]]></category>
		<category><![CDATA[dd]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://www.root777.com/?p=30</guid>
		<description><![CDATA[The Great Zero Challenge: A challenge to confirm whether or not a professional data recovery firm or any individual(s) or organization(s) can recover data from a hard drive that has been overwritten with zeros once. All they used is the Unix dd command using /dev/zero as input to overwrite the drive. They are doing this [...]]]></description>
			<content:encoded><![CDATA[<p></p><p><strong>The Great Zero Challenge</strong>: A <a title="Great zero challenge" href="http://16systems.com/zero/index.html" target="_blank">challenge</a> to confirm whether or not a professional data recovery firm or any individual(s) or organization(s) can recover data from a hard drive that has been overwritten with zeros once. All they used is the Unix <strong>dd</strong> command using <strong>/dev/zero</strong> as input to overwrite the drive.</p>
<p>They are doing this because many people believe that in order to permanently delete data from a modern hard drive that multiple overwrites with random data, mechanical grinding, degaussing and incinerating must be used and even physically destroy them just to be extra safe.</p>
<p>As far as challenges go, this is one that many will pass, because no data recovery firm claims to be able to do zero recovery other than those with access to electron microscopy tools.</p>
<p>Many professional recovery firms for most part use tools that scan through the partition and file table area and perhaps even the entire disk to locate data that has either been marked erased or had references removed (for a full disk scan) and then restoring it. Perhaps they&#8217;ll also move the spindle from a dead drive into a new case to complete the operation, but I doubt there are many companies that will actually do electron force microscopy for you and even fewer that will do it at anything other than an astronomical fee.</p>
<p><span id="more-30"></span>My opinion is that the recovery business is a focus around confidence that a professional will be doing the recovery and that you or your employees won&#8217;t worsen the situation. In the event that a drive with critical data fails and you don&#8217;t have a backup, who wants to be the person responsible for damaging the disk during recovery?</p>
<p>Anyway, this whole debate should be moot by now. If you want to secure your drive use full disk encryption (now freely available in <a title="Truecrypt, free full disk encryption" href="http://www.truecrypt.org/" target="_blank">TrueCrypt</a>) and when it comes to destroying the data just overwrite the header area a thousand times with random garbage. It will take only a second or two, and the whole drive will be useless to anyone. Oh, while you are at it, why not use the <a title="dd" href="http://http//en.wikipedia.org/wiki/Dd_(Unix)" target="_blank">dd command</a> these guys used.</p>
<p>Of course it would also be nice if more manufacturers were producing encrypted disks as standard with verified schemes so that we wouldn&#8217;t have to do encryption in software.</p>
<p>The Great Zero Challenge: <a href="http://16systems.com/zero/index.html">http://16systems.com/zero/index.html</a></p>
<img src="http://www.root777.com/?ak_action=api_record_view&id=30&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.root777.com/unix-linux/the-great-zero-challenge/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Bastille Linux</title>
		<link>http://www.root777.com/unix-linux/bastille-linux/</link>
		<comments>http://www.root777.com/unix-linux/bastille-linux/#comments</comments>
		<pubDate>Tue, 05 Feb 2008 01:22:20 +0000</pubDate>
		<dc:creator>Ajit Gaddam</dc:creator>
				<category><![CDATA[Unix / Linux]]></category>
		<category><![CDATA[bastille linux]]></category>
		<category><![CDATA[Computer Security]]></category>
		<category><![CDATA[unix security]]></category>

		<guid isPermaLink="false">http://www.root777.com/unix-linux/bastille-linux/</guid>
		<description><![CDATA[Besides manual security hardening of a Linux OS, let’s check out a free open-source tool to automate and simplify the process. Bastille will disable unnecessary services and install operating system updates as well as configure a firewall, enforce password policies, create a second root-level account and more. What’s nice is that Bastille leads the user [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>Besides manual security hardening of a Linux OS, let’s check out a free open-source tool to automate and simplify the process. Bastille will disable unnecessary services and install operating system updates as well as configure a firewall, enforce password policies, create a second root-level account and more. What’s nice is that Bastille leads the user through a simple series of yes/no questions, giving a detailed explanation of why each question is asked and what will happen if ‘yes’ is chosen. It doesn’t merely expect guesswork, nor does it blindly alter your system – instead, it genuinely hardens your computer and educates on security in the process.</p>
<p>The good thing is that you’re also not locked in to Bastille’s changes should you decide some of the setting changes weren’t for you. Running RevertBastille automatically restores the state of all config files and settings to just how they were before Bastille made any changes. Obviously, if you make changes to your system manually after running Bastille, you will lose these too so it is best to test changes as soon as possible after applying to ensure you won’t harm anything else if you need to revert.</p>
<p>Unfortunately, Bastille is not for everyone: versions exist for Red Hat, SUSE, Debian, Gentoo and Mandrake (as well as non-Linux UNIX variants HP-UX and MacOS X). If you do run one of those systems, you really are well-advised to run Bastille. You can download the latest version from <a href="http://bastille-linux.sourceforge.net/running_bastille_on.htm" title="download bastille" target="_blank">SourceForge.<br />
</a><br />
Let&#8217;s give Bastille a run-through.<br />
<span id="more-20"></span>Launch Bastille by calling up a terminal prompt as root and executing <em>./InteractiveBastille</em>. You are lead through a series of security steps, as follows.</p>
<p>1.  Apply a firewall to prevent access to potentially vulnerable services, using iptables. This is a big topic which could not be adequately covered here. Fortunately, Bastille’s explanations do an admirable job. In one sense, this is redundant; if the service has been disabled as we discussed above, there won’t be anything listening on the port which can be exploited. However, you might later restore a service for testing or for internal use. Or it may be restored inadvertently. Whatever the reason, Bastille errs on the side of tougher security by protecting your system from the same exploits via more than one method.</p>
<p>Retrieve and apply available operating system patches, as discussed above.</p>
<p>2. Audit the system tools which have the SUID flag set and which run as the superuser, even for ordinary users. The danger of SUID apps is they perform actions with full superuser powers no matter who executes them. This is essential in some cases: for instance, if the passwd command couldn’t write back to the shadowed password file then nobody could actually change their password. However, you may not want ordinary users running the dump and restore commands, both of which come with SUID status out-of-the-box.</p>
<p>3. Tighten up account security. Here, Bastille first asks to create a second account with root-level access. This means you can disable root if desired, or at the very least if you exclusively use the second account, you can tell if someone else is trying to log in as root because you know it won’t be you. This section of Bastille also prompts to enforce password aging and some other items like assigning a restricted or useless shell to non-user accounts. There’s wisdom in this last point.</p>
<p>4. Enhance boot security. This helps restrict the computer even if someone can get physical access to it and try starting it up in single-user mode.</p>
<p>5. Deactivate or restrict unnecessary services, as discussed above.<br />
From this point, the remaining modules are less significant (though still beneficial) and include disabling program compilation, limiting system usage, increasing logging, installing SSH, tightening up DNS and Apache, disabling printing and a couple of other things.</p>
<p>Bastille now exits, but has not yet made any changes. All your choices have been saved to a configuration file. Run ./BackEnd.pl to actually enforce them. Reboot and test out your hardened server. Any malicious attackers will find far less vulnerabilities and options against your computer.</p>
<p>Security is something we all need to take seriously. Many people may not even be aware that they have possible insecurities. Fortunately, the above steps are easy to understand and simple to implement.</p>
<p>[source: http://www.itwire.com/index2.php?option=com_content&amp;do_pdf=1&amp;id=13976]</p>
<img src="http://www.root777.com/?ak_action=api_record_view&id=20&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.root777.com/unix-linux/bastille-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Remove Duplicates from a List</title>
		<link>http://www.root777.com/unix-linux/how-to-remove-duplicates-from-a-list/</link>
		<comments>http://www.root777.com/unix-linux/how-to-remove-duplicates-from-a-list/#comments</comments>
		<pubDate>Tue, 29 Jan 2008 00:28:26 +0000</pubDate>
		<dc:creator>Ajit Gaddam</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[Unix / Linux]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[tricks]]></category>

		<guid isPermaLink="false">http://www.root777.com/unix-linux/how-to-remove-duplicates-from-a-list/</guid>
		<description><![CDATA[Sometimes when running through a CSV or any kind of a log file, you may encounter lists with a lot of duplicates. I will show an example of the simplest order here. Say, you have a duplicates.txt that goes one two three one four two four Now, how to remove duplicates from a list such [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>Sometimes when running through a CSV or any kind of a log file, you may encounter lists with a lot of duplicates. I will show an example of the simplest order here.</p>
<p>Say, you have a duplicates.txt that goes</p>
<p><font color="#808080">one<br />
two<br />
three<br />
one<br />
four<br />
two<br />
four</font></p>
<p>Now, how to remove duplicates from a list such as the one shown above. If you use a command such as</p>
<p><strong>sort &#8211; u &lt; duplicates.txt or cat duplicates.txt | sort | uniq</strong></p>
<p>you may end up with a list that while stripping out the duplicates, does not keep the original order</p>
<p><span id="more-17"></span><font color="#808080">four<br />
two<br />
three<br />
one</font></p>
<p>Now, there is a way where you can remove duplicates from a list&#8230; but still keep the original order.</p>
<p><strong>nl duplicates.txt | sort -k2 -u | sort -n | cut -f2-</strong></p>
<p>Step 1. First number the entries in the duplicates.txt using <strong>nl</strong></p>
<p><strong>nl duplicates.txt</strong></p>
<p>This will give you the list:</p>
<p><font color="#808080">1  one<br />
2  two<br />
3  three<br />
4  one<br />
5  four<br />
6  two<br />
7  four</font></p>
<p>Step 2. We now need to sort the list</p>
<p><strong>nl duplicates.txt | sort -k2</strong></p>
<p><font color="#808080">7  four<br />
5  four<br />
1  one<br />
4  one<br />
3  three<br />
2  two<br />
6  two</font></p>
<p>Step 3. Now, we need to remove the lines with duplicate fields:</p>
<p><strong>nl duplicates.txt | sort -k2 -u</strong></p>
<p><font color="#808080">7  four<br />
1  one<br />
3  three<br />
2  two</font></p>
<p>Step 4. Restore the original order:</p>
<p><strong>nl duplicates.txt | sort -k2 -u | sort -n</strong></p>
<p><font color="#808080">1  one<br />
2  two<br />
3  three<br />
7  four</font></p>
<p>Step 5. Remove the numbering we inserted in Step 1</p>
<p><strong>nl duplicates.txt | sort -k2 -u | sort -n | cut -f2-</strong></p>
<p><font color="#808080">one<br />
two<br />
three<br />
four</font></p>
<img src="http://www.root777.com/?ak_action=api_record_view&id=17&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.root777.com/unix-linux/how-to-remove-duplicates-from-a-list/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Unix Shell for Windows</title>
		<link>http://www.root777.com/unix-linux/unix-shell-for-windows/</link>
		<comments>http://www.root777.com/unix-linux/unix-shell-for-windows/#comments</comments>
		<pubDate>Sat, 19 Jan 2008 22:29:01 +0000</pubDate>
		<dc:creator>Ajit Gaddam</dc:creator>
				<category><![CDATA[Unix / Linux]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://www.root777.com/unix/unix-shell-for-windows/</guid>
		<description><![CDATA[A lot of us who use Linux at work/school or have always grown up using Unix commands and using the Unix shell for years and more often than not, there are instances where a ls command comes more naturally than the dir command at the command prompt when using Windows. For the most part, a [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>A lot of us who use Linux at work/school or have always grown up using Unix commands and using the Unix shell for years and more often than not, there are instances where a ls command comes more naturally than the dir command at the command prompt when using Windows.</p>
<p>For the most part, a lot of us work around this drawback using the excellent tool: Cygwin. Cygwin is available for windows users <a href="http://cygwin.com/setup.exe" target="_blank" title="download cygwin">here</a>.The Cygwin tools are ports of the popular GNU development tools for Microsoft Windows. They run thanks to the Cygwin library which provides the UNIX system calls and environment these programs expect.</p>
<p>With these tools installed, it is possible to write Win32 console or GUI applications that make use of the standard Microsoft Win32 API and/or the Cygwin API. As a result, it is possible to easily port many significant Unix programs without the need for extensive changes to the source code. This includes configuring and building most of the available GNU software . Even if the development tools are of little to no use to you, you may have interest in the many standard Unix utilities provided with the package. They can be used both from the bash shell (provided) or from the standard Windows command shell.</p>
<p>While Cygwin would be an obvious choice for many Unix/Linux power users, there is an excellent and a much simpler alternative to using Cygwin. In this article, I will show you how to run your Unix commands right in the windows command prompt.</p>
<p><span id="more-16"></span></p>
<p>For this, we will be using CoreUtils. CoreUtils is a collection of basic file, shell and text manipulation utilities of the GNU operating system. These are the core utilities which are expected to exist on every OS. And when I talk about File utilities, they include chgrp, chmod, cp, dd, du, ln, ls, mkdir, mv, rm, touch, vdir among others. A sample of the text utilities include cat, cksum, cut, join, md5sum, shasum, sort, split etc. The shell root commands include echo, chroot, hostname, nice, pathchk, tty, who, whoami and yes su. So it is pretty much the whole nine yards here&#8230; The direct link for download of the CoreUtils package available through <a href="http://prdownloads.sourceforge.net/gnuwin32/coreutils-5.3.0.exe?download" target="_blank" title="CoreUtils v 5.3 download">SourceForge is available here</a>.</p>
<p>Once installed, you will need to add the path to the utilities to your PATH environment variable. Follow the steps below to achieve your Unix Shell for Windows</p>
<p>1. Click on Start &#8211;&gt; Run and enter <strong>sysdm.cpl</strong> to bring up the system properties Dialog</p>
<p>2. Click on the Advanced tab &#8211;&gt; Environment variables button</p>
<p><img src="http://farm3.static.flickr.com/2319/2204891196_a8ee9e9121_o.png" alt="System Properties Environment Variable" align="absmiddle" height="481" width="414" /></p>
<p>3. In the System Variables pane, scroll down to Path and then click on edit.</p>
<p>4. Under Edit System Variable, in the variable value, at the <strong>end of the line</strong> , type the following including the semicolon which separates the individual elements in the path variable. ;C:\Program Files\GnuWin32\bin</p>
<p><img src="http://static.flickr.com/113/283236090_6d351fee37.jpg" alt="env variable properties" title="env variable properties" align="middle" /></p>
<p>Congratulations !! You have now added the GNUWin directory to your path and Unix commands can now be executed directly from the command line and run natively on the Win32 command prompt without the need for any emulation layer as shown below using the example of dir vs ls</p>
<p><img src="http://farm3.static.flickr.com/2035/2204891198_0fc0f0baa3.jpg" alt="unix shell for Windows" align="absmiddle" height="410" width="500" /></p>
<p>Downloads and Sources</p>
<p>1. Download <a href="http://www.cygwin.com/setup.exe" target="_blank">CYGWIN</a></p>
<p>2. Download <a href="http://prdownloads.sourceforge.net/gnuwin32/coreutils-5.3.0.exe?download" target="_blank">CoreUtils</a></p>
<img src="http://www.root777.com/?ak_action=api_record_view&id=16&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.root777.com/unix-linux/unix-shell-for-windows/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.488 seconds -->
