<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>LinuxScrew: Linux Blog</title>
	
	<link>http://www.linuxscrew.com</link>
	<description>Linux Howtos, Open Source News, Cisco Manuals and much more!</description>
	<lastBuildDate>Sat, 05 Jan 2013 11:58:16 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/linuxscrew" /><feedburner:info uri="linuxscrew" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:emailServiceId>linuxscrew</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><feedburner:feedFlare href="http://add.my.yahoo.com/rss?url=http%3A%2F%2Ffeeds.feedburner.com%2Flinuxscrew" src="http://us.i1.yimg.com/us.yimg.com/i/us/my/addtomyyahoo4.gif">Subscribe with My Yahoo!</feedburner:feedFlare><feedburner:feedFlare href="http://www.newsgator.com/ngs/subscriber/subext.aspx?url=http%3A%2F%2Ffeeds.feedburner.com%2Flinuxscrew" src="http://www.newsgator.com/images/ngsub1.gif">Subscribe with NewsGator</feedburner:feedFlare><feedburner:feedFlare href="http://feeds.my.aol.com/add.jsp?url=http%3A%2F%2Ffeeds.feedburner.com%2Flinuxscrew" src="http://o.aolcdn.com/favorites.my.aol.com/webmaster/ffclient/webroot/locale/en-US/images/myAOLButtonSmall.gif">Subscribe with My AOL</feedburner:feedFlare><feedburner:feedFlare href="http://www.bloglines.com/sub/http://feeds.feedburner.com/linuxscrew" src="http://www.bloglines.com/images/sub_modern11.gif">Subscribe with Bloglines</feedburner:feedFlare><feedburner:feedFlare href="http://www.netvibes.com/subscribe.php?url=http%3A%2F%2Ffeeds.feedburner.com%2Flinuxscrew" src="http://www.netvibes.com/img/add2netvibes.gif">Subscribe with Netvibes</feedburner:feedFlare><feedburner:feedFlare href="http://fusion.google.com/add?feedurl=http%3A%2F%2Ffeeds.feedburner.com%2Flinuxscrew" src="http://buttons.googlesyndication.com/fusion/add.gif">Subscribe with Google</feedburner:feedFlare><feedburner:feedFlare href="http://www.pageflakes.com/subscribe.aspx?url=http%3A%2F%2Ffeeds.feedburner.com%2Flinuxscrew" src="http://www.pageflakes.com/ImageFile.ashx?instanceId=Static_4&amp;fileName=ATP_blu_91x17.gif">Subscribe with Pageflakes</feedburner:feedFlare><item>
		<title>Linux df Command Usage Examples</title>
		<link>http://feedproxy.google.com/~r/linuxscrew/~3/tiYt1wcvntM/</link>
		<comments>http://www.linuxscrew.com/2012/10/17/linux-df-command/#comments</comments>
		<pubDate>Wed, 17 Oct 2012 19:55:41 +0000</pubDate>
		<dc:creator>Artem Nosulchik</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[cli]]></category>
		<category><![CDATA[df]]></category>
		<category><![CDATA[filesystem]]></category>

		<guid isPermaLink="false">http://www.linuxscrew.com/?p=1842</guid>
		<description>This post about Linux df command opens series of articles for Linux newbies where you&amp;#8217;ll find description and usage examples of major Linux commands like df, top, fsck, mount and so on. Introduction Linux df command can be used to display disk usage statistics for the file systems present on the Linux system. It&amp;#8217;s handy tool to know which filesystem is consuming how much memory. Also, if a particular filename [...]</description>
			<content:encoded><![CDATA[<p><em>This post about Linux df command opens series of articles for Linux newbies where you&#8217;ll find description and usage examples of major Linux commands like df, top, fsck, mount and so on.</em></p>
<h3>Introduction</h3>
<p>Linux df command can be used to display disk usage statistics for the file systems present on the Linux system. It&#8217;s handy tool to know which filesystem is consuming how much memory. Also, if a particular filename is picked up and supplied as argument to df command then it displays the disk usage statistics for the file system on which the file resides. This command can be used by the system administrators to know the disk usage status of various file systems on Linux so that proper clean-up and maintenance of the Linux system can be performed. The df command provides various options through which the output can be customized in a way that is most suited to the user.</p>
<p>In this article, we will discuss the df command through practical examples.</p>
<h3>Syntax</h3>
<p>Before jumping on to the examples, lets first take a look on how to use the df command. Here is the syntax information of df command from the man page:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">df</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>OPTION<span style="color: #7a0874; font-weight: bold;">&#93;</span>... <span style="color: #7a0874; font-weight: bold;">&#91;</span>FILE<span style="color: #7a0874; font-weight: bold;">&#93;</span>...</pre></div></div>

<p>So we see that the df command does not require any mandatory argument. The OPTION and FILE arguments are non-mandatory. While the OPTION argument tells the df command to act in a way as specified by the definition of that OPTION, the FILE argument tells the df command to print disk usage of only that file system on which the FILE resides. </p>
<p>NOTE: for those who are new to this type of syntax information, any argument specified in square brackets [] are non-mandatory.</p>
<h3>Examples</h3>
<h4>1. Basic example</h4>
<p>Here is how the df command can be used in its most basic form.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># df </span>
Filesystem     1K-blocks    Used     Available Use<span style="color: #000000; font-weight: bold;">%</span> Mounted on 
<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sda6       <span style="color: #000000;">29640780</span> <span style="color: #000000;">4320704</span>     <span style="color: #000000;">23814388</span>  <span style="color: #000000;">16</span><span style="color: #000000; font-weight: bold;">%</span>     <span style="color: #000000; font-weight: bold;">/</span> 
udev             <span style="color: #000000;">1536756</span>       <span style="color: #000000;">4</span>     <span style="color: #000000;">1536752</span>    <span style="color: #000000;">1</span><span style="color: #000000; font-weight: bold;">%</span>     <span style="color: #000000; font-weight: bold;">/</span>dev 
tmpfs             <span style="color: #000000;">617620</span>     <span style="color: #000000;">888</span>     <span style="color: #000000;">616732</span>     <span style="color: #000000;">1</span><span style="color: #000000; font-weight: bold;">%</span>     <span style="color: #000000; font-weight: bold;">/</span>run 
none                <span style="color: #000000;">5120</span>       <span style="color: #000000;">0</span>     <span style="color: #000000;">5120</span>       <span style="color: #000000;">0</span><span style="color: #000000; font-weight: bold;">%</span>     <span style="color: #000000; font-weight: bold;">/</span>run<span style="color: #000000; font-weight: bold;">/</span>lock 
none             <span style="color: #000000;">1544044</span>     <span style="color: #000000;">156</span>     <span style="color: #000000;">1543888</span>    <span style="color: #000000;">1</span><span style="color: #000000; font-weight: bold;">%</span>     <span style="color: #000000; font-weight: bold;">/</span>run<span style="color: #000000; font-weight: bold;">/</span>shm</pre></div></div>

<p>In the output above, the disk usage statistics of all the file systems were displayed when the df command was run without any argument. </p>
<p>The first column specifies the file system name, the second column specifies the total memory for a particular file system in units of 1k-blocks where 1k is 1024 bytes. Used and available columns specify the amount of memory that is in use and is free respectively. The use column specifies the used memory in percentage while the final column &#8216;Mounted on&#8217; specifies the mount point of a file system.</p>
<h4>2. Get the disk usage of file system through a file </h4>
<p>As already discussed in the introduction, df can display the disk usage information of a file system if any file residing on that file system is supplied as an argument to it. </p>
<p>Here is an example:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># df test </span>
Filesystem     1K-blocks    Used      Available Use<span style="color: #000000; font-weight: bold;">%</span> Mounted on 
<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sda6       <span style="color: #000000;">29640780</span>    <span style="color: #000000;">4320600</span>   <span style="color: #000000;">23814492</span>  <span style="color: #000000;">16</span><span style="color: #000000; font-weight: bold;">%</span>       <span style="color: #000000; font-weight: bold;">/</span></pre></div></div>

<p>Here is another example:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># df groff.txt </span>
Filesystem     1K-blocks    Used     Available Use<span style="color: #000000; font-weight: bold;">%</span> Mounted on 
<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sda6       <span style="color: #000000;">29640780</span>    <span style="color: #000000;">4320600</span>  <span style="color: #000000;">23814492</span>  <span style="color: #000000;">16</span><span style="color: #000000; font-weight: bold;">%</span>     <span style="color: #000000; font-weight: bold;">/</span></pre></div></div>

<p>We used two different files (residing on same file system) as argument to df command. The output confirms that the df command displays the disk usage of file system on which a file resides. </p>
<h4>3. Display inode information</h4>
<p>There exists an option -i through which the output of the df command displays the inode information instead of block usage. </p>
<p>For example:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># df -i</span>
Filesystem      Inodes    IUsed    IFree     IUse<span style="color: #000000; font-weight: bold;">%</span> Mounted on
<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sda6      <span style="color: #000000;">1884160</span>    <span style="color: #000000;">261964</span>   <span style="color: #000000;">1622196</span>   <span style="color: #000000;">14</span><span style="color: #000000; font-weight: bold;">%</span>        <span style="color: #000000; font-weight: bold;">/</span>
udev           <span style="color: #000000;">212748</span>     <span style="color: #000000;">560</span>      <span style="color: #000000;">212188</span>    <span style="color: #000000;">1</span><span style="color: #000000; font-weight: bold;">%</span>         <span style="color: #000000; font-weight: bold;">/</span>dev
tmpfs          <span style="color: #000000;">216392</span>     <span style="color: #000000;">477</span>      <span style="color: #000000;">215915</span>    <span style="color: #000000;">1</span><span style="color: #000000; font-weight: bold;">%</span>         <span style="color: #000000; font-weight: bold;">/</span>run
none           <span style="color: #000000;">216392</span>     <span style="color: #000000;">3</span>        <span style="color: #000000;">216389</span>    <span style="color: #000000;">1</span><span style="color: #000000; font-weight: bold;">%</span>         <span style="color: #000000; font-weight: bold;">/</span>run<span style="color: #000000; font-weight: bold;">/</span>lock
none           <span style="color: #000000;">216392</span>     <span style="color: #000000;">8</span>        <span style="color: #000000;">216384</span>    <span style="color: #000000;">1</span><span style="color: #000000; font-weight: bold;">%</span>         <span style="color: #000000; font-weight: bold;">/</span>run<span style="color: #000000; font-weight: bold;">/</span>shm</pre></div></div>

<p>As we can see in the output above, the inode related information was displayed for each filesystem.</p>
<h4>4. Produce a grand total </h4>
<p>There exists an option &#8211;total through which the output displays an additional row at the end of the output which produces a total for every column. </p>
<p>Here is an example:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># df --total </span>
Filesystem     1K-blocks    Used    Available Use<span style="color: #000000; font-weight: bold;">%</span> Mounted on 
<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sda6       <span style="color: #000000;">29640780</span> <span style="color: #000000;">4320720</span>    <span style="color: #000000;">23814372</span>  <span style="color: #000000;">16</span><span style="color: #000000; font-weight: bold;">%</span>     <span style="color: #000000; font-weight: bold;">/</span> 
udev             <span style="color: #000000;">1536756</span>       <span style="color: #000000;">4</span>    <span style="color: #000000;">1536752</span>   <span style="color: #000000;">1</span><span style="color: #000000; font-weight: bold;">%</span>      <span style="color: #000000; font-weight: bold;">/</span>dev 
tmpfs             <span style="color: #000000;">617620</span>     <span style="color: #000000;">892</span>    <span style="color: #000000;">616728</span>    <span style="color: #000000;">1</span><span style="color: #000000; font-weight: bold;">%</span>      <span style="color: #000000; font-weight: bold;">/</span>run 
none                <span style="color: #000000;">5120</span>       <span style="color: #000000;">0</span>    <span style="color: #000000;">5120</span>      <span style="color: #000000;">0</span><span style="color: #000000; font-weight: bold;">%</span>      <span style="color: #000000; font-weight: bold;">/</span>run<span style="color: #000000; font-weight: bold;">/</span>lock 
none             <span style="color: #000000;">1544044</span>     <span style="color: #000000;">156</span>    <span style="color: #000000;">1543888</span>   <span style="color: #000000;">1</span><span style="color: #000000; font-weight: bold;">%</span>      <span style="color: #000000; font-weight: bold;">/</span>run<span style="color: #000000; font-weight: bold;">/</span>shm 
total           <span style="color: #000000;">33344320</span> <span style="color: #000000;">4321772</span>    <span style="color: #000000;">27516860</span>  <span style="color: #000000;">14</span><span style="color: #000000; font-weight: bold;">%</span></pre></div></div>

<p>So we see that the output contains an extra row towards the end of the output and displays total for each column. </p>
<h4>5. Produce output in human readable format </h4>
<p>There exists an option -h through which the output of df command can be produced in a human readable format. </p>
<p>Here is an example:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># df -h </span>
Filesystem      Size  Used   Avail Use<span style="color: #000000; font-weight: bold;">%</span> Mounted on 
<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sda6       29G   4.2G   23G   <span style="color: #000000;">16</span><span style="color: #000000; font-weight: bold;">%</span>     <span style="color: #000000; font-weight: bold;">/</span>  
udev            1.5G  4.0K   1.5G   <span style="color: #000000;">1</span><span style="color: #000000; font-weight: bold;">%</span>     <span style="color: #000000; font-weight: bold;">/</span>dev 
tmpfs           604M  892K   603M   <span style="color: #000000;">1</span><span style="color: #000000; font-weight: bold;">%</span>     <span style="color: #000000; font-weight: bold;">/</span>run 
none            5.0M     <span style="color: #000000;">0</span>   5.0M   <span style="color: #000000;">0</span><span style="color: #000000; font-weight: bold;">%</span>     <span style="color: #000000; font-weight: bold;">/</span>run<span style="color: #000000; font-weight: bold;">/</span>lock 
none            1.5G  156K   1.5G   <span style="color: #000000;">1</span><span style="color: #000000; font-weight: bold;">%</span>     <span style="color: #000000; font-weight: bold;">/</span>run<span style="color: #000000; font-weight: bold;">/</span>shm</pre></div></div>

<p>So we can see that the output displays the figures in form of &#8216;G&#8217; (gigabytes), &#8216;M&#8217; (megabytes) and &#8216;K&#8217; (kilobytes). This makes the output easy to read and comprehend and thus makes is human readable. Note that the name of the second column is also changed to &#8216;size&#8217; in order to make it human readable. </p>
<h3>Related Links</h3>
<p><a href="http://linux.die.net/man/1/df">Manual for df</a><br />
<a href="http://ss64.com/bash/">Index of Linux commands</a></p>
<div style='clear:both'></div><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/linuxscrew?a=tiYt1wcvntM:VKYwDd-5V6Q:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/linuxscrew?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/linuxscrew?a=tiYt1wcvntM:VKYwDd-5V6Q:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/linuxscrew?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/linuxscrew?a=tiYt1wcvntM:VKYwDd-5V6Q:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/linuxscrew?i=tiYt1wcvntM:VKYwDd-5V6Q:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/linuxscrew?a=tiYt1wcvntM:VKYwDd-5V6Q:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/linuxscrew?i=tiYt1wcvntM:VKYwDd-5V6Q:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/linuxscrew?a=tiYt1wcvntM:VKYwDd-5V6Q:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/linuxscrew?d=dnMXMwOfBR0" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/linuxscrew/~4/tiYt1wcvntM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.linuxscrew.com/2012/10/17/linux-df-command/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		<feedburner:origLink>http://www.linuxscrew.com/2012/10/17/linux-df-command/</feedburner:origLink></item>
		<item>
		<title>Linux Restricted Shells: rssh and scponly</title>
		<link>http://feedproxy.google.com/~r/linuxscrew/~3/OzWhEyfD8Js/</link>
		<comments>http://www.linuxscrew.com/2012/07/05/linux-restricted-shells-rssh-and-scponly/#comments</comments>
		<pubDate>Thu, 05 Jul 2012 16:33:46 +0000</pubDate>
		<dc:creator>Artem Nosulchik</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[chroot]]></category>
		<category><![CDATA[cvs]]></category>
		<category><![CDATA[rdist]]></category>
		<category><![CDATA[rssh]]></category>
		<category><![CDATA[rsync]]></category>
		<category><![CDATA[scp]]></category>
		<category><![CDATA[scponly]]></category>
		<category><![CDATA[sftp]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://www.linuxscrew.com/?p=1825</guid>
		<description>Restricted shells like rssh and scponly give sysadmin the possibility to limit the operations that Linux user can do, for example you can create user that will be allowed to copy files via scp but won&amp;#8217;t be permitted to login into system&amp;#8217;s command line. This is quite important security feature that should be considered by every sysadmin to prevent unauthorized activity by users for example over SSH. If you have some online storage [...]</description>
			<content:encoded><![CDATA[<p>Restricted shells like <strong><a href="http://www.pizzashack.org/rssh/">rssh</a></strong> and <strong><a href="https://github.com/scponly/scponly/wiki/">scponly</a></strong> give sysadmin the possibility to limit the operations that Linux user can do, for example you can create user that will be allowed to copy files via <strong><a href="http://en.wikipedia.org/wiki/Secure_copy">scp</a></strong> but won&#8217;t be permitted to login into system&#8217;s command line. This is quite important security feature that should be considered by every sysadmin to prevent unauthorized activity by users for example over SSH.</p>
<p>If you have some online storage that is used for uploading backup data over scp or rsync/ssh from remote hosts then it is highly recommended to use restricted shells for those incoming connections and make sure that even if the attacker has got username/password (or key) then he (or she!) won&#8217;t be able to break into your system.</p>
<p><strong>scponly</strong> is extremely simple restricted shell, user account that has scponly binary as its shell won&#8217;t be able to do anything except transfer data from remote host via scp protocol or via <a href="http://troy.jdmz.net/rsync/index.html">rsync/scp</a>. <strong>rssh</strong> provides little bit more features: you can limit users to use selected protocols like scp, sftp, rsync, cvs or rdist either in chroot environment or not.</p>
<h3>Installation</h3>
<p>I prefer using yum or aptitude to install such kind of software like rssh or scponly so the fastest way is to try one of below commands depending on your needs:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> rssh
<span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> scponly
yum <span style="color: #c20cb9; font-weight: bold;">install</span> rssh
yum <span style="color: #c20cb9; font-weight: bold;">install</span> scponly</pre></div></div>

<p>If there are problems to find desired restricted shell in your Linux distro&#8217;s repository then you should download sources and do some <strong>./configure</strong>, <strong>make</strong> and <strong>make install</strong>. Here are the links: <a href="http://prdownloads.sourceforge.net/rssh/rssh-2.3.3.tar.gz?download">latest rssh .tar.gz</a>, <a href="http://sourceforge.net/projects/scponly/files/scponly/scponly-4.8/scponly-4.8.tgz/download">latest scponly .tgz</a>.</p>
<h3>Configuration</h3>
<p>scponly doesn&#8217;t need any configuration and works out of the box so you just should set it as a shell for user account. Here are some examples.</p>
<p>Create new user account with scponly as shell:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">useradd <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>scponly user1</pre></div></div>

<p>Modify user account to set rssh as a shell:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">usermod <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>rssh user2</pre></div></div>

<p>Where <em>/usr/sbin/scponly</em> is binary executable of scponly.</p>
<p>rssh comes with text configuration file usually stored in <em>/etc/rssh.conf</em>. You can either setup per-user settings there or configure global restrictions for all accounts which are using rssh. Default <em>rssh.conf</em> file is well commented so there shouldn&#8217;t be any problems to configure rssh as you needs. At the same time, here are some examples.</p>
<p>If you wish to restrict all users to scp and rsync only then you should uncomment lines in <em>rssh.conf</em> like below:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">allowscp
<span style="color: #666666; font-style: italic;">#allowsftp</span>
<span style="color: #666666; font-style: italic;">#allowcvs</span>
<span style="color: #666666; font-style: italic;">#allowrdist</span>
allowrsync</pre></div></div>

<p>Now coming to per-user examples. User peter is allowed to use scp protocol only, the following line in<em> rssh.conf</em> will do that:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #007800;">user</span>=sbk:022:00001:</pre></div></div>

<p>User ann is allowed to scp, rsync only:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #007800;">user</span>=sbk:022:<span style="color: #000000;">10001</span>:</pre></div></div>

<p>As you can see enabled protocols in per-user setup are specified as <strong>11000</strong> (scp, sftp), <strong>11111</strong> (scp, sftp, cvs, rdist, rsync) or <strong>00000</strong> (no protocols enabled). <strong>022</strong> in above examples specifies <a href="http://en.wikipedia.org/wiki/Umask">umask</a>.</p>
<h3>Testing</h3>
<p>Let&#8217;s assume you&#8217;ve created user1 and enabled only scp and rsync using rssh. An attempt to access the server via SSH under user1 account will end with the following output:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">artiomix$ <span style="color: #c20cb9; font-weight: bold;">ssh</span> user1<span style="color: #000000; font-weight: bold;">@</span>1.2.3.4
user1<span style="color: #000000; font-weight: bold;">@</span>1.2.3.4<span style="color: #ff0000;">'s password: 
&nbsp;
This account is restricted by rssh.
Allowed commands: scp rsync
&nbsp;
If you believe this is in error, please contact your system administrator.
&nbsp;
Connection to 1.2.3.4 closed.</span></pre></div></div>

<p>At the same time scp transfers will work without problems:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">artiomix$ <span style="color: #c20cb9; font-weight: bold;">scp</span> <span style="color: #660033;">-P</span> <span style="color: #000000;">23451</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>test.file user1<span style="color: #000000; font-weight: bold;">@</span>1.2.3.4:<span style="color: #000000; font-weight: bold;">/</span>tmp
user1<span style="color: #000000; font-weight: bold;">@</span>1.2.3.4<span style="color: #ff0000;">'s password:
test.file                             100%  983     1.0KB/s   00:00</span></pre></div></div>

<h3>Further Reading</h3>
<p>rssh support chroot environments for scp, rsync and other transfer protocols. It means that you can restrict users not only by command they can use but also by filesystems they reach. For example, user1 can be chrooted to /chroot_user1 so it can&#8217;t be used to copy something from /etc or /var/www directories of the server. Here is nice manual about <a href="http://www.cyberciti.biz/tips/howto-linux-unix-rssh-chroot-jail-setup.html">chroot in rssh</a>.</p>
<div style='clear:both'></div><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/linuxscrew?a=OzWhEyfD8Js:IXXRNhXquQk:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/linuxscrew?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/linuxscrew?a=OzWhEyfD8Js:IXXRNhXquQk:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/linuxscrew?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/linuxscrew?a=OzWhEyfD8Js:IXXRNhXquQk:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/linuxscrew?i=OzWhEyfD8Js:IXXRNhXquQk:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/linuxscrew?a=OzWhEyfD8Js:IXXRNhXquQk:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/linuxscrew?i=OzWhEyfD8Js:IXXRNhXquQk:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/linuxscrew?a=OzWhEyfD8Js:IXXRNhXquQk:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/linuxscrew?d=dnMXMwOfBR0" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/linuxscrew/~4/OzWhEyfD8Js" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.linuxscrew.com/2012/07/05/linux-restricted-shells-rssh-and-scponly/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		<feedburner:origLink>http://www.linuxscrew.com/2012/07/05/linux-restricted-shells-rssh-and-scponly/</feedburner:origLink></item>
		<item>
		<title>Failover and Load Balancing using HAProxy</title>
		<link>http://feedproxy.google.com/~r/linuxscrew/~3/k7Xl-I047kY/</link>
		<comments>http://www.linuxscrew.com/2012/07/04/failover-load-balancing-haproxy/#comments</comments>
		<pubDate>Wed, 04 Jul 2012 20:34:12 +0000</pubDate>
		<dc:creator>Artem Nosulchik</dc:creator>
				<category><![CDATA[howtos]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[failover]]></category>
		<category><![CDATA[fedora]]></category>
		<category><![CDATA[haproxy]]></category>
		<category><![CDATA[load balancing]]></category>

		<guid isPermaLink="false">http://www.linuxscrew.com/?p=1808</guid>
		<description>HAProxy is open source proxy that can be used to enable high availability and load balancing for web applications. It was designed especially for high load projects so it is very fast and predictable, HAProxy is based on single-process model. In this post I&amp;#8217;ll describe sample setup of HAProxy: users&amp;#8217; requests are load balanced between two web servers Web1 and Web1, if one of them goes down then all the [...]</description>
			<content:encoded><![CDATA[<p><strong><a href="http://haproxy.1wt.eu/">HAProxy</a></strong> is open source proxy that can be used to enable <a href="http://en.wikipedia.org/wiki/High_availability">high availability</a> and <a href="http://en.wikipedia.org/wiki/Load_balancing_(computing)">load balancing</a> for web applications. It was designed especially for high load projects so it is very fast and predictable, HAProxy is based on single-process model.</p>
<p>In this post I&#8217;ll describe sample setup of HAProxy: users&#8217; requests are load balanced between two web servers <strong>Web1</strong> and <strong>Web1</strong>, if one of them goes down then all the request are processed by alive server, once dead servers recovers load balancing enables again. See topology to the right.<br />
<img class="size-full wp-image-1811 aligncenter" title="HAProxy sample topology" src="http://www.linuxscrew.com/wp-content/uploads/2012/07/haproxy1.jpeg" alt="HAProxy sample topology" width="200" height="208" /></p>
<h3>Installation</h3>
<p>HAProxy is included into repositories for major Linux distributions, so if you&#8217;re using <a href="/category/centos/">Centos</a>, Redhat or <a href="/category/fedora/">Fedora</a> type the following command:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">yum <span style="color: #c20cb9; font-weight: bold;">install</span> haproxy</pre></div></div>

<p>If you&#8217;re <a href="/category/ubuntu/">Ubuntu</a>, <a href="/category/debian/">Debian</a> or Linux Mint user use this one instead:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> haproxy</pre></div></div>

<h3>Configuration</h3>
<p>As soon as HAProxy is installed it&#8217;s time to edit its configuration file, usually it&#8217;s placed in <em>/etc/haproxy/haproxy.cfg</em>. Official documentation for HAProxy 1.4 (stable) is <a href="http://haproxy.1wt.eu/download/1.4/doc/configuration.txt">here</a>.</p>
<p>Here is configuration file to implement setup shown at the diagram and described above:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">global
        user daemon
        group daemon
        daemon
        log 127.0.0.1 daemon
&nbsp;
listen http
        <span style="color: #7a0874; font-weight: bold;">bind</span> 1.2.3.4:<span style="color: #000000;">80</span>
        mode http
        option tcplog
&nbsp;
        log global
        option dontlognull
&nbsp;
        balance roundrobin
        clitimeout <span style="color: #000000;">60000</span>
        srvtimeout <span style="color: #000000;">60000</span>
        contimeout <span style="color: #000000;">5000</span>
        retries <span style="color: #000000;">3</span>
        server web1 web1.example.com:<span style="color: #000000;">80</span> check
        server web2 web2.example.com:<span style="color: #000000;">80</span> check
        cookie web1 insert nocache
        cookie web2 insert nocache</pre></div></div>

<p>Let&#8217;s stop on most important parts of this configuration file. Section <strong>global </strong>specifies user and group which will be used to run haproxy process (<strong>daemon</strong> in our example). Line <strong>daemon</strong> tells HAProxy to run in background, <strong>log 127.0.0.1 daemon</strong> specifies syslog facility for sending logs from HAProxy.</p>
<p>Section <strong>listen http</strong> contains line <strong>bind 1.2.3.4:80</strong> that specifies IP address and port that will be used to accept users&#8217; requests (they will be load balanced between Web1 and Web2). Line <strong>mode http</strong> means that HAProxy will filter all requests different from HTTP and will do load balancing over HTTP protocol.</p>
<p>Line <strong>balance roundrobin</strong> specifies load balancing algorithm according to which each web server (Web1 and Web2) will be used in turns according to their weights. In our example weights for both servers are the same so load balancing is fair.</p>
<p>Lines <strong>server web1 &#8230;</strong> and <strong>server web2 &#8230;</strong> specify web servers for load balancing and failover, in our case they are load balanced according to round robin algorithm and have the same priority/weight.</p>
<p>The last two lines in configuration files are optional, they makes it possible to preserve cookies, it means for example that if you logged in to web application hosted at Web1 and then HAProxy forwarded your next request to Web2 you will still have logged in session opened as cookies with session id from Web1 will be sent to you from Web2 as well.</p>
<div style='clear:both'></div><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/linuxscrew?a=k7Xl-I047kY:kS28I3g-9ok:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/linuxscrew?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/linuxscrew?a=k7Xl-I047kY:kS28I3g-9ok:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/linuxscrew?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/linuxscrew?a=k7Xl-I047kY:kS28I3g-9ok:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/linuxscrew?i=k7Xl-I047kY:kS28I3g-9ok:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/linuxscrew?a=k7Xl-I047kY:kS28I3g-9ok:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/linuxscrew?i=k7Xl-I047kY:kS28I3g-9ok:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/linuxscrew?a=k7Xl-I047kY:kS28I3g-9ok:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/linuxscrew?d=dnMXMwOfBR0" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/linuxscrew/~4/k7Xl-I047kY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.linuxscrew.com/2012/07/04/failover-load-balancing-haproxy/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://www.linuxscrew.com/2012/07/04/failover-load-balancing-haproxy/</feedburner:origLink></item>
		<item>
		<title>Track file changes using auditd</title>
		<link>http://feedproxy.google.com/~r/linuxscrew/~3/DQSEhZjD7hQ/</link>
		<comments>http://www.linuxscrew.com/2012/07/04/track-file-changes-auditd/#comments</comments>
		<pubDate>Wed, 04 Jul 2012 19:08:20 +0000</pubDate>
		<dc:creator>Artem Nosulchik</dc:creator>
				<category><![CDATA[applications]]></category>
		<category><![CDATA[howtos]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[auditd]]></category>
		<category><![CDATA[passwd]]></category>

		<guid isPermaLink="false">http://www.linuxscrew.com/?p=1782</guid>
		<description>Most of Linux distributions comes with Linux Auditing System that makes it possible to track file changes, file accesses as well as system calls. It&amp;#8217;s pretty useful functionality for sysadmins who wish to know who and when accessed and/or changed sensitive files like /etc/passwd, /etc/sudoers or others. Daemon auditd that usually runs in background and starts after reboot by default logs those events into /var/log/audit.log file (or into other file if [...]</description>
			<content:encoded><![CDATA[<p>Most of Linux distributions comes with <strong><a href="http://my.safaribooksonline.com/book/operating-systems-and-server-administration/linux/0672328925/security/ch25">Linux Auditing System</a></strong> that makes it possible to track file changes, file accesses as well as system calls. It&#8217;s pretty useful functionality for sysadmins who wish to know who and when accessed and/or changed sensitive files like /etc/passwd, /etc/sudoers or others.</p>
<p>Daemon <strong><a href="http://linux.die.net/man/8/auditd">auditd</a></strong> that usually runs in background and starts after reboot by default logs those events into /var/log/audit.log file (or into other file if different syslog facility is specified). The common usage is to list all files which should be watched and search auditd&#8217;s logs from time to time. For example, I prefer to track any file changes into /etc/passwd, reading/writing of /etc/sudoers, executing of /bin/some/binary or just everything (read, write, attributes changes, executing) for my /very/important/file.</p>
<p>In order to configure that you&#8217;ll need two commands: <strong>auditctl</strong> and <strong>ausearch</strong>. First one is for configuring auditd daemon (e.g. setting a watch on a file), second one is for searching auditd logs (it&#8217;s possible to use grep against /var/log/audit.log too but <strong>ausearch</strong> command makes this task easier).</p>
<h3>Install and start Linux Auditing System</h3>
<p>If it happened that <strong>auditd</strong> daemon isn&#8217;t installed in your system then you can fix this by one of below commands:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> audit</pre></div></div>

<p>or</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> yum <span style="color: #c20cb9; font-weight: bold;">install</span> audit</pre></div></div>

<p>The next step is to make sure that <strong>auditd</strong> is running, if command <span style="color: #ff6600;">ps ax | grep [a]udit</span> shows nothing then start <strong>auditd</strong> using command:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>auditd start</pre></div></div>

<p>As soon as <strong>auditd</strong> daemon is started we can start configuring it for tracking file changes using <strong>auditctl</strong> command.</p>
<h3>Make auditd to log all file changes</h3>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">auditctl <span style="color: #660033;">-w</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">passwd</span> <span style="color: #660033;">-k</span> passwd-ra <span style="color: #660033;">-p</span> ra</pre></div></div>

<p>This command will add a rule for <strong>auditd</strong> daemon to monitor file <em>/etc/passwd</em> file (see option <strong>-w /etc/passwd</strong>) for reading or changing the atributes (see option <strong>-p ra</strong>, where <strong>r</strong> is for read, <strong>a</strong> is for attribute). Also this command specifies filter key (<strong>-k passwd-ra</strong>) that will uniquely identify auditd records in its logs files.</p>
<p>Now let&#8217;s test this rule: optput the last 20 lines of <em>/etc/passwd</em> file and then search audit log for corresponding records</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">tail</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">passwd</span></pre></div></div>

<p>and then</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><span style="color: #7a0874; font-weight: bold;">test</span> artemn<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># ausearch -k passwd-ra</span>
<span style="color: #660033;">----</span>
time-<span style="color: #000000; font-weight: bold;">&amp;</span>gt;Wed Jul  <span style="color: #000000;">4</span> <span style="color: #000000;">15</span>:<span style="color: #000000;">17</span>:<span style="color: #000000;">14</span> <span style="color: #000000;">2012</span>
<span style="color: #007800;">type</span>=CONFIG_CHANGE <span style="color: #007800;">msg</span>=audit<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">1341407834.821</span>:<span style="color: #000000;">207310</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>: <span style="color: #007800;">auid</span>=<span style="color: #000000;">500</span> <span style="color: #007800;">ses</span>=<span style="color: #000000;">23783</span> <span style="color: #007800;">op</span>=<span style="color: #ff0000;">&quot;add rule&quot;</span> <span style="color: #007800;">key</span>=<span style="color: #ff0000;">&quot;passwd-ra&quot;</span> <span style="color: #007800;">list</span>=<span style="color: #000000;">4</span> <span style="color: #007800;">res</span>=<span style="color: #000000;">1</span>
<span style="color: #660033;">----</span>
time-<span style="color: #000000; font-weight: bold;">&amp;</span>gt;Wed Jul  <span style="color: #000000;">4</span> <span style="color: #000000;">15</span>:<span style="color: #000000;">17</span>:<span style="color: #000000;">20</span> <span style="color: #000000;">2012</span>
<span style="color: #007800;">type</span>=PATH <span style="color: #007800;">msg</span>=audit<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">1341407840.181</span>:<span style="color: #000000;">207311</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>: <span style="color: #007800;">item</span>=<span style="color: #000000;">0</span> <span style="color: #007800;">name</span>=<span style="color: #ff0000;">&quot;/etc/passwd&quot;</span> <span style="color: #007800;">inode</span>=<span style="color: #000000;">31982841</span> <span style="color: #007800;">dev</span>=09:02 <span style="color: #007800;">mode</span>=0100644 <span style="color: #007800;">ouid</span>=<span style="color: #000000;">0</span> <span style="color: #007800;">ogid</span>=<span style="color: #000000;">0</span> <span style="color: #007800;">rdev</span>=00:00
<span style="color: #007800;">type</span>=CWD <span style="color: #007800;">msg</span>=audit<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">1341407840.181</span>:<span style="color: #000000;">207311</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>:  <span style="color: #007800;">cwd</span>=<span style="color: #ff0000;">&quot;/home/artemn&quot;</span>
<span style="color: #007800;">type</span>=SYSCALL <span style="color: #007800;">msg</span>=audit<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">1341407840.181</span>:<span style="color: #000000;">207311</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>: <span style="color: #007800;">arch</span>=c000003e <span style="color: #007800;">syscall</span>=<span style="color: #000000;">2</span> <span style="color: #007800;">success</span>=<span style="color: #c20cb9; font-weight: bold;">yes</span> <span style="color: #007800;">exit</span>=<span style="color: #000000;">3</span> <span style="color: #007800;">a0</span>=7fffecd41817 <span style="color: #007800;">a1</span>=<span style="color: #000000;">0</span> <span style="color: #007800;">a2</span>=<span style="color: #000000;">0</span> <span style="color: #007800;">a3</span>=7fffecd40b40 <span style="color: #007800;">items</span>=<span style="color: #000000;">1</span> <span style="color: #007800;">ppid</span>=<span style="color: #000000;">642502</span> <span style="color: #007800;">pid</span>=<span style="color: #000000;">521288</span> <span style="color: #007800;">auid</span>=<span style="color: #000000;">500</span> <span style="color: #007800;">uid</span>=<span style="color: #000000;">0</span> <span style="color: #007800;">gid</span>=<span style="color: #000000;">0</span> <span style="color: #007800;">euid</span>=<span style="color: #000000;">0</span> <span style="color: #007800;">suid</span>=<span style="color: #000000;">0</span> <span style="color: #007800;">fsuid</span>=<span style="color: #000000;">0</span> <span style="color: #007800;">egid</span>=<span style="color: #000000;">0</span> <span style="color: #007800;">sgid</span>=<span style="color: #000000;">0</span> <span style="color: #007800;">fsgid</span>=<span style="color: #000000;">0</span> <span style="color: #007800;">tty</span>=pts0 <span style="color: #007800;">ses</span>=<span style="color: #000000;">23783</span> <span style="color: #007800;">comm</span>=<span style="color: #ff0000;">&quot;tail&quot;</span> <span style="color: #007800;">exe</span>=<span style="color: #ff0000;">&quot;/usr/bin/tail&quot;</span> <span style="color: #007800;">key</span>=<span style="color: #ff0000;">&quot;passwd-ra&quot;</span></pre></div></div>

<p>As you can see the output of second command shows that auditd has one record for filter key &#8216;passwd-ra&#8217;, it shows that root user (<strong>uid=0 gid=0</strong>) has read file <em>/etc/passwd</em> using command <span style="color: #ff6600;">tail</span> (<strong>comm=&#8221;tail&#8221; exe=&#8221;/usr/bin/tail&#8221;</strong>) at July 4, 2012 (<strong>time-&gt;Wed Jul 4 15:17:20 2012</strong>).</p>
<p>Utility <strong>ausearch</strong> is pretty powerful so I recommend to read output of <span style="color: #ff6600;">man ausearch</span>, in the meantime here are some useful examples:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">ausearch <span style="color: #660033;">-x</span> <span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">grep</span>
ausearch <span style="color: #660033;">-x</span> <span style="color: #c20cb9; font-weight: bold;">rm</span></pre></div></div>

<p>This approach allows to scan <strong>auditd</strong> records for certain executable, e.g. if you&#8217;d like to see if any of watched files was deleted (or not) using command <span style="color: #ff6600;">rm</span> then you should use second command of above two.</p>
<p>This one will show you all records for certain UID (username).</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">ausearch <span style="color: #660033;">-ui</span> <span style="color: #000000;">1000</span></pre></div></div>

<div style='clear:both'></div><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/linuxscrew?a=DQSEhZjD7hQ:t3uYV5diKXY:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/linuxscrew?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/linuxscrew?a=DQSEhZjD7hQ:t3uYV5diKXY:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/linuxscrew?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/linuxscrew?a=DQSEhZjD7hQ:t3uYV5diKXY:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/linuxscrew?i=DQSEhZjD7hQ:t3uYV5diKXY:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/linuxscrew?a=DQSEhZjD7hQ:t3uYV5diKXY:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/linuxscrew?i=DQSEhZjD7hQ:t3uYV5diKXY:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/linuxscrew?a=DQSEhZjD7hQ:t3uYV5diKXY:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/linuxscrew?d=dnMXMwOfBR0" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/linuxscrew/~4/DQSEhZjD7hQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.linuxscrew.com/2012/07/04/track-file-changes-auditd/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		<feedburner:origLink>http://www.linuxscrew.com/2012/07/04/track-file-changes-auditd/</feedburner:origLink></item>
		<item>
		<title>Limit CPU usage of Linux process</title>
		<link>http://feedproxy.google.com/~r/linuxscrew/~3/9qWyPRa5Lis/</link>
		<comments>http://www.linuxscrew.com/2012/07/03/limit-cpu-usage-of-linux-process/#comments</comments>
		<pubDate>Tue, 03 Jul 2012 13:32:32 +0000</pubDate>
		<dc:creator>Artem Nosulchik</dc:creator>
				<category><![CDATA[applications]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[cpu]]></category>
		<category><![CDATA[cpulimit]]></category>
		<category><![CDATA[grep]]></category>
		<category><![CDATA[top]]></category>

		<guid isPermaLink="false">http://www.linuxscrew.com/?p=1771</guid>
		<description>cpulimit is a small program written in C that allows to limit CPU usage by Linux process. Limit is specified in percentage so it&amp;#8217;s possible to prevent high CPU load generated by scripts, programs or processes. I found cpulimit pretty useful for the scripts running from cron, for example I can do overnight backups and be sure that compression of 50GB file via gzip won&amp;#8217;t eat all CPU resources and [...]</description>
			<content:encoded><![CDATA[<p><strong><a href="http://cpulimit.sourceforge.net/">cpulimit</a></strong> is a small program written in C that allows to limit CPU usage by Linux process. Limit is specified in percentage so it&#8217;s possible to prevent high CPU load generated by scripts, programs or processes.</p>
<p>I found cpulimit pretty useful for the scripts running from cron, for example I can do overnight backups and be sure that compression of 50GB file via gzip won&#8217;t eat all CPU resources and all other system processes will have enough CPU time.</p>
<p>In most of Linux distributions cpulimit is available from binary repositories so you can install it using commands:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> cpulimit</pre></div></div>

<p>or</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> yum <span style="color: #c20cb9; font-weight: bold;">install</span> cpulimit</pre></div></div>

<p>If it&#8217;s not possible in your distro then it&#8217;s extremely easy to compile it:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>
<span style="color: #c20cb9; font-weight: bold;">wget</span> <span style="color: #660033;">--no-check-certificate</span> https:<span style="color: #000000; font-weight: bold;">//</span>github.com<span style="color: #000000; font-weight: bold;">/</span>opsengine<span style="color: #000000; font-weight: bold;">/</span>cpulimit<span style="color: #000000; font-weight: bold;">/</span>tarball<span style="color: #000000; font-weight: bold;">/</span>master <span style="color: #660033;">-O</span> cpulimit.tar
<span style="color: #c20cb9; font-weight: bold;">tar</span> <span style="color: #660033;">-xvf</span> cpulimit.tar
<span style="color: #7a0874; font-weight: bold;">cd</span> opsengine-cpulimit-9df7758
<span style="color: #c20cb9; font-weight: bold;">make</span>
<span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> cpulimit <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>cpulimit</pre></div></div>

<p>From that moment you can run commands limited by CPU percentage, e.g. below command executes gzip compression so that gzip process will never step over 10% of CPU limit:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>cpulimit <span style="color: #660033;">--limit</span>=<span style="color: #000000;">10</span> <span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">gzip</span> vzdump-openvz-<span style="color: #000000;">102</span>-<span style="color: #000000;">2012</span>_06_26-<span style="color: #000000;">19</span>_01_11.tar</pre></div></div>

<p>You can check actual CPU usage by gzip using commands:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">ps</span> axu <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>g<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #c20cb9; font-weight: bold;">zip</span></pre></div></div>

<p>or</p>

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

<p>Btw, the first command contains &#8216;grep [g]zip&#8217; to avoid the last line in common output:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">root    <span style="color: #000000;">896448</span>  <span style="color: #000000;">10.0</span>  <span style="color: #000000;">3.1</span> <span style="color: #000000;">159524</span>  <span style="color: #000000;">3528</span> ?        S    <span style="color: #000000;">13</span>:<span style="color: #000000;">12</span>   <span style="color: #000000;">0</span>:00 <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>cpulimit <span style="color: #660033;">--limit</span>=<span style="color: #000000;">10</span> <span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">gzip</span> vzdump-openvz-<span style="color: #000000;">102</span>-<span style="color: #000000;">2012</span>_06_26-<span style="color: #000000;">19</span>_01_11.tar
root       <span style="color: #000000;">26490</span>  <span style="color: #000000;">0.0</span>  <span style="color: #000000;">0.0</span>   <span style="color: #000000;">6364</span>   <span style="color: #000000;">708</span> pts<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">0</span>    S+   <span style="color: #000000;">15</span>:<span style="color: #000000;">24</span>   <span style="color: #000000;">0</span>:00 <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #c20cb9; font-weight: bold;">gzip</span></pre></div></div>

<p>Using cpulimit you can also allocate CPU limit to already running processes, e.g. below command will allocate 20% CPU limit to process with PID 2342:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>cpulimit <span style="color: #660033;">-p</span> <span style="color: #000000;">2342</span> <span style="color: #660033;">-l</span> <span style="color: #000000;">20</span></pre></div></div>

<p>It&#8217;s possible to specify process by its executable file instead of PID:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>cpulimit <span style="color: #660033;">-P</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>nginx <span style="color: #660033;">-l</span> <span style="color: #000000;">30</span></pre></div></div>

<div style='clear:both'></div><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/linuxscrew?a=9qWyPRa5Lis:7dBTysmY1aI:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/linuxscrew?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/linuxscrew?a=9qWyPRa5Lis:7dBTysmY1aI:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/linuxscrew?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/linuxscrew?a=9qWyPRa5Lis:7dBTysmY1aI:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/linuxscrew?i=9qWyPRa5Lis:7dBTysmY1aI:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/linuxscrew?a=9qWyPRa5Lis:7dBTysmY1aI:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/linuxscrew?i=9qWyPRa5Lis:7dBTysmY1aI:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/linuxscrew?a=9qWyPRa5Lis:7dBTysmY1aI:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/linuxscrew?d=dnMXMwOfBR0" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/linuxscrew/~4/9qWyPRa5Lis" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.linuxscrew.com/2012/07/03/limit-cpu-usage-of-linux-process/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		<feedburner:origLink>http://www.linuxscrew.com/2012/07/03/limit-cpu-usage-of-linux-process/</feedburner:origLink></item>
		<item>
		<title>Geolocation for Nagios</title>
		<link>http://feedproxy.google.com/~r/linuxscrew/~3/u0BGL38-CmI/</link>
		<comments>http://www.linuxscrew.com/2012/07/02/nagios-map-geolocation/#comments</comments>
		<pubDate>Mon, 02 Jul 2012 11:50:34 +0000</pubDate>
		<dc:creator>Artem Nosulchik</dc:creator>
				<category><![CDATA[howtos]]></category>
		<category><![CDATA[monitoring]]></category>
		<category><![CDATA[google maps]]></category>
		<category><![CDATA[nagios]]></category>
		<category><![CDATA[nagmap]]></category>

		<guid isPermaLink="false">http://www.linuxscrew.com/?p=1732</guid>
		<description>Some time ago I came across NagMap addon for Nagios and found it pretty helpful for monitoring multiple hosts around the world. For example, there are some production servers in Europe, US and others in India and New Zealand and it&amp;#8217;s much better see their states on the map rather than using boring Nagios host status list. Every host can have one of the following states based on ping statistics: [...]</description>
			<content:encoded><![CDATA[<p>Some time ago I came across <a href="http://exchange.nagios.org/directory/Addons/Maps-and-Diagrams/nagmap/details"><strong>NagMap</strong></a> addon for <strong><a href="http://www.nagios.org/">Nagios</a></strong> and found it pretty helpful for monitoring multiple hosts around the world.</p>
<p>For example, there are some production servers in Europe, US and others in India and New Zealand and it&#8217;s much better see their states on the map rather than using boring Nagios host status list. Every host can have one of the following states based on ping statistics: green, yellow and red. Green/white (ok) status corresponds to 0-10% packet loss, yellow (warning) is 10-20% packet loss and red (critical) means the host is down or packet loss to it is more than 20%. All three states are shown on the map using different markers.</p>
<p>Using NagMap addon for Nagios it&#8217;s possible to create a map of the hosts and their states based on Google Maps, here is some part of my map:</p>
<p><img class="aligncenter size-full wp-image-1733" title="Nagmap screenshot" src="http://www.linuxscrew.com/wp-content/uploads/2012/07/nagmap1.png" alt="" width="466" height="424" /></p>
<p>Above screenshot shows all hosts in OK state (desired picture) so in case when some host goes down or becomes sluggish then you&#8217;ll see some red markers like this <img title="Red Marker" src="http://www.linuxscrew.com/wp-content/uploads/2012/07/server_red.png" alt="" /> or <img title="Red Marker" src="http://www.linuxscrew.com/wp-content/uploads/2012/07/marker.png" alt="" /> (depending on type of the host).</p>
<h4><strong>Setup and configure NagMap</strong></h4>
<p>So first of all you need to download nagmap tarball from <a href="http://labs.shmu.org.uk/nagmap/">project&#8217;s download section</a> and unpack it somewhere on the server that hosts Nagios monitoring system. Downloaded tarball contains PHP scripts which will access Nagios&#8217;s status file and show corresponding markers on the map using Google Maps. I suggest to create new subdir in directory where Nagios files are located:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>nagios<span style="color: #000000; font-weight: bold;">/</span>
<span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>labs.shmu.org.uk<span style="color: #000000; font-weight: bold;">/</span>nagmap<span style="color: #000000; font-weight: bold;">/</span>nagmap-<span style="color: #000000;">0.11</span>.tar.gz
<span style="color: #c20cb9; font-weight: bold;">tar</span> <span style="color: #660033;">-xvzf</span> nagmap-<span style="color: #000000;">0.11</span>.tar.gz
<span style="color: #c20cb9; font-weight: bold;">rm</span> nagmap-<span style="color: #000000;">0.11</span>.tar.gz</pre></div></div>

<p>Once unpacked the archive it&#8217;s necessary to set path to Nagios status file in Nagmap&#8217;s file <em>status.php</em>. In my case Nagios&#8217;s status.dat file is located at <em>/var/nagios/status.dat</em> so I have the following line in nagmap&#8217;s <em>status.php</em>:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$fp</span> <span style="color: #339933;">=</span> <span style="color: #990000;">fopen</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;/var/nagios/status.dat&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;r&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>It&#8217;s natural that web server must have enough rights to read <em>/var/nagios/status.dat</em> file.</p>
<p>The next step is to set up geographical location for the hosts which should be shown at Nagmap. It should be specified in the following way:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">define host <span style="color: #7a0874; font-weight: bold;">&#123;</span>
        use generic-host
        host_name HostName1
        address 11.22.33.44
        notes latlng: <span style="color: #000000;">40.664167</span>, -<span style="color: #000000;">73.938611</span>
        check_command check-host-alive
        register <span style="color: #000000;">1</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span></pre></div></div>

<p>Where &#8220;40.664167, -73.938611&#8243; is longitude and latitude of the host (New York city in this example). So you should add &#8216;notes latlng:&#8217; lines to all host in Nagios to see them on the map.</p>
<p>From this point you should be able to open the map, e.g. https://your.server.com/nagios/nagmap/ URL. If opened page is empty then there is some problem in reading or parsing status.dat file. Unfortunately nagmap doesn&#8217;t provide debug feature so you should open marker.php (e.g. https://your.server.com/nagios/nagmap/marker.php) and look into its output to see where&#8217;s the problem. Most probably you&#8217;ll need some basic PHP knowledge. Btw, file marker.php contains paths to marker images so you can easily change them from default there.</p>
<div style='clear:both'></div><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/linuxscrew?a=u0BGL38-CmI:L8DTLi_T0sU:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/linuxscrew?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/linuxscrew?a=u0BGL38-CmI:L8DTLi_T0sU:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/linuxscrew?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/linuxscrew?a=u0BGL38-CmI:L8DTLi_T0sU:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/linuxscrew?i=u0BGL38-CmI:L8DTLi_T0sU:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/linuxscrew?a=u0BGL38-CmI:L8DTLi_T0sU:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/linuxscrew?i=u0BGL38-CmI:L8DTLi_T0sU:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/linuxscrew?a=u0BGL38-CmI:L8DTLi_T0sU:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/linuxscrew?d=dnMXMwOfBR0" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/linuxscrew/~4/u0BGL38-CmI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.linuxscrew.com/2012/07/02/nagios-map-geolocation/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		<feedburner:origLink>http://www.linuxscrew.com/2012/07/02/nagios-map-geolocation/</feedburner:origLink></item>
		<item>
		<title>Top 5 Password Managers for Linux [Guest Post]</title>
		<link>http://feedproxy.google.com/~r/linuxscrew/~3/4Eog24xw4vQ/</link>
		<comments>http://www.linuxscrew.com/2012/05/16/top-5-password-managers-for-linux-guest-post/#comments</comments>
		<pubDate>Wed, 16 May 2012 07:33:58 +0000</pubDate>
		<dc:creator>Artem Nosulchik</dc:creator>
				<category><![CDATA[applications]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[encryption]]></category>
		<category><![CDATA[keepassx]]></category>
		<category><![CDATA[password manager]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.linuxscrew.com/?p=1717</guid>
		<description>In this post you will find set of password managers for Linux which provides secure storage for your passwords for sensitive data. If you still keep the passwords in plain text then you must consider one of available password managers so this article is for you. KeePassX KeePassX has been a very popular and famous password manager for Linux for a very long time and still trusted by pretty big [...]</description>
			<content:encoded><![CDATA[<p>In this post you will find set of password managers for Linux which provides secure storage for your passwords for sensitive data. If you still keep the passwords in plain text then you must consider one of available password managers so this article is for you.</p>
<h3>KeePassX</h3>
<p><a href="http://www.keepassx.org/">KeePassX</a> has been a very popular and famous password manager for Linux for a very long time and still trusted by pretty big number of users. When user launches the KeePassX password manager first it requires to set up of a master password to add an extra layer of security to password storage. As an option you can use a file with encryption key instead of the password. This key file can be used along with the master password to provide stronger security. KeePassX application is rather simple so you can easily create one or more databases which will have a master password and will contain all the login credentials stored encrypted. This manager is considered to be one of the most secure managers. If you&#8217;re Ubuntu user just type in terminal the following command:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> keepassx</pre></div></div>

<h3>GPassword Manager</h3>
<p><a href="http://sourceforge.net/projects/gpasswordman/">Gpassword Manager</a> (GPM) is also one of the most secure and highly rated password managers which have more friendly and easy to use interface that KeePassX. This utility has many features that make it to be a good choice for most of the high level computer users. This password manager allows to set and add favorites into system-tray that is one of the unique features of this application. GPM utility uses the crypto++ method for encryption which can be used in Windows and Linux hence it enables the same database to be used on different platforms without the need to convert anything.</p>
<h3>My Passwords</h3>
<p><a href="http://sourceforge.net/projects/mypasswords7/">My Passwords</a> is a simple and easy to use utility that allows you to store all your login credentials in an encrypted manner within a file. The most exciting feature of this utility are its speed and no requirement of an installation. Encryption algorithm that is used there is AES. Storage in Derby Database format along with AES encryption gives the user the power to create secure and fast password repository. The interface for this utility is fairly simple.</p>
<h3>Fiagaro’s Password Manager 2</h3>
<p><a href="http://als.regnet.cz/fpm2/">Fiagaro’s Password Manager 2</a> is another powerful tool with strong encryption methods that makes it one of the most secure utility for managing passwords in Linux. Fiagaro’s Password Manager 2 uses the AES-256 encryption of the database files which hold all your login credentials (it uses master password that should be set up once you started the program first).</p>
<h3>Gringotts</h3>
<p><a href="http://gringotts.shlomifish.org/">Gringotts</a> is rather old project: its application for Linux/Unix provides the user the possibility to store his or her notes in secure storage encrypted by symmetrical ciphers. Gringotts has a set of eight different algorithms that can be used to encrypt the desired data. This utility also provides different methods for hashing as well as compression. The interface of Gringotts is not as simple as of other password Managers but still easy to use and most effective for old school bearded Unix users.</p>
<div style="padding: 5px;background: #eee;">About the author: Kelly Marsh is a blogger by profession. She loves writing on technology and luxury. Beside this she is fond of technology. Recently an article on <a href="http://www.automotto.com/maruti-ritz.html">Maruti Ritz</a> attracted her attention. These days she is busy in writing an article on <a href="http://www.bornrich.com/entry/johnnie-walker-blue-label-partners-porsche-design-studio-private-bar/">johnnie walker blue.</a></div>
<div style='clear:both'></div><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/linuxscrew?a=4Eog24xw4vQ:7ay-agRHeSo:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/linuxscrew?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/linuxscrew?a=4Eog24xw4vQ:7ay-agRHeSo:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/linuxscrew?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/linuxscrew?a=4Eog24xw4vQ:7ay-agRHeSo:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/linuxscrew?i=4Eog24xw4vQ:7ay-agRHeSo:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/linuxscrew?a=4Eog24xw4vQ:7ay-agRHeSo:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/linuxscrew?i=4Eog24xw4vQ:7ay-agRHeSo:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/linuxscrew?a=4Eog24xw4vQ:7ay-agRHeSo:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/linuxscrew?d=dnMXMwOfBR0" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/linuxscrew/~4/4Eog24xw4vQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.linuxscrew.com/2012/05/16/top-5-password-managers-for-linux-guest-post/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		<feedburner:origLink>http://www.linuxscrew.com/2012/05/16/top-5-password-managers-for-linux-guest-post/</feedburner:origLink></item>
		<item>
		<title>Grub Fallback: Boot good kernel if new one crashes</title>
		<link>http://feedproxy.google.com/~r/linuxscrew/~3/Y2PFh6NmNac/</link>
		<comments>http://www.linuxscrew.com/2012/04/24/grub-fallback-boot-good-kernel-if-new-one-crashes/#comments</comments>
		<pubDate>Tue, 24 Apr 2012 19:51:20 +0000</pubDate>
		<dc:creator>Artem Nosulchik</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[arch]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[fallback]]></category>
		<category><![CDATA[fedora]]></category>
		<category><![CDATA[grub]]></category>
		<category><![CDATA[rhel]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.linuxscrew.com/?p=1701</guid>
		<description>It&amp;#8217;s hard to believe but I didn&amp;#8217;t know about Grub fallback feature. So every time when I needed to reboot remote server into a new kernel I had to test it on local server to make sure it won&amp;#8217;t panic on remote unit. And if kernel panic still happened I had to ask somebody who has physical access to the server to reboot the hardware choose proper kernel in Grub. [...]</description>
			<content:encoded><![CDATA[<p>It&#8217;s hard to believe but I didn&#8217;t know about <strong>Grub fallback</strong> feature. So every time when I needed to reboot remote server into a new kernel I had to test it on local server to make sure it won&#8217;t panic on remote unit. And if kernel panic still happened I had to ask somebody who has physical access to the server to reboot the hardware choose proper kernel in Grub. It&#8217;s all boring and not healthful – it&#8217;s much better to use Grub&#8217;s native fallback feature.</p>
<p>Grub is default boot loader in most Linux distributions today, at least major distros like Centos/Fedora/RedHat, Debian/Ubuntu/Mint, Arch use Grub. This makes it possible to use <a href="http://www.gnu.org/software/grub/manual/legacy/Booting-fallback-systems.html">Grub fallback</a> feature just out of the box. Here is example scenario.</p>
<p>There is remote server hosted in New Zealand and you (sitting in Denmark) have access to it over the network only (no console server). In this case you cannot afford that the new kernel makes server unreachable, e.g. if new kernel crash during boot it won&#8217;t load network interface drivers so your Linux box won&#8217;t appear online until somebody reboots it into workable kernel. Thankfully Grub can be configured to try loading new kernel once and if it fails Grub will load another kernel according to configuration. You can see my example grub.conf below:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #007800;">default</span>=saved
<span style="color: #007800;">timeout</span>=<span style="color: #000000;">5</span>
<span style="color: #007800;">splashimage</span>=<span style="color: #7a0874; font-weight: bold;">&#40;</span>hd0,<span style="color: #000000;">1</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #000000; font-weight: bold;">/</span>boot<span style="color: #000000; font-weight: bold;">/</span>grub<span style="color: #000000; font-weight: bold;">/</span>splash.xpm.gz
hiddenmenu
fallback <span style="color: #000000;">0</span> <span style="color: #000000;">1</span>
title Fedora OpenVZ <span style="color: #7a0874; font-weight: bold;">&#40;</span>2.6.32-042stab053.5<span style="color: #7a0874; font-weight: bold;">&#41;</span>
        root <span style="color: #7a0874; font-weight: bold;">&#40;</span>hd0,<span style="color: #000000;">1</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
        kernel <span style="color: #000000; font-weight: bold;">/</span>boot<span style="color: #000000; font-weight: bold;">/</span>vmlinuz-2.6.32-042stab053.5 ro <span style="color: #007800;">root</span>=<span style="color: #007800;">UUID</span>=6fbdddf9-307c-49eb-83f5-ca1a4a63f584 <span style="color: #007800;">rd_MD_UUID</span>=1b9dc11a:d5a084b5:83f6d993:3366bbe4 rd_NO_LUKS rd_NO_LVM rd_NO_DM <span style="color: #007800;">LANG</span>=en_US.UTF-<span style="color: #000000;">8</span> <span style="color: #007800;">SYSFONT</span>=latarcyrheb-sun16 <span style="color: #007800;">KEYTABLE</span>=sv-latin1 rhgb quiet <span style="color: #007800;">crashkernel</span>=auto
        initrd <span style="color: #000000; font-weight: bold;">/</span>boot<span style="color: #000000; font-weight: bold;">/</span>initramfs-2.6.32-042stab053.5.img
        savedefault fallback
title Fedora <span style="color: #7a0874; font-weight: bold;">&#40;</span>2.6.35.12-<span style="color: #000000;">88</span>.fc14.i686<span style="color: #7a0874; font-weight: bold;">&#41;</span>
        root <span style="color: #7a0874; font-weight: bold;">&#40;</span>hd0,<span style="color: #000000;">1</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
        kernel <span style="color: #000000; font-weight: bold;">/</span>boot<span style="color: #000000; font-weight: bold;">/</span>vmlinuz-2.6.35.12-<span style="color: #000000;">88</span>.fc14.i686 ro <span style="color: #007800;">root</span>=<span style="color: #007800;">UUID</span>=6fbdddf9-307c-49eb-83f5-ca1a4a63f584 <span style="color: #007800;">rd_MD_UUID</span>=1b9dc11a:d5a084b5:83f6d993:3366bbe4 rd_NO_LUKS rd_NO_LVM rd_NO_DM <span style="color: #007800;">LANG</span>=en_US.UTF-<span style="color: #000000;">8</span> <span style="color: #007800;">SYSFONT</span>=latarcyrheb-sun16 <span style="color: #007800;">KEYTABLE</span>=sv-latin1 rhgb quiet
        initrd <span style="color: #000000; font-weight: bold;">/</span>boot<span style="color: #000000; font-weight: bold;">/</span>initramfs-2.6.35.12-<span style="color: #000000;">88</span>.fc14.i686.img
        savedefault fallback</pre></div></div>

<p>According to this configuration Grub will try to load &#8216;Fedora OpenVZ&#8217; kernel once and if it fails system will be loaded into good &#8216;Fedora&#8217; kernel. If &#8216;Fedora OpenVZ&#8217; loads well you&#8217;ll be able to reach the server over the network after reboot. Notice lines <em>&#8216;default=saved&#8217;</em> and <em>&#8216;savedefault fallback&#8217;</em> which are mandatory to make fallback feature working.</p>
<h4>Alternative way</h4>
<p>I&#8217;ve heard that official Grub fallback feature may work incorrectly on RHEL5 (and Centos 5) so there is elegant workaround (found <a href="http://nfolamp.wordpress.com/2010/08/12/configuring-grub-to-boot-a-fallback-kernel/">here</a>):</p>
<p>1. Add param &#8216;panic=5&#8242; to your new kernel line so it looks like below:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">title Fedora OpenVZ <span style="color: #7a0874; font-weight: bold;">&#40;</span>2.6.32-042stab053.5<span style="color: #7a0874; font-weight: bold;">&#41;</span>
        root <span style="color: #7a0874; font-weight: bold;">&#40;</span>hd0,<span style="color: #000000;">1</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
        kernel <span style="color: #000000; font-weight: bold;">/</span>boot<span style="color: #000000; font-weight: bold;">/</span>vmlinuz-2.6.32-042stab053.5 ro <span style="color: #007800;">root</span>=<span style="color: #007800;">UUID</span>=6fbdddf9-307c-49eb-83f5-ca1a4a63f584 <span style="color: #007800;">rd_MD_UUID</span>=1b9dc11a:d5a084b5:83f6d993:3366bbe4 rd_NO_LUKS rd_NO_LVM rd_NO_DM <span style="color: #007800;">LANG</span>=en_US.UTF-<span style="color: #000000;">8</span> <span style="color: #007800;">SYSFONT</span>=latarcyrheb-sun16 <span style="color: #007800;">KEYTABLE</span>=sv-latin1 rhgb quiet <span style="color: #007800;">crashkernel</span>=auto <span style="color: #007800;">panic</span>=<span style="color: #000000;">5</span>
        initrd <span style="color: #000000; font-weight: bold;">/</span>boot<span style="color: #000000; font-weight: bold;">/</span>initramfs-2.6.32-042stab053.5.img</pre></div></div>

<p>This param will make crashed kernel to reboot itself in 5 seconds.</p>
<p>2. Point <em>default</em> Grub param to good kernel, e.g. &#8216;default=0&#8242;.</p>
<p>3. Type in the following commands (good kernel appears in grub.conf first and new kernel is second one):</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># grub</span>
&nbsp;
grub<span style="color: #000000; font-weight: bold;">&gt;</span> savedefault <span style="color: #660033;">--default</span>=<span style="color: #000000;">1</span> <span style="color: #660033;">--once</span>
savedefault <span style="color: #660033;">--default</span>=<span style="color: #000000;">1</span> <span style="color: #660033;">--once</span>
grub<span style="color: #000000; font-weight: bold;">&gt;</span> quit</pre></div></div>

<p>This will make Grub to boot into new kernel once and if it fails it will load good kernel. Now you can reboot the server and make sure it will 100% appear online in a few minutes. I usually prefer native Grub fallback feature but if you see it doesn&#8217;t work for you it makes sense to try above mentioned workaround.</p>
<div style='clear:both'></div><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/linuxscrew?a=Y2PFh6NmNac:XZwHrKXDLOU:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/linuxscrew?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/linuxscrew?a=Y2PFh6NmNac:XZwHrKXDLOU:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/linuxscrew?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/linuxscrew?a=Y2PFh6NmNac:XZwHrKXDLOU:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/linuxscrew?i=Y2PFh6NmNac:XZwHrKXDLOU:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/linuxscrew?a=Y2PFh6NmNac:XZwHrKXDLOU:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/linuxscrew?i=Y2PFh6NmNac:XZwHrKXDLOU:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/linuxscrew?a=Y2PFh6NmNac:XZwHrKXDLOU:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/linuxscrew?d=dnMXMwOfBR0" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/linuxscrew/~4/Y2PFh6NmNac" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.linuxscrew.com/2012/04/24/grub-fallback-boot-good-kernel-if-new-one-crashes/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://www.linuxscrew.com/2012/04/24/grub-fallback-boot-good-kernel-if-new-one-crashes/</feedburner:origLink></item>
		<item>
		<title>Why Mosh is better than SSH?</title>
		<link>http://feedproxy.google.com/~r/linuxscrew/~3/pMV-s-PT4EI/</link>
		<comments>http://www.linuxscrew.com/2012/04/11/why-mosh-is-better-than-ssh/#comments</comments>
		<pubDate>Wed, 11 Apr 2012 20:17:52 +0000</pubDate>
		<dc:creator>Artem Nosulchik</dc:creator>
				<category><![CDATA[applications]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[freebsd]]></category>
		<category><![CDATA[gentoo]]></category>
		<category><![CDATA[mac os x]]></category>
		<category><![CDATA[mosh]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.linuxscrew.com/?p=1688</guid>
		<description>Mosh (stands for Mobile Shell) is replacement of SSH for remote connections to Unix/Linux systems. It brings a few noticeable advantages over well known SSH connections. In brief, it&amp;#8217;s faster and more responsive, especially on long delay and/or unreliable links. Key benefits of Mosh Stays connected if your IP is changed. Roaming feature of Mosh allows you to move between Internet connections and keep Mosh session online. For example, if [...]</description>
			<content:encoded><![CDATA[<p><strong>Mosh</strong> (stands for Mobile Shell) is replacement of SSH for remote connections to <a href="http://www.linuxscrew.com/category/unix/">Unix</a>/<a href="http://www.linuxscrew.com/category/linux/">Linux</a> systems. It brings a few noticeable advantages over well known SSH connections. In brief, it&#8217;s faster and more responsive, especially on long delay and/or unreliable links.</p>
<h4>Key benefits of Mosh</h4>
<ul>
<li><strong>Stays connected if your IP is changed</strong>. Roaming feature of Mosh allows you to move between Internet connections and keep Mosh session online. For example, if your wifi connection changes IP you don&#8217;t need to reconnect.</li>
<li><strong>Keeps session after loosing connection</strong>. For example, if you lost Internet connection for some time, or your laptop went offline due to exhausted battery – you&#8217;ll be able to pick up previously opened Mosh session easily.</li>
<li><strong>No root rights needed to use Mosh</strong>. Unlike SSH Mosh server is not a daemon that needs to listen on specific port to accept incoming connections from clients. Mosh server and client are executables that could be run by ordinary user.</li>
<li><strong>The same credentials for remote login</strong>. Mosh uses SSH for authorization so in order to open connection you need the same credentials as before.</li>
<li><strong>Responsive Ctrl+C combination</strong>. Unlike SSH Mosh doesn&#8217;t fill up network buffers so even if you accidentally requested to output 100 MB file you&#8217;ll be able to hit Ctrl+C and stop it immediately.</li>
<li><strong>Better for slow or lagged links</strong>. Have you ever tried to use SSH on satellite link where average RTT is 600 ms or more? Wish Mosh you don&#8217;t need to wait until server replies to see your typing. It works in CLI and such programs as vi or emacs so on it makes it possible to do the job slow connections more comfortably.</li>
</ul>
<p>Well, there are some disadvantages too:</p>
<ul>
<li>No IPv6 support.</li>
<li>UTF-8 only.</li>
</ul>
<p>Mosh is <a href="http://mosh.mit.edu/#getting">available</a> for all major Linux distributions, FreeBSD and Mac OS X systems:</p>
<p><strong>Ubuntu</strong> (12.04 LTS) or <strong>Debian</strong> (testing/unstable): <code>sudo apt-get install mosh</code><br />
<strong>Gentoo</strong>: <code>emerge net-misc/mosh</code><br />
<strong>Arch Linux</strong>: <code>packer -S mobile-shell-git</code><br />
<strong>FreeBSD</strong>: <code>portmaster net/mosh</code><br />
<strong>Mac OS X</strong>: <code><a href="https://github.com/downloads/keithw/mosh/mosh-1.1.3-2.pkg">mosh-1.1.3-2.pkg</a></code><br />
<strong>Sources</strong>: <a href="https://github.com/downloads/keithw/mosh/mosh-1.1.3-2.pkg">mosh-1.1.3.tar.gz</a></p>
<p><a href="http://mosh.mit.edu/">Project&#8217;s website</a></p>
<p>P.S. It&#8217;s better that combination of SSH and <a href="http://www.gnu.org/software/screen/">GNU Screen</a>.</p>
<p><img class="aligncenter size-full wp-image-1693" title="Mosh screenshot" src="http://www.linuxscrew.com/wp-content/uploads/2012/04/mosh.png" alt="Mosh screenshot" width="477" height="427" /></p>
<div style='clear:both'></div><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/linuxscrew?a=pMV-s-PT4EI:ewMX5q2b6tc:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/linuxscrew?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/linuxscrew?a=pMV-s-PT4EI:ewMX5q2b6tc:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/linuxscrew?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/linuxscrew?a=pMV-s-PT4EI:ewMX5q2b6tc:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/linuxscrew?i=pMV-s-PT4EI:ewMX5q2b6tc:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/linuxscrew?a=pMV-s-PT4EI:ewMX5q2b6tc:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/linuxscrew?i=pMV-s-PT4EI:ewMX5q2b6tc:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/linuxscrew?a=pMV-s-PT4EI:ewMX5q2b6tc:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/linuxscrew?d=dnMXMwOfBR0" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/linuxscrew/~4/pMV-s-PT4EI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.linuxscrew.com/2012/04/11/why-mosh-is-better-than-ssh/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
		<feedburner:origLink>http://www.linuxscrew.com/2012/04/11/why-mosh-is-better-than-ssh/</feedburner:origLink></item>
		<item>
		<title>Add physical NIC to XenServer</title>
		<link>http://feedproxy.google.com/~r/linuxscrew/~3/iZMXtOm7A_E/</link>
		<comments>http://www.linuxscrew.com/2012/04/09/add-physical-xenserver/#comments</comments>
		<pubDate>Mon, 09 Apr 2012 13:12:44 +0000</pubDate>
		<dc:creator>Artem Nosulchik</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[virtualization]]></category>
		<category><![CDATA[nics]]></category>
		<category><![CDATA[xenserver]]></category>

		<guid isPermaLink="false">http://www.linuxscrew.com/?p=1675</guid>
		<description>If you add new physical network interface to the hardware that runs XenServer it won&amp;#8217;t appear in XenCenter by default. In order to attach it to VMs or change its settings you&amp;#8217;ll need to type in a few commands to XenServer&amp;#8217;s CLI. 1. Connect XenServer via SSH using root rights: ssh root@192.168.10.1 -v 2. Make sure that new NIC is attached to hardware and detected by Linux, in below command&amp;#8217;s [...]</description>
			<content:encoded><![CDATA[<p>If you add new physical network interface to the hardware that runs <a href="http://www.linuxscrew.com/tag/xenserver">XenServer</a> it won&#8217;t appear in XenCenter by default.</p>
<p>In order to attach it to VMs or change its settings you&#8217;ll need to type in a few commands to XenServer&#8217;s CLI.</p>
<p>1. Connect XenServer via SSH using root rights:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">ssh</span> root<span style="color: #000000; font-weight: bold;">@</span>192.168.10.1 <span style="color: #660033;">-v</span></pre></div></div>

<p>2. Make sure that new NIC is attached to hardware and detected by Linux, in below command&#8217;s output you can see there are three Ethernet controllers (the last one was just attached to hardware):</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>localhost ~<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># lspci  | grep -i ethernet</span>
<span style="color: #000000;">10</span>:<span style="color: #000000;">00.0</span> Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111<span style="color: #000000; font-weight: bold;">/</span>8168B PCI Express Gigabit Ethernet controller <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">rev</span> 01<span style="color: #7a0874; font-weight: bold;">&#41;</span>
1e:<span style="color: #000000;">00.0</span> Ethernet controller: Broadcom Corporation NetXtreme BCM5723 Gigabit Ethernet PCIe <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">rev</span> <span style="color: #000000;">10</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #000000;">30</span>:<span style="color: #000000;">00.0</span> Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-<span style="color: #000000;">8139</span><span style="color: #000000; font-weight: bold;">/</span>8139C<span style="color: #000000; font-weight: bold;">/</span>8139C+ <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">rev</span> <span style="color: #000000;">10</span><span style="color: #7a0874; font-weight: bold;">&#41;</span></pre></div></div>

<p>As you can see this NIC isn&#8217;t shown in XenCenter and below command doesn&#8217;t show its UID among detected interfaces:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">root<span style="color: #000000; font-weight: bold;">@</span>localhost ~<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># xe pif-list</span>
uuid <span style="color: #7a0874; font-weight: bold;">&#40;</span> RO<span style="color: #7a0874; font-weight: bold;">&#41;</span>                  : 095abcc1-4d64-<span style="color: #000000;">7925</span>-200f-a91d558ec872
                device <span style="color: #7a0874; font-weight: bold;">&#40;</span> RO<span style="color: #7a0874; font-weight: bold;">&#41;</span>: eth1
    currently-attached <span style="color: #7a0874; font-weight: bold;">&#40;</span> RO<span style="color: #7a0874; font-weight: bold;">&#41;</span>: <span style="color: #c20cb9; font-weight: bold;">true</span>
                  VLAN <span style="color: #7a0874; font-weight: bold;">&#40;</span> RO<span style="color: #7a0874; font-weight: bold;">&#41;</span>: <span style="color: #660033;">-1</span>
          network-uuid <span style="color: #7a0874; font-weight: bold;">&#40;</span> RO<span style="color: #7a0874; font-weight: bold;">&#41;</span>: 9da74476-ffcb-<span style="color: #000000;">6824</span>-25ad-62d46f34e252
&nbsp;
uuid <span style="color: #7a0874; font-weight: bold;">&#40;</span> RO<span style="color: #7a0874; font-weight: bold;">&#41;</span>                  : 555844b2-<span style="color: #000000;">4061</span>-47e0-52ef-01e42f182eef
                device <span style="color: #7a0874; font-weight: bold;">&#40;</span> RO<span style="color: #7a0874; font-weight: bold;">&#41;</span>: eth0
    currently-attached <span style="color: #7a0874; font-weight: bold;">&#40;</span> RO<span style="color: #7a0874; font-weight: bold;">&#41;</span>: <span style="color: #c20cb9; font-weight: bold;">true</span>
                  VLAN <span style="color: #7a0874; font-weight: bold;">&#40;</span> RO<span style="color: #7a0874; font-weight: bold;">&#41;</span>: <span style="color: #660033;">-1</span>
          network-uuid <span style="color: #7a0874; font-weight: bold;">&#40;</span> RO<span style="color: #7a0874; font-weight: bold;">&#41;</span>: 90a0e347-<span style="color: #000000;">9246</span>-7ac9-c939-30983602c14e</pre></div></div>

<p>As well as no new eth2 in ifconfig&#8217;s output</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>localhost ~<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># ifconfig     </span>
eth0      Link encap:Ethernet  HWaddr <span style="color: #000000;">68</span>:B5:<span style="color: #000000;">99</span>:E3:1C:<span style="color: #000000;">56</span>  
          UP BROADCAST RUNNING MULTICAST  MTU:<span style="color: #000000;">1500</span>  Metric:<span style="color: #000000;">1</span>
          RX packets:<span style="color: #000000;">1953</span> errors:<span style="color: #000000;">0</span> dropped:<span style="color: #000000;">0</span> overruns:<span style="color: #000000;">0</span> frame:<span style="color: #000000;">0</span>
          TX packets:<span style="color: #000000;">2475</span> errors:<span style="color: #000000;">0</span> dropped:<span style="color: #000000;">0</span> overruns:<span style="color: #000000;">0</span> carrier:<span style="color: #000000;">0</span>
          collisions:<span style="color: #000000;">0</span> txqueuelen:<span style="color: #000000;">1000</span> 
          RX bytes:<span style="color: #000000;">201110</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">196.3</span> KiB<span style="color: #7a0874; font-weight: bold;">&#41;</span>  TX bytes:<span style="color: #000000;">1929408</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">1.8</span> MiB<span style="color: #7a0874; font-weight: bold;">&#41;</span>
          Interrupt:<span style="color: #000000;">19</span> 
&nbsp;
eth1      Link encap:Ethernet  HWaddr 00:<span style="color: #000000;">30</span>:4F:<span style="color: #000000;">33</span>:<span style="color: #000000;">43</span>:6E  
          UP BROADCAST RUNNING MULTICAST  MTU:<span style="color: #000000;">1500</span>  Metric:<span style="color: #000000;">1</span>
          RX packets:<span style="color: #000000;">110</span> errors:<span style="color: #000000;">0</span> dropped:<span style="color: #000000;">0</span> overruns:<span style="color: #000000;">0</span> frame:<span style="color: #000000;">0</span>
          TX packets:<span style="color: #000000;">0</span> errors:<span style="color: #000000;">0</span> dropped:<span style="color: #000000;">0</span> overruns:<span style="color: #000000;">0</span> carrier:<span style="color: #000000;">0</span>
          collisions:<span style="color: #000000;">0</span> txqueuelen:<span style="color: #000000;">1000</span> 
          RX bytes:<span style="color: #000000;">14435</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">14.0</span> KiB<span style="color: #7a0874; font-weight: bold;">&#41;</span>  TX bytes:<span style="color: #000000;">0</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">0.0</span> b<span style="color: #7a0874; font-weight: bold;">&#41;</span>
          Interrupt:<span style="color: #000000;">17</span> Base address:0xe000</pre></div></div>


<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>localhost ~<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># ifconfig eth2</span>
<span style="color: #c20cb9; font-weight: bold;">ifconfig</span>: interface eth2 does not exist</pre></div></div>

<p>3. Solution is pretty easy – you just need to find out UUID of XenServer host to which you&#8217;d like to attach new NIC. You can do it by the following commands:</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>localhost ~<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># xe host-list </span>
uuid <span style="color: #7a0874; font-weight: bold;">&#40;</span> RO<span style="color: #7a0874; font-weight: bold;">&#41;</span>                : c5ab0df3-440a-<span style="color: #000000;">4164</span>-b1a4-6febf1ff0052
          name-label <span style="color: #7a0874; font-weight: bold;">&#40;</span> RW<span style="color: #7a0874; font-weight: bold;">&#41;</span>: XenServer HP Proliant ML <span style="color: #000000;">110</span>
    name-description <span style="color: #7a0874; font-weight: bold;">&#40;</span> RW<span style="color: #7a0874; font-weight: bold;">&#41;</span>: Default <span style="color: #c20cb9; font-weight: bold;">install</span> of XenServer</pre></div></div>

<p>and</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>localhost ~<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># xe pif-scan host-uuid=c5ab0df3-440a-4164-b1a4-6febf1ff0052</span></pre></div></div>

<p>That&#8217;s it, from now you&#8217;ll see new NIC in XenCenter.</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>localhost ~<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># xe pif-list</span>
uuid <span style="color: #7a0874; font-weight: bold;">&#40;</span> RO<span style="color: #7a0874; font-weight: bold;">&#41;</span>                  : 095abcc1-4d64-<span style="color: #000000;">7925</span>-200f-a91d558ec872
                device <span style="color: #7a0874; font-weight: bold;">&#40;</span> RO<span style="color: #7a0874; font-weight: bold;">&#41;</span>: eth1
    currently-attached <span style="color: #7a0874; font-weight: bold;">&#40;</span> RO<span style="color: #7a0874; font-weight: bold;">&#41;</span>: <span style="color: #c20cb9; font-weight: bold;">true</span>
                  VLAN <span style="color: #7a0874; font-weight: bold;">&#40;</span> RO<span style="color: #7a0874; font-weight: bold;">&#41;</span>: <span style="color: #660033;">-1</span>
          network-uuid <span style="color: #7a0874; font-weight: bold;">&#40;</span> RO<span style="color: #7a0874; font-weight: bold;">&#41;</span>: 9da74476-ffcb-<span style="color: #000000;">6824</span>-25ad-62d46f34e252
&nbsp;
uuid <span style="color: #7a0874; font-weight: bold;">&#40;</span> RO<span style="color: #7a0874; font-weight: bold;">&#41;</span>                  : 555844b2-<span style="color: #000000;">4061</span>-47e0-52ef-01e42f182eef
                device <span style="color: #7a0874; font-weight: bold;">&#40;</span> RO<span style="color: #7a0874; font-weight: bold;">&#41;</span>: eth0
    currently-attached <span style="color: #7a0874; font-weight: bold;">&#40;</span> RO<span style="color: #7a0874; font-weight: bold;">&#41;</span>: <span style="color: #c20cb9; font-weight: bold;">true</span>
                  VLAN <span style="color: #7a0874; font-weight: bold;">&#40;</span> RO<span style="color: #7a0874; font-weight: bold;">&#41;</span>: <span style="color: #660033;">-1</span>
          network-uuid <span style="color: #7a0874; font-weight: bold;">&#40;</span> RO<span style="color: #7a0874; font-weight: bold;">&#41;</span>: 90a0e347-<span style="color: #000000;">9246</span>-7ac9-c939-30983602c14e
&nbsp;
uuid <span style="color: #7a0874; font-weight: bold;">&#40;</span> RO<span style="color: #7a0874; font-weight: bold;">&#41;</span>                  : 7f3b59d7-<span style="color: #000000;">1508</span>-835a-b268-4476bbac33d5
                device <span style="color: #7a0874; font-weight: bold;">&#40;</span> RO<span style="color: #7a0874; font-weight: bold;">&#41;</span>: eth2
    currently-attached <span style="color: #7a0874; font-weight: bold;">&#40;</span> RO<span style="color: #7a0874; font-weight: bold;">&#41;</span>: <span style="color: #c20cb9; font-weight: bold;">false</span>
                  VLAN <span style="color: #7a0874; font-weight: bold;">&#40;</span> RO<span style="color: #7a0874; font-weight: bold;">&#41;</span>: <span style="color: #660033;">-1</span>
          network-uuid <span style="color: #7a0874; font-weight: bold;">&#40;</span> RO<span style="color: #7a0874; font-weight: bold;">&#41;</span>: 9584917b-e49a-f075-f1e0-8ba2c4a4bf02</pre></div></div>

<div style='clear:both'></div><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/linuxscrew?a=iZMXtOm7A_E:aPJdo46vdGY:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/linuxscrew?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/linuxscrew?a=iZMXtOm7A_E:aPJdo46vdGY:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/linuxscrew?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/linuxscrew?a=iZMXtOm7A_E:aPJdo46vdGY:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/linuxscrew?i=iZMXtOm7A_E:aPJdo46vdGY:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/linuxscrew?a=iZMXtOm7A_E:aPJdo46vdGY:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/linuxscrew?i=iZMXtOm7A_E:aPJdo46vdGY:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/linuxscrew?a=iZMXtOm7A_E:aPJdo46vdGY:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/linuxscrew?d=dnMXMwOfBR0" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/linuxscrew/~4/iZMXtOm7A_E" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.linuxscrew.com/2012/04/09/add-physical-xenserver/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.linuxscrew.com/2012/04/09/add-physical-xenserver/</feedburner:origLink></item>
	</channel>
</rss>
