<?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>Bohack &#187; Linux</title>
	<atom:link href="http://www.bohack.com/tag/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.bohack.com</link>
	<description>Check In and Tune Out!</description>
	<lastBuildDate>Sun, 08 Jan 2012 20:59:56 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>Mac OS X Permissions Problems with Window Server 2003 R2</title>
		<link>http://www.bohack.com/2009/12/mac-os-x-permissions-problems-with-window-server-2003-r2/</link>
		<comments>http://www.bohack.com/2009/12/mac-os-x-permissions-problems-with-window-server-2003-r2/#comments</comments>
		<pubDate>Wed, 09 Dec 2009 03:11:34 +0000</pubDate>
		<dc:creator>Bohack</dc:creator>
				<category><![CDATA[Windows]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[OSX]]></category>

		<guid isPermaLink="false">http://www.bohack.com/?p=336</guid>
		<description><![CDATA[A user on a Mac OS X client with not be able to drag files into the folder or perform a copy procedure and will result in the error: "You may need to enter the name and password for an administrator on this computer to change the item name "item-name".".<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://www.bohack.com/2009/12/mac-os-x-permissions-problems-with-window-server-2003-r2/' addthis:title='Mac OS X Permissions Problems with Window Server 2003 R2 ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></description>
			<content:encoded><![CDATA[<p>Recently I found a problem when using Mac OS X and Windows Server 2003 R2 as a file server. The problem exists in the permissions that are applied to user folders. When applying permissions to shares you normally start out with a very restrictive permission structure at the top. As you create the folders you add permissions for users and groups to permit and restrict access for others. This structure of permissions is very common in dealing with corporate shares. We also share the folder with ‘domain users’ only having change or modify access to the entire share. This eliminates people applying their own permissions and locking everyone out including themselves. This is a common task for a network admin in setting up permissions.<br />
<span id="more-336"></span><br />
We have a Windows Server 2003 R2 file server with a directory called ‘Drives’ this directory is shared with ‘Domain Admins’ and ‘System’ Full Control and ‘Domain Users’ Change Control. Under this directory the permissions are structures as follows at the NTFS level. Domain Users have Read permissions only to the folder and does not inherit down to other folders. This allows a Domain User to read the directory names, but not access the contents in each of the folders. Each folder at this level is names according to the user that owns the content. On these folders we add the domain user’s username with Change control and we allow the permissions to inherit to all child folders and file below.</p>
<p>The problem exists when you use a script to create the folders and apply the permissions using the cacls.exe command on a Windows 2003 R2 server. A user on a Mac OS X client with not be able to drag files into the folder on a Windows 2003 R2 server share or perform a copy procedure and will result in the error: <strong>&#8220;You may need to enter the name and password for an administrator on this computer to change the item name &#8220;item-name&#8221;</strong>.&#8221;. You may also see the exclamation error if the file has a preview fork attached of <strong>&#8220;Couldn&#8217;t open the file. It may be corrupt or a file format that Preview doesn&#8217;t recognize.&#8221;</strong>. After much reading on this problem I was almost convinced that it was an OS X bug, but I realize now it is actually a flaw in the cacls command. We use a script similar to the snippet of code below to create the directories.</p>
<pre>mkdir \\server\share\userdir
cacls \\server\share\userdir /e /t /g userdir:c

explanation:

cacls {file or folder} /e {edits} /t {changes on all sub directories} /g {grants} userdir:c {user:permission of change}</pre>
<p>The problem was solved using the command that was introduced in Vista and Server 2003 R2 called icacls.exe. The icacls tool is now included in Windows Server Service Pack 2 and is standard in Vista. This command allows you to set inheritance, which is the root cause of the problem. The inheritance properties were first introduced in NTFS 5.0 with Windows 2000, however something has changed recently in the OS X 10.5 software or Windows Server 2003 R2. The problem also exists in Windows Server 2008 and Windows Server 2008 R2 so the problem is not going away and I am guessing it is OSX at fault.</p>
<p>When setting a directory with the code above, if you use the icacls command to export the permissions structure out to a file you can see the problem. This will export the security into Microsoft’s SDDL language which is documented here http://msdn.microsoft.com/en-us/library/aa379567(VS.85).aspx.</p>
<pre>icacls.exe \\server\share\userdir /save aclfile.txt

notepad.exe aclfile.txt

D:(A;OICI;0x1301bf;;;S-1-5-21-123456789-123456789-123456789-12345) (A;OICIID;FA;;;DA)(A;OICIID;FA;;;SY)
(user:chage) (domain admin:full) (system:full)</pre>
<p>The problem is not is not evident until we set the permission properly with the icacls.exe command.</p>
<pre>icacls \\server\share\userdir /t /c /grant userdir:(OI)(CI)M

explanation:

icacls {file or folder} /t {changes on all sub directories} /grant {grants} userdir:(OI)(CI) {see below}M { change/modify }

CI CONTAINER INHERIT
OI OBJECT INHERIT
NP NO PROPAGATE INHERIT
IO INHERIT ONLY
ID INHERITED
SA SUCCESSFUL ACCESS FLAG
FA FAILED ACCESS FLAG

Complete list http://msdn.microsoft.com/en-us/library/aa374928(VS.85).aspx

D:AI(A;OICI;0x1301bf;;;S-1-5-21-123456789-123456789-123456789-12345) (A;OICIID;FA;;;DA)(A;OICIID;FA;;;SY)

Explanation:

D: - Defines the DACL
AI - is the MISSING Auto Inheritance Flag
(A;OICI;0x1301bf;;;S-1-5-21-123456789-123456789-123456789-12345) - is the user’s SID and permissions
(A;OICIID;FA;;;DA) - is the “Domain Admin” permissions identified by the trailing DA
(A;OICIID;FA;;;SY) - is the “System” permissions identified by the trailing SY</pre>
<p>The AI in the DACL or Discretionary Access Control List is missing when using the cacls command. My guess is that the client when using Windows is responsible for the completion and writing of the DACL. When a Mac OS X client copies a file they utilize SAMBA which does not carry the DACL and consequentially fails. This would explain the empty file that gets created when an OS X client drags and drops the file. The file entry gets created, but is inherited with only the original permissions that have inheritance from above. This same problem could also exist on Linux or UNIX using SAMBA since it is SAMBA that drops the ball.</p>
<p>The Fix:</p>
<p>Use ‘icacls \\server\share\userdir /t /c /grant username:(OI)(CI)M’ to grant access to NTFS folders and replace all entries in scripts using the cacls command.</p>
<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://www.bohack.com/2009/12/mac-os-x-permissions-problems-with-window-server-2003-r2/' addthis:title='Mac OS X Permissions Problems with Window Server 2003 R2 ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></content:encoded>
			<wfw:commentRss>http://www.bohack.com/2009/12/mac-os-x-permissions-problems-with-window-server-2003-r2/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Clean Debian Etch Install</title>
		<link>http://www.bohack.com/2008/11/clean-debian-etch-install/</link>
		<comments>http://www.bohack.com/2008/11/clean-debian-etch-install/#comments</comments>
		<pubDate>Sat, 08 Nov 2008 02:15:52 +0000</pubDate>
		<dc:creator>Bohack</dc:creator>
				<category><![CDATA[Linux / Unix]]></category>
		<category><![CDATA[Etch]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.bohack.com/?p=67</guid>
		<description><![CDATA[My first Linux install was actually a BSD install of OpenBSD and I was quite impressed that nothing was installed except for the operating system. I am now minimalist and when installing operating systems this principal works to my advantage. The ideology is: you only install what is needed and nothing more, thus reducing the [...]<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://www.bohack.com/2008/11/clean-debian-etch-install/' addthis:title='Clean Debian Etch Install ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></description>
			<content:encoded><![CDATA[<p>My first Linux install was actually a BSD install of OpenBSD and I was quite impressed that nothing was installed except for the operating system. I am now minimalist and when installing operating systems this principal works to my advantage. The ideology is: you only install what is needed and nothing more, thus reducing the surface of attack and lowering wasted process time. So I have put a guide together that was inspired by the Linux how to for â€œThe Perfect Setup â€“ Debian Etchâ€. This guide was created with screenshots from VMware.<span id="more-67"></span></p>
<ol>
<li>Download the latest current build from the Debian website http://www.debian.org/distrib/. Youâ€™ll only need to download and burn the first ISO for CD1, since all the other CDs contain packages that can be downloaded via the â€˜apt-getâ€™ command.</li>
<li>Insert the CD and set your BIOS or â€˜first bootâ€™ menu to boot from CD. As the CD spins up you will be brought to a prompt with the Debian logo. Debian Etch defaults to install the Linux 2.6 kernel so just hit enter.</li>
<a href="http://www.bohack.com/wp-content/uploads/2008/11/debian-fig-2.gif"  rel="lightbox[67]"  class="lightbox"><img src="http://www.bohack.com/wp-content/uploads/2008/11/debian-fig-2.gif" alt="Debian Boot Screen" title="debian-fig-2" width="652" height="367" class="alignnone size-full wp-image-68" /></a>
<li>The â€˜Choose languageâ€™ screen will appear, select â€˜Englishâ€™ or your preferred language.</li>
<a href="http://www.bohack.com/wp-content/uploads/2008/11/debian-fig-3.gif"  rel="lightbox[67]"  class="lightbox"><img src="http://www.bohack.com/wp-content/uploads/2008/11/debian-fig-3.gif" alt="Choose the language Dialog" title="debian-fig-3" width="635" height="480" class="alignnone size-full wp-image-70" /></a>
<li>The â€˜Choose country or regionâ€™ screen will appear, select â€˜United Statesâ€™ or your preferred country.</li>
<a href="http://www.bohack.com/wp-content/uploads/2008/11/debian-fig-4.gif"  rel="lightbox[67]"  class="lightbox"><img src="http://www.bohack.com/wp-content/uploads/2008/11/debian-fig-4.gif" alt="Choose Country or Region Dialog" title="debian-fig-4" width="638" height="480" class="alignnone size-full wp-image-73" /></a>
<li>The â€˜Select a keyboard layoutâ€™ screen will appear, select â€˜American Englishâ€™ or your preferred layout.</li>
<a href="http://www.bohack.com/wp-content/uploads/2008/11/debian-fig-5.gif"  rel="lightbox[67]"  class="lightbox"><img src="http://www.bohack.com/wp-content/uploads/2008/11/debian-fig-5.gif" alt="Select the Keyboard Layout Dialog" title="debian-fig-5" width="636" height="477" class="alignnone size-full wp-image-74" /></a>
<li>The pre-installer will start to scan your hardware, scan the packages available on the CDROM, load the components of the Debian installer, then detect and configure the network with DHCP if detected.</li>
<a href="http://www.bohack.com/wp-content/uploads/2008/11/debian-fig-6.gif"  rel="lightbox[67]"  class="lightbox"><img src="http://www.bohack.com/wp-content/uploads/2008/11/debian-fig-6.gif" alt="Pre-Installer Dialog" title="debian-fig-6" width="637" height="479" class="alignnone size-full wp-image-75" /></a>
<li>You be prompted at the â€˜Configure the networkâ€™ screen, were you will be asked to select a hostname for your system.</li>
<a href="http://www.bohack.com/wp-content/uploads/2008/11/debian-fig-7.gif"  rel="lightbox[67]"  class="lightbox"><img src="http://www.bohack.com/wp-content/uploads/2008/11/debian-fig-7.gif" alt="Configure the Hostname Dialog" title="debian-fig-7" width="637" height="480" class="alignnone size-full wp-image-77" /></a>
<li>Then you&#8217;ll be prompted with the â€˜Domain nameâ€™ prompt, were you will select your domain name for your system.</li>
<a href="http://www.bohack.com/wp-content/uploads/2008/11/debian-fig-8.gif"  rel="lightbox[67]"  class="lightbox"><img src="http://www.bohack.com/wp-content/uploads/2008/11/debian-fig-8.gif" alt="Domain Name Dialog" title="debian-fig-8" width="639" height="479" class="alignnone size-full wp-image-78" /></a>
<li>The installer will detect all disks and start the partition utility. It is preferable to select the &#8216;Erase entire disk&#8217;.</li>
<a href="http://www.bohack.com/wp-content/uploads/2008/11/debian-fig-9.gif"  rel="lightbox[67]"  class="lightbox"><img src="http://www.bohack.com/wp-content/uploads/2008/11/debian-fig-9.gif" alt="Auto Partition Dialog" title="debian-fig-9" width="639" height="477" class="alignnone size-full wp-image-79" /></a>
<li>The next prompt will ask you for a partitioning scheme, again it is preferable to select the default of â€˜All files in one partitionâ€™.</li>
<a href="http://www.bohack.com/wp-content/uploads/2008/11/debian-fig-10.gif"  rel="lightbox[67]"  class="lightbox"><img src="http://www.bohack.com/wp-content/uploads/2008/11/debian-fig-10.gif" alt="Partitioning Scheme Dialog" title="debian-fig-10" width="635" height="476" class="alignnone size-full wp-image-82" /></a>
<li>You will then have a chance to confirm your selection and â€˜Finish partitioning and write the changes to diskâ€™.</li>
<a href="http://www.bohack.com/wp-content/uploads/2008/11/debian-fig-11.gif"  rel="lightbox[67]"  class="lightbox"><img src="http://www.bohack.com/wp-content/uploads/2008/11/debian-fig-11.gif" alt="Confirm Partitioning Scheme" title="debian-fig-11" width="634" height="477" class="alignnone size-full wp-image-85" /></a>
<li>Youâ€™ll be prompted again to write the changes, select â€˜Yesâ€™ the default is â€˜Noâ€™.</li>
<a href="http://www.bohack.com/wp-content/uploads/2008/11/debian-fig-12.gif"  rel="lightbox[67]"  class="lightbox"><img src="http://www.bohack.com/wp-content/uploads/2008/11/debian-fig-12.gif" alt="Final Prompt to Write Changes" title="debian-fig-12" width="640" height="480" class="alignnone size-full wp-image-86" /></a>
<li>The installer will ask for your time zone, enter the desired time zone.</li>
<a href="http://www.bohack.com/wp-content/uploads/2008/11/debian-fig-13.gif"  rel="lightbox[67]"  class="lightbox"><img src="http://www.bohack.com/wp-content/uploads/2008/11/debian-fig-13.gif" alt="Time Zone Configuration Dialog" title="debian-fig-13" width="638" height="478" class="alignnone size-full wp-image-87" /></a>
<li>The installer will ask for the rootâ€™s password (privileged user account).</li>
<a href="http://www.bohack.com/wp-content/uploads/2008/11/debian-fig-14.gif"  rel="lightbox[67]"  class="lightbox"><img src="http://www.bohack.com/wp-content/uploads/2008/11/debian-fig-14.gif" alt="Root Password Dialog" title="debian-fig-14" width="639" height="480" class="alignnone size-full wp-image-88" /></a>
<li>You will need to type the password again for confirmation.</li>
<a href="http://www.bohack.com/wp-content/uploads/2008/11/debian-fig-15.gif"  rel="lightbox[67]"  class="lightbox"><img src="http://www.bohack.com/wp-content/uploads/2008/11/debian-fig-15.gif" alt="Root Password Confirmation" title="debian-fig-15" width="639" height="481" class="alignnone size-full wp-image-89" /></a>
<li>You will also be required to create an initial user (non-privileged user account) account.</li>
<a href="http://www.bohack.com/wp-content/uploads/2008/11/debian-fig-16.gif"  rel="lightbox[67]"  class="lightbox"><img src="http://www.bohack.com/wp-content/uploads/2008/11/debian-fig-16.gif" alt="Non-Root Account Dialog" title="debian-fig-16" width="639" height="479" class="alignnone size-full wp-image-92" /></a>
<li>You will need to supply a login name for the account.</li>
<a href="http://www.bohack.com/wp-content/uploads/2008/11/debian-fig-17.gif"  rel="lightbox[67]"  class="lightbox"><img src="http://www.bohack.com/wp-content/uploads/2008/11/debian-fig-17.gif" alt="Login Name Dialog" title="debian-fig-17" width="637" height="478" class="alignnone size-full wp-image-93" /></a>
<li>Set the password for this user and confirm it like the previous account.</li>
<a href="http://www.bohack.com/wp-content/uploads/2008/11/debian-fig-18.gif"  rel="lightbox[67]"  class="lightbox"><img src="http://www.bohack.com/wp-content/uploads/2008/11/debian-fig-18.gif" alt="Non-Root Password Dialog" title="debian-fig-18" width="639" height="479" class="alignnone size-full wp-image-95" /></a>
<li>The system installer will begin installing the entire system now.</li>
<a href="http://www.bohack.com/wp-content/uploads/2008/11/debian-fig-19.gif"  rel="lightbox[67]"  class="lightbox"><img src="http://www.bohack.com/wp-content/uploads/2008/11/debian-fig-19.gif" alt="System Installation Dialog" title="debian-fig-19" width="639" height="479" class="alignnone size-full wp-image-96" /></a>
<li>The package manager will now require configuration, select â€˜Yesâ€™ for a mirror.</li>
<a href="http://www.bohack.com/wp-content/uploads/2008/11/debian-fig-20.gif"  rel="lightbox[67]"  class="lightbox"><img src="http://www.bohack.com/wp-content/uploads/2008/11/debian-fig-20.gif" alt="Select a Mirror Dialog" title="debian-fig-20" width="638" height="478" class="alignnone size-full wp-image-98" /></a>
<li>Choose â€˜United Statesâ€™ for the mirrorâ€™s country or your country.</li>
<a href="http://www.bohack.com/wp-content/uploads/2008/11/debian-fig-21.gif"  rel="lightbox[67]"  class="lightbox"><img src="http://www.bohack.com/wp-content/uploads/2008/11/debian-fig-21.gif" alt="Mirror Country Dialog" title="debian-fig-21" width="640" height="480" class="alignnone size-full wp-image-99" /></a>
<li>Choose â€˜ftp.us.debian.orgâ€™ or the first mirror that appears for you prior selection.</li>
<a href="http://www.bohack.com/wp-content/uploads/2008/11/debian-fig-22.gif"  rel="lightbox[67]"  class="lightbox"><img src="http://www.bohack.com/wp-content/uploads/2008/11/debian-fig-22.gif" alt="Select Mirror Dialog" title="debian-fig-22" width="640" height="480" class="alignnone size-full wp-image-100" /></a>
<li>Select â€˜Enterâ€™ if you are not using a proxy.</li>
<a href="http://www.bohack.com/wp-content/uploads/2008/11/debian-fig-23.gif"  rel="lightbox[67]"  class="lightbox"><img src="http://www.bohack.com/wp-content/uploads/2008/11/debian-fig-23.gif" alt="Select Proxy Dialog" title="debian-fig-23" width="638" height="480" class="alignnone size-full wp-image-102" /></a>
<li>The developers ask that you participate in a feedback survey, for this how-to we will answer â€˜Noâ€™.</li>
<a href="http://www.bohack.com/wp-content/uploads/2008/11/debian-fig-24.gif"  rel="lightbox[67]"  class="lightbox"><img src="http://www.bohack.com/wp-content/uploads/2008/11/debian-fig-24.gif" alt="Feedback Survey Dialog" title="debian-fig-24" width="639" height="479" class="alignnone size-full wp-image-103" /></a>
<li>Unselect all software using the spacebar and arrow keys and select â€˜Continueâ€™.</li>
<a href="http://www.bohack.com/wp-content/uploads/2008/11/debian-fig-25.gif"  rel="lightbox[67]"  class="lightbox"><img src="http://www.bohack.com/wp-content/uploads/2008/11/debian-fig-25.gif" alt="Select Software to Install Dialog" title="debian-fig-25" width="640" height="480" class="alignnone size-full wp-image-104" /></a>
<li>Answer â€˜Yesâ€™ to the Grub loader screen, this will install the boot manager of Grub on the system; this is used for emergency purposes.</li>
<a href="http://www.bohack.com/wp-content/uploads/2008/11/debian-fig-26.gif"  rel="lightbox[67]"  class="lightbox"><img src="http://www.bohack.com/wp-content/uploads/2008/11/debian-fig-26.gif" alt="Grub Install Dialog" title="debian-fig-26" width="638" height="478" class="alignnone size-full wp-image-106" /></a>
<li>Finish the install by selecting â€™Continueâ€™.</li>
<a href="http://www.bohack.com/wp-content/uploads/2008/11/debian-fig-27.gif"  rel="lightbox[67]"  class="lightbox"><img src="http://www.bohack.com/wp-content/uploads/2008/11/debian-fig-27.gif" alt="Finish the Install Dialog" title="debian-fig-27" width="639" height="479" class="alignnone size-full wp-image-107" /></a>
<li>You will reboot and see the Grub boot loader.</li>
<a href="http://www.bohack.com/wp-content/uploads/2008/11/debian-fig-28.gif"  rel="lightbox[67]"  class="lightbox"><img src="http://www.bohack.com/wp-content/uploads/2008/11/debian-fig-28.gif" alt="Grub Boot Screen" title="debian-fig-28" width="724" height="402" class="alignnone size-full wp-image-108" /></a>
<li>You can now login as â€˜rootâ€™ with the password you supplied for â€˜rootâ€™.</li>
<p><a href="http://www.bohack.com/wp-content/uploads/2008/11/debian-fig-29.gif"  rel="lightbox[67]"  class="lightbox"><img src="http://www.bohack.com/wp-content/uploads/2008/11/debian-fig-29.gif" alt="Initial Login" title="debian-fig-29" width="644" height="434" class="alignnone size-full wp-image-109" /></a><br />
Now that we have an installed and running system we need to tweak a few settings. The network was installed and DHCP had been automatically configured, however since this will be a server DHCP is not the right choice; we will need to manually configure an IP address.</p>
<li>Edit &#8216;/etc/network/interfaces&#8217; by typing:<br />
nano -w /etc/network/interfaces# This file describes the network interfaces available on your system<br />
# and how to activate them. For more information, see interfaces(5).</p>
<p># The loopback network interface<br />
auto lo<br />
iface lo inet loopback</p>
<p># The primary network interface<br />
#auto eth0<br />
#iface eth0 inet dhcp</p>
<p>auto eth0<br />
iface eth0 inet static<br />
address 192.168.1.2<br />
netmask 255.255.255.0<br />
network 192.168.1.0<br />
broadcast 192.168.1.255<br />
gateway 192.168.1.1</li>
<li>Set the resolver for proper DNS servers.<br />
nano -w /etc/resolv.confsearch foo.com<br />
nameserver 192.168.1.3<br />
nameserver 192.168.1.4</li>
<li>Next you will need to restart the network component.<br />
/etc/init.d/networking restart</li>
<li>Add your new static IP to the hosts table.<br />
nano -w /etc/hosts</p>
<p>127.0.0.1 localhost.localdomain localhost debian</p>
<p>192.168.1.2 debian.foo.com debian</p>
<p># The following lines are desirable for IPv6 capable hosts<br />
::1 ip6-localhost ip6-loopback<br />
fe00::0 ip6-localnet<br />
ff00::0 ip6-mcastprefix<br />
ff02::1 ip6-allnodes<br />
ff02::2 ip6-allrouters<br />
ff02::3 ip6-allhosts</li>
<li>Set the system&#8217;s hostname.echo server1.example.com &gt; /etc/hostname<br />
/bin/hostname -F /etc/hostname</li>
<li>Install some needed software packages and services.apt-get install wget bzip2 rdate unzip zip ncftp nmap lynx fileutils dnsutils<br />
apt-get install tcpdump less make tftp rdate file gcc g++ ssh</li>
<li>Sync the time with an atomic clock.crontab -e
<p># update time with time.nist.gov<br />
0 3,9,15,21 * * * /usr/sbin/rdate time.nist.gov | logger -t NTP</li>
<li>Set up the &#8216;bashrc&#8217; file.nano -w /root/.bashrc
<p># ~/.bashrc: executed by bash(1) for non-login shells.</p>
<p>export PS1=&#8217;\h:\w\$ &#8216;<br />
umask 022</p>
<p># You may uncomment the following lines if you want `ls&#8217; to be colorized:<br />
export LS_OPTIONS=&#8217;&#8211;color=auto -h&#8217;<br />
eval &#8220;`dircolors`&#8221;<br />
alias ls=&#8217;ls $LS_OPTIONS&#8217;<br />
alias ll=&#8217;ls $LS_OPTIONS -l&#8217;<br />
alias l=&#8217;ls $LS_OPTIONS -lA&#8217;</p>
<p># Some more alias to avoid making mistakes:<br />
alias rm=&#8217;rm -i&#8217;<br />
alias cp=&#8217;cp -i&#8217;<br />
alias mv=&#8217;mv -i&#8217;</p>
<p># Bohack&#8217;s stuff<br />
alias nano=&#8217;nano -w -K&#8217;<br />
alias pico=&#8217;nano -w -K&#8217;<br />
alias ptree=&#8217;ps axf&#8217;</p>
<p>PS1=&#8217;\[\033[36;1m\w \[\033[35;1m\h \[\033[0m\$ &#8216;<br />
export PS1<br />
export GREP_OPTIONS=&#8221;&#8211;color=auto&#8221;<br />
TERM=xterm-color<br />
export TERM<br />
cd /</li>
</ol>
<p>Done! You now have a minimal install of Debian as a clean install. Don&#8217;t forget to do an &#8216;apt-get update&#8217; and an &#8216;apt-get upgrade&#8217;, to install any major/minor updates.</p>
<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://www.bohack.com/2008/11/clean-debian-etch-install/' addthis:title='Clean Debian Etch Install ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></content:encoded>
			<wfw:commentRss>http://www.bohack.com/2008/11/clean-debian-etch-install/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Linux Coloring of the Results</title>
		<link>http://www.bohack.com/2008/11/linux-coloring-of-the-results/</link>
		<comments>http://www.bohack.com/2008/11/linux-coloring-of-the-results/#comments</comments>
		<pubDate>Sun, 02 Nov 2008 17:22:50 +0000</pubDate>
		<dc:creator>Bohack</dc:creator>
				<category><![CDATA[Linux / Unix]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.bohack.com/?p=21</guid>
		<description><![CDATA[When reviewing a UNIX log file, I often feel like Iâ€™m looking for a needle in a haystack. Even after I â€˜grepâ€™ out what Iâ€™m looking for I still canâ€™t find it. I also like to use the â€˜tail â€“fâ€™ command to watch a rolling log, but again the information scrolls too fast and you [...]<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://www.bohack.com/2008/11/linux-coloring-of-the-results/' addthis:title='Linux Coloring of the Results ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></description>
			<content:encoded><![CDATA[<p>When reviewing a UNIX log file, I often feel like Iâ€™m looking for a needle in a haystack. Even after I â€˜grepâ€™ out what Iâ€™m looking for I still canâ€™t find it. I also like to use the â€˜tail â€“fâ€™ command to watch a rolling log, but again the information scrolls too fast and you just canâ€™t find what youâ€™re looking for in the quick moving results. To find the interesting information we will obviously use the â€˜grepâ€™ command, but to identify the results in the information there are a couple of methods.</p>
<p>The â€˜grepâ€™ command will support ANSI colorization and this can be done a number of ways. The first way is to specify the &#8211;color or &#8211;colour option on the command line. The second way is to export a variable that â€˜grepâ€™ looks at when executed. You will most likey want to add the export lines to your .profile or .bashrc file.</p>
<p><span id="more-21"></span></p>
<pre>
cat {somelogfile} | grep  --color {matching text}

or

tail -f {somerollinglog} | grep --color {matching text}
export GREP_OPTIONS="--color=auto"
export GREP_COLOR='1;31'
</pre>
<p>Grep colorization is good, but sometimes you need to see all the lines from the log file and focus on just what you are looking for. In this case we need to take a different approach; grep will filter and show just the lines that contain the information matching the regular expression weâ€™ve feed it. In order to see all the lines and only highlight the specific pieces we want to see, we will need to run the information thru a mechanism that will highlight just the matching piece. I originally came across this poorly written piece of PERL script that I adapted and refined over many iterations.</p>
<pre>
#!/usr/bin/perl
### Bohack 2006i
### Usage: hilite &lt;ansi_command&gt; &lt;target_string&gt;
### Purpose: Will read text from standard input and perform specified highlighting
### command before displaying text to standard output.
### License: GNU GPL
$|=1; # don't buffer i/o
$target = "$ARGV[0]";
$color = "\e[31m";
$end = "\e[0m";while(&lt;STDIN&gt;) {
s/($target)/$color$1$end/i;
print $_;
}
</pre>
<p>Remeber to chmod the file for execute permissions and put it in the path. (i.e. chmod 0777 hilite)</p>
<pre>
cat {somelogfile} | hilite {matching text}
or
tail -f {somerollinglog} | hilite {matching text}
</pre>
<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://www.bohack.com/2008/11/linux-coloring-of-the-results/' addthis:title='Linux Coloring of the Results ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></content:encoded>
			<wfw:commentRss>http://www.bohack.com/2008/11/linux-coloring-of-the-results/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

