<?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:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><title>The Linux Juggernaut</title><link>http://www.linuxnix.com</link><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/TheLinuxJuggernaut" /><description>roles on......</description><language>en</language><lastBuildDate>Sat, 11 Feb 2012 21:50:22 PST</lastBuildDate><generator>http://wordpress.org/?v=3.3</generator><sy:updatePeriod xmlns:sy="http://purl.org/rss/1.0/modules/syndication/">hourly</sy:updatePeriod><sy:updateFrequency xmlns:sy="http://purl.org/rss/1.0/modules/syndication/">1</sy:updateFrequency><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/TheLinuxJuggernaut" /><feedburner:info uri="thelinuxjuggernaut" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><geo:lat>18.50704</geo:lat><geo:long>73.83448</geo:long><feedburner:emailServiceId>TheLinuxJuggernaut</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%2FTheLinuxJuggernaut" 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%2FTheLinuxJuggernaut" 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%2FTheLinuxJuggernaut" 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/TheLinuxJuggernaut" 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%2FTheLinuxJuggernaut" 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%2FTheLinuxJuggernaut" 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%2FTheLinuxJuggernaut" src="http://www.pageflakes.com/ImageFile.ashx?instanceId=Static_4&amp;fileName=ATP_blu_91x17.gif">Subscribe with Pageflakes</feedburner:feedFlare><feedburner:feedFlare href="http://www.plusmo.com/add?url=http%3A%2F%2Ffeeds.feedburner.com%2FTheLinuxJuggernaut" src="http://plusmo.com/res/graphics/fbplusmo.gif">Subscribe with Plusmo</feedburner:feedFlare><feedburner:feedFlare href="http://www.thefreedictionary.com/_/hp/AddRSS.aspx?http%3A%2F%2Ffeeds.feedburner.com%2FTheLinuxJuggernaut" src="http://img.tfd.com/hp/addToTheFreeDictionary.gif">Subscribe with The Free Dictionary</feedburner:feedFlare><feedburner:feedFlare href="http://www.bitty.com/manual/?contenttype=rssfeed&amp;contentvalue=http%3A%2F%2Ffeeds.feedburner.com%2FTheLinuxJuggernaut" src="http://www.bitty.com/img/bittychicklet_91x17.gif">Subscribe with Bitty Browser</feedburner:feedFlare><feedburner:feedFlare href="http://www.live.com/?add=http%3A%2F%2Ffeeds.feedburner.com%2FTheLinuxJuggernaut" src="http://tkfiles.storage.msn.com/x1piYkpqHC_35nIp1gLE68-wvzLZO8iXl_JMledmJQXP-XTBOLfmQv4zhj4MhcWEJh_GtoBIiAl1Mjh-ndp9k47If7hTaFno0mxW9_i3p_5qQw">Subscribe with Live.com</feedburner:feedFlare><feedburner:feedFlare href="http://mix.excite.eu/add?feedurl=http%3A%2F%2Ffeeds.feedburner.com%2FTheLinuxJuggernaut" src="http://image.excite.co.uk/mix/addtomix.gif">Subscribe with Excite MIX</feedburner:feedFlare><feedburner:feedFlare href="http://www.webwag.com/wwgthis.php?url=http%3A%2F%2Ffeeds.feedburner.com%2FTheLinuxJuggernaut" src="http://www.webwag.com/images/wwgthis.gif">Subscribe with Webwag</feedburner:feedFlare><feedburner:feedFlare href="http://www.podcastready.com/oneclick_bookmark.php?url=http%3A%2F%2Ffeeds.feedburner.com%2FTheLinuxJuggernaut" src="http://www.podcastready.com/images/podcastready_button.gif">Subscribe with Podcast Ready</feedburner:feedFlare><feedburner:feedFlare href="http://www.wikio.com/subscribe?url=http%3A%2F%2Ffeeds.feedburner.com%2FTheLinuxJuggernaut" src="http://www.wikio.com/shared/img/add2wikio.gif">Subscribe with Wikio</feedburner:feedFlare><feedburner:feedFlare href="http://www.dailyrotation.com/index.php?feed=http%3A%2F%2Ffeeds.feedburner.com%2FTheLinuxJuggernaut" src="http://www.dailyrotation.com/rss-dr2.gif">Subscribe with Daily Rotation</feedburner:feedFlare><feedburner:feedFlare href="http://www.flurry.com/pushRssFeed.do?r=fb&amp;url=http%3A%2F%2Ffeeds.feedburner.com%2FTheLinuxJuggernaut" src="http://www.flurry.com/images/flurry_rss_logo2.gif">Subscribe with Flurry</feedburner:feedFlare><feedburner:feedFlare href="http://www.newsalloy.com/?rss=http%3A%2F%2Ffeeds.feedburner.com%2FTheLinuxJuggernaut" src="http://www.newsalloy.com/subrss3.gif">Subscribe with NewsAlloy</feedburner:feedFlare><feedburner:feedFlare href="http://download.attensa.com/app/get_attensa.html?feedurl=http%3A%2F%2Ffeeds.feedburner.com%2FTheLinuxJuggernaut" src="http://www.attensa.com/blogs/attensa/WindowsLiveWriter/BadgeredintoBadges_10C02/attensa_feed_button5.gif">Subscribe with Attensa for Outlook</feedburner:feedFlare><feedburner:browserFriendly>--Please visit http://forums.linuxnix.com for your Linux/Unix issues and http://jobs.linuxnix.com for latest Linux Admin Jobs.</feedburner:browserFriendly><item><title>Linux/Unix redirection operators(File descriptors) explained with examples</title><link>http://feedproxy.google.com/~r/TheLinuxJuggernaut/~3/zmTtMSv1b10/linuxunix-redirection-operatorsfile-descriptors-explained-examples.html</link><category>Scripting</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Surendra Anne</dc:creator><pubDate>Thu, 09 Feb 2012 05:34:10 PST</pubDate><guid isPermaLink="false">http://www.linuxnix.com/?p=1342</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[
<p><a href="http://feedads.g.doubleclick.net/~a/VFoVEkTQmlI3wMuofkVk6c96JmA/0/da"><img src="http://feedads.g.doubleclick.net/~a/VFoVEkTQmlI3wMuofkVk6c96JmA/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/VFoVEkTQmlI3wMuofkVk6c96JmA/1/da"><img src="http://feedads.g.doubleclick.net/~a/VFoVEkTQmlI3wMuofkVk6c96JmA/1/di" border="0" ismap="true"></img></a></p><p style="text-align: center;"><span style="color: #ff0000;"> <strong><span style="text-decoration: underline;">Redirecting operators in Linux</span></strong></span></p>
<p align="center"> In order to understand about Redirecting operators in Linux we should know how we communicate with a computer. When we are communicating with a computer there should be a way to do it and this is achieved by <strong>STDIN (0), STDOUT (1), STDERR (2) file descriptors</strong>. There are numbers assigned to these file descriptors as shown below.</p>
<pre><strong>STDIN --&gt; 0 </strong>
<strong>STDOUT  --&gt; </strong><strong>1 </strong>
<strong>STDERR --&gt; 2</strong></pre>
<p>We will see what actually these redirection operators in detail.</p>
<p><strong>STDIN:</strong> stands for <strong>ST</strong>andar<strong>D IN</strong>put. By using this we can give an input to the computer to do some task. Whatever device we used to give input to a computer will come under <strong>STDIN.</strong></p>
<p>A STDIN can be</p>
<pre><strong>A keyboard </strong>
<strong>A mouse </strong>
<strong>A scanner </strong>
<strong>A floppy </strong>
<strong>A CD/DVD ROM </strong>
<strong>A touch screen </strong>
<strong>A barcode reader </strong>
<strong>Or a card reader</strong></pre>
<p><strong>STDOUT:</strong> The abbreviation is <strong>St</strong>andar<strong>D OUT</strong>put. By using this we can see the output from a computer. Whatever device we used to get the output from a computer will come under this <strong>STDOUT</strong>.</p>
<p>A STDOUT can be</p>
<pre><strong>A monitor </strong>
<strong>A speaker </strong>
<strong>Or a printer</strong></pre>
<p><strong>STDERR:</strong> This is abbreviated as <strong>ST</strong>andar<strong>D ERR</strong>or. By using this, A computer can communicate with user to give him warning/error etc that something went wrong. A <strong>STDERR</strong> can be</p>
<pre><strong>A monitor </strong>
<strong>A printer </strong>
<strong>A log file </strong>
<strong>A LED indicator </strong>
<strong>Or a speaker</strong></pre>
<p><strong>Why we require redirecting operators?</strong></p>
<p><strong> </strong>We require redirecting operators in some situations where our <strong>standard communication</strong> will not meet our requirement. For example sometimes we want to move an error which is popping on a screen to a file for future reference. So at that time we can use these redirecting operators to change the default way of communication between users and computers.</p>
<p>In Linux there are many redirecting operators (File descriptors) as shown below</p>
<p><strong>Basic redirecting operators</strong></p>
<pre><strong> &gt; --Output redirecting operator </strong>
<strong>&lt; --Input redirecting operator </strong>
<strong>&gt;&gt; --Output appending operator. </strong>
<strong>&lt;&lt; --Input appending operator (no significant practical use) </strong>
<strong>| --Pipe operator, redirects output of a command to next command.</strong></pre>
<p><strong>Advanced redirecting operators</strong></p>
<p>&nbsp;</p>
<pre><strong>1&gt; --Standard Output redirect operator (same as &gt;) </strong>
<strong>1&gt;&gt; --Standard output append redirect operator (same as &gt;&gt;) </strong>
<strong>2&gt; --Standard Error redirector </strong>
<strong>2&gt;&gt; --Standard error redirector with append </strong>
<strong>&amp;&gt; --Standard Output and Error </strong>
<strong>tee command --To redirect output to the screen as well as a file </strong>
<strong>xargs command --To feed output of command as input files to other command </strong>
<strong>- -- (hyphen or Dash) redirection from standard input/output</strong></pre>
<p>We will see above operators with some examples on how to use them. We are giving much details on &lt;&lt; operator as it is rarely used and 1&gt;, 1&gt;&gt; as these operators are equal to &gt;, &gt;&gt;.</p>
<p><strong>Example1:</strong> Redirect output of fdisk command to a file for future reference.</p>
<p><strong>fdisk -l &gt; file1.txt</strong></p>
<p><strong>Example2:</strong> Search if Mitch username is present in /etc/passwd file or not</p>
<pre> <strong>grep mitch &lt; /etc/passwd</strong></pre>
<p><strong>Example3:</strong> Use output redirect append operators to redirect fdisk command output once again so that I can see both the previous output and present one in single file.</p>
<pre> <strong>fdisk -l &gt;&gt; file1.txt</strong></pre>
<p><strong>Note:</strong> Not discussing input append redirect operator as its very rarely used in practice.</p>
<p><strong>Example4:</strong> How can I count all the files with in present working directory</p>
<pre><strong>ls -l | wc -l</strong></pre>
<p><strong>Example5:</strong> Redirect error of a command to a file and output to the screen.</p>
<pre><strong>ls -hrtfd 2&gt; file3.txt</strong></pre>
<p><strong>Exampl6:</strong> Redirect and append error to a file and output to the screen.</p>
<p>&nbsp;</p>
<pre><strong>ls -wertdf 2&gt;&gt; file4.txt</strong></pre>
<p><strong>Example7:</strong> Redirect both output and error to a file</p>
<p>&nbsp;</p>
<pre><strong>ls -ewrdter &amp;&gt; file5.txt</strong></pre>
<p><strong>Note: &amp;&gt; and 2&gt;&amp;1</strong> is one and the same.</p>
<p><strong>tee command:</strong> tee(T) command is a special command which will redirect the output to a file as well as screen at same time, please consider it as capital T when it works.</p>
<p><strong>Example8:</strong> Redirect fdisk command to a file as well as on the screen at a time.</p>
<p>For example if you want to execute fdisk –l command want to see output of the command then execute one more command to redirect output to a file for future reference. We can do that with following commands</p>
<pre> <strong>fdisk –l</strong>

<strong>fdisk –l &gt; fdskout.txt</strong></pre>
<p>But with tee command you no need to execute two command. Below is a single command for the above fdisk example.</p>
<pre> <strong>fdisk -l | tee file6.txt</strong></pre>
<p><strong>xargs command:</strong> xargs command is one more special command which will redirect output of a command and feed it as input to other commands.</p>
<p><strong>Example9:</strong> List all the files which contain <span style="text-decoration: underline;">.</span><span style="text-decoration: underline;">sh</span> file extension and within them list all the files which contains <strong>bash</strong> in them.</p>
<p>&nbsp;</p>
<pre><strong>ls -l *.sh | grep bash</strong></pre>
<p>If I execute above command, this will not give all the files containing bash <strong>but will give file name containing bash</strong>. For this type of requirements we have to use <strong>xargs</strong>. Which will consider previous command output as file names and feed them to next command to args as shown below?</p>
<p>&nbsp;</p>
<pre><strong>ls -l *.sh | xargs grep bash</strong></pre>
<p><strong>- (hyphen or dash) Operator: </strong>This operator will act as both input as well as output redirect operator. I did not find much usage on using this operator as input redirecting operator. There are numerous examples for using this as output redirect operation such as with tar, cut commands etc. I have taken following examples from tldp.org.</p>
<p><strong>Example10:</strong> Search for a string in a file1.txt file and feed that to diff command to see the difference between abc.txt file and this new temporary file (file2.txt) files. Normally we do that as follows..</p>
<p>&nbsp;</p>
<pre><strong>grep xyz </strong><strong>/temp/loc/file1.txt </strong><strong>&gt; /temp/loc/file2.txt</strong></pre>
<p>Now compare file2.txt with abc file.</p>
<pre><strong>diff /temp/loc/abc.txt /temp/loc/file2.txt</strong></pre>
<p>This can be done in single command using – operator</p>
<p>&nbsp;</p>
<pre><strong>grep xyz /temp/loc/file1.txt | diff /temp/loc/abc.txt –</strong></pre>
<p>Please show some love by sharing this post on facebook, linkedin etc, if it helped you. Please comment your thoughts on this if you know any other different redirect operators.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/TheLinuxJuggernaut?a=zmTtMSv1b10:ReFptoAEgfY:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/TheLinuxJuggernaut?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/TheLinuxJuggernaut?a=zmTtMSv1b10:ReFptoAEgfY:-BTjWOF_DHI"><img src="http://feeds.feedburner.com/~ff/TheLinuxJuggernaut?i=zmTtMSv1b10:ReFptoAEgfY:-BTjWOF_DHI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/TheLinuxJuggernaut?a=zmTtMSv1b10:ReFptoAEgfY:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/TheLinuxJuggernaut?d=dnMXMwOfBR0" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/TheLinuxJuggernaut/~4/zmTtMSv1b10" height="1" width="1"/>]]></content:encoded><description>&lt;p style="text-align: center;"&gt;&lt;span style="color: #ff0000;"&gt; &lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;Redirecting operators in Linux&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p align="center"&gt; In order to understand about Redirecting operators in Linux we should know how we communicate with a computer. When we are communicating with a computer there should be a way to do it and this is achieved by &lt;strong&gt;STDIN (0), STDOUT (1), STDERR (2) file descriptors&lt;/strong&gt;. There are numbers assigned to these file descriptors as shown below.&lt;/p&gt;
&lt;pre&gt;&lt;strong&gt;STDIN --&amp;#62; 0 &lt;/strong&gt;
&lt;strong&gt;STDOUT  --&amp;#62; &lt;/strong&gt;&lt;strong&gt;1 &lt;/strong&gt;
&lt;strong&gt;STDERR --&amp;#62; 2&lt;/strong&gt;&lt;/pre&gt;
&lt;p&gt;We will see what &amp;#8230; &lt;a href="http://www.linuxnix.com/2012/02/linuxunix-redirection-operatorsfile-descriptors-explained-examples.html" class="read_more"&gt;Continue Reading&lt;/a&gt;&lt;/p&gt;</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.linuxnix.com/2012/02/linuxunix-redirection-operatorsfile-descriptors-explained-examples.html/feed</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">0</slash:comments><feedburner:origLink>http://www.linuxnix.com/2012/02/linuxunix-redirection-operatorsfile-descriptors-explained-examples.html</feedburner:origLink></item><item><title>Domain Name Server(DNS) Evolution</title><link>http://feedproxy.google.com/~r/TheLinuxJuggernaut/~3/ylUf7bK9eeg/domain-serverdns-evolution.html</link><category>Servers</category><category>BIND</category><category>DNS</category><category>Domain name</category><category>Domain Name System</category><category>FQDN</category><category>Hosts (file)</category><category>IP address</category><category>Name server</category><category>Root name server</category><category>Top-level domain</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Surendra Anne</dc:creator><pubDate>Sun, 05 Feb 2012 08:12:43 PST</pubDate><guid isPermaLink="false">http://www.linuxnix.com/?p=1338</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[
<p><a href="http://feedads.g.doubleclick.net/~a/tO3BB6y2kLTUeM_88efQuQycAxM/0/da"><img src="http://feedads.g.doubleclick.net/~a/tO3BB6y2kLTUeM_88efQuQycAxM/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/tO3BB6y2kLTUeM_88efQuQycAxM/1/da"><img src="http://feedads.g.doubleclick.net/~a/tO3BB6y2kLTUeM_88efQuQycAxM/1/di" border="0" ismap="true"></img></a></p><h1 style="text-align: center;"><strong>History of DNS server</strong></h1>
<h2>
How DNS server evolved?</h2>
<p>To understand why we require DNS server we have to go back to initial stages of networking the computers around late 1960’s and early 1970’s where it all started in Universities(especially <strong>Barkley University</strong>). Initially there is single computer for university due to cost and other factors, then to multiple systems per university. When computers started increasing exponentially in universities at this time people are forced to share documents/printers service etc of one system to other systems for maximizing the resources. This made people to inter network between the systems in labs so there will be effective utilization of resources attached to system. This made many people to remember the servers with numbers. So they started giving numbers to servers in Universities. So initially this worked fine to remember numbers, but when computers started growing faster they felt to give names instead of numbers(As humans prefer names more than numbers for easy remembrance).</p>
<h2>Hosts File evolution(/etc/hosts or c:/windows/system32/etc/HOSTS):</h2>
<p>To make it easy to communicate with different systems they came up with hosts file concept. Every system in the lab should have hosts file and it should contain name to number conversation table.<br />
So if I say one lab is having 10 machines each machine should have 10 entries for these servers as show below.<br />
Hosts file content:<br />
<strong>Labsys1 1</strong><br />
<strong> Labsys2 2</strong><br />
<strong> Labsys3 3</strong><br />
<strong> ..</strong><br />
<strong> ..</strong><br />
<strong> Labsys10 10</strong><br />
So becomes easy to remember by users.</p>
<h2>Disadvantages of hosts file?</h2>
<p>One disadvantage from this hosts file is if we want to add 11th machine in the lab all the hosts files on each system to should be modified to add this host details. Ok, it’s just 10 machines but consider labs having 100’s or thousands of servers. When a new machine is added to the network this machine entry should be added to these thousands of machines which a heavy job for the admin.</p>
<h2>What’s the solution?</h2>
<p>Go for a centralized monitoring/configuration system where every machine will point their Name quires to a centralized server. This machine should serve all the queries. At this point DNS (Domain Name Server/service) came in to existence.</p>
<p>Disadvantages of initial DNS server?<br />
When DNS server is implemented again it’s a mapping between numbers to host names and vice versa as shown below.<br />
For Berkeley servers:<br />
<strong>Server1 123</strong><br />
<strong> Lab2 345</strong><br />
<strong> Pas23 89</strong></p>
<p><strong></strong><br />
If you see there is no proper naming convention and its bit difficult to find where one server is located in given University.</p>
<h2>FQDN is the solution</h2>
<p>Researcher came with FQDN (Fully Qualified Domain Name) convention so that’s it’s easy to remember and easy to point where the server located.<br />
FQDN is a hierarchical and tree like structure for naming convention which contain below details.<br />
<strong>1) Hostname –Name of the server</strong><br />
<strong> 2) Domain name – Defines a realm administrative authority or control on a group of machines.</strong><br />
<strong> 3) Top Level Domains (TLD) – ie .com, .in, co.uk, co.us etc.</strong></p>
<h2>Some FAQ:</h2>
<p><strong>What are root name servers?</strong><br />
DNS is a hierarchical in structure where if a server is unable to give answer to host requests, it will send this to its superior servers and so on. This will reach to the upper levels to the initial master servers which are called as root name server which can serve all the answer queries if the host exists in internet.</p>
<p><strong>Why there are only 13 root name servers?</strong><br />
This is due to UDP porotocal size which stores DNS information.</p>
<p><strong>How many TOP level and Country specific domains are there?</strong><br />
There are 20 generic TLD’s (gTLD) and 248 country specific TLD’s(ccTLD) are there.</p>
<p>Stay tuned to our next post on &#8220;<strong>How name resolution works?</strong>&#8221;</p>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Enhanced by Zemanta" href="http://www.zemanta.com/"><img class="zemanta-pixie-img" style="border: none; float: right;" src="http://img.zemanta.com/zemified_e.png?x-id=4a34ef95-f79d-46d3-8281-3e9088ccafd9" alt="Enhanced by Zemanta" /></a></div>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/TheLinuxJuggernaut?a=ylUf7bK9eeg:lknqPpFgZbI:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/TheLinuxJuggernaut?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/TheLinuxJuggernaut?a=ylUf7bK9eeg:lknqPpFgZbI:-BTjWOF_DHI"><img src="http://feeds.feedburner.com/~ff/TheLinuxJuggernaut?i=ylUf7bK9eeg:lknqPpFgZbI:-BTjWOF_DHI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/TheLinuxJuggernaut?a=ylUf7bK9eeg:lknqPpFgZbI:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/TheLinuxJuggernaut?d=dnMXMwOfBR0" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/TheLinuxJuggernaut/~4/ylUf7bK9eeg" height="1" width="1"/>]]></content:encoded><description>&lt;h1 style="text-align: center;"&gt;&lt;strong&gt;History of DNS server&lt;/strong&gt;&lt;/h1&gt;
&lt;h2&gt;
How DNS server evolved?&lt;/h2&gt;
&lt;p&gt;To understand why we require DNS server we have to go back to initial stages of networking the computers around late 1960’s and early 1970’s where it all started in Universities(especially &lt;strong&gt;Barkley University&lt;/strong&gt;). Initially there is single computer for university due to cost and other factors, then to multiple systems per university. When computers started increasing exponentially in universities at this time people are forced to &amp;#8230; &lt;a href="http://www.linuxnix.com/2012/02/domain-serverdns-evolution.html" class="read_more"&gt;Continue Reading&lt;/a&gt;&lt;/p&gt;</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.linuxnix.com/2012/02/domain-serverdns-evolution.html/feed</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">0</slash:comments><feedburner:origLink>http://www.linuxnix.com/2012/02/domain-serverdns-evolution.html</feedburner:origLink></item><item><title>Linux Bash Shell short cuts</title><link>http://feedproxy.google.com/~r/TheLinuxJuggernaut/~3/j4lVGqPweMw/linux-bash-shell-short-cuts.html</link><category>Basics</category><category>bash</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Surendra Anne</dc:creator><pubDate>Tue, 31 Jan 2012 22:13:52 PST</pubDate><guid isPermaLink="false">http://www.linuxnix.com/?p=1329</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[
<p><a href="http://feedads.g.doubleclick.net/~a/UurjBxaUbOwc0lvLqpo5dWjorF8/0/da"><img src="http://feedads.g.doubleclick.net/~a/UurjBxaUbOwc0lvLqpo5dWjorF8/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/UurjBxaUbOwc0lvLqpo5dWjorF8/1/da"><img src="http://feedads.g.doubleclick.net/~a/UurjBxaUbOwc0lvLqpo5dWjorF8/1/di" border="0" ismap="true"></img></a></p><p>This is a small post on improving your productivity when working with BASH shell. BASH shell is having many inbuilt capabilities such as history, command chaining and BASH shortcut. In this post we will see what are BASH shortcuts and their usage.</p>
<pre>
<div>
<div>
<table>
<tbody>
<tr>
<td>Ctrl+a</td>
<td>Bring back the courser to start of the bash prompt</td>
</tr>
<tr>
<td>Ctrl+c</td>
<td>Cancel the command before executing it</td>
</tr>
<tr>
<td>Ctrl+d</td>
<td>Logout from the Shell</td>
</tr>
<tr>
<td>Ctrl+e</td>
<td>Move the courser to end of the command</td>
</tr>
<tr>
<td>Ctrl+l</td>
<td>Clear the screen</td>
</tr>
<tr>
<td>Ctrl+r</td>
<td>Search the history reverse order</td>
</tr>
<tr>
<td>Ctrl+p</td>
<td>go to previous command in history</td>
</tr>
<tr>
<td>Ctrl+n</td>
<td>Go to next command in history</td>
</tr>
<tr>
<td>Ctrl+s</td>
<td>Suspend terminal output(Useful for long out commands )</td>
</tr>
<tr>
<td>Ctrl+z</td>
<td>suspend the command/send command running to background</td>
</tr>
</tbody>
</table>
</div>
</div>
</pre>
<p>There are some other shortcuts are there which are not frequently used.</p>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Enhanced by Zemanta" href="http://www.zemanta.com/"><img class="zemanta-pixie-img" style="border: none; float: right;" src="http://img.zemanta.com/zemified_e.png?x-id=948b0583-58f7-4ace-beda-866b73b1106b" alt="Enhanced by Zemanta" /></a></div>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/TheLinuxJuggernaut?a=j4lVGqPweMw:DLTaKqMFO9Q:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/TheLinuxJuggernaut?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/TheLinuxJuggernaut?a=j4lVGqPweMw:DLTaKqMFO9Q:-BTjWOF_DHI"><img src="http://feeds.feedburner.com/~ff/TheLinuxJuggernaut?i=j4lVGqPweMw:DLTaKqMFO9Q:-BTjWOF_DHI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/TheLinuxJuggernaut?a=j4lVGqPweMw:DLTaKqMFO9Q:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/TheLinuxJuggernaut?d=dnMXMwOfBR0" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/TheLinuxJuggernaut/~4/j4lVGqPweMw" height="1" width="1"/>]]></content:encoded><description>&lt;p&gt;This is a small post on improving your productivity when working with BASH shell. BASH shell is having many inbuilt capabilities such as history, command chaining and BASH shortcut. In this post we will see what are BASH shortcuts and their usage.&lt;/p&gt;
&lt;pre&gt;
&lt;div&gt;
&lt;div&gt;
&lt;table&gt;

&lt;tr&gt;
&lt;td&gt;Ctrl+a&lt;/td&gt;
&lt;td&gt;Bring back the courser to start of the bash prompt&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Ctrl+c&lt;/td&gt;
&lt;td&gt;Cancel the command before executing it&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Ctrl+d&lt;/td&gt;
&lt;td&gt;Logout from the Shell&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Ctrl+e&lt;/td&gt;
&lt;td&gt;Move the courser to end of the command&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Ctrl+l&lt;/td&gt;
&lt;td&gt;Clear the screen&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Ctrl+r&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&amp;#8230; &lt;a href="http://www.linuxnix.com/2012/02/linux-bash-shell-short-cuts.html" class="read_more"&gt;Continue Reading&lt;/a&gt;&lt;/pre&gt;</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.linuxnix.com/2012/02/linux-bash-shell-short-cuts.html/feed</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">2</slash:comments><feedburner:origLink>http://www.linuxnix.com/2012/02/linux-bash-shell-short-cuts.html</feedburner:origLink></item><item><title>Up coming posts on DNS(Domain Name System/Server) in Linux</title><link>http://feedproxy.google.com/~r/TheLinuxJuggernaut/~3/XqXT5Vv4n8M/coming-posts-dnsdomain-systemserver-linux.html</link><category>News</category><category>Security</category><category>Servers</category><category>DNS</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Surendra Anne</dc:creator><pubDate>Wed, 04 Jan 2012 21:47:18 PST</pubDate><guid isPermaLink="false">http://www.linuxnix.com/?p=1323</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[
<p><a href="http://feedads.g.doubleclick.net/~a/U4PagTSPAq7F6Inj_uXdgJWB6g8/0/da"><img src="http://feedads.g.doubleclick.net/~a/U4PagTSPAq7F6Inj_uXdgJWB6g8/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/U4PagTSPAq7F6Inj_uXdgJWB6g8/1/da"><img src="http://feedads.g.doubleclick.net/~a/U4PagTSPAq7F6Inj_uXdgJWB6g8/1/di" border="0" ismap="true"></img></a></p><p>We are very much happy to announce that we started posting on DNS client and Server stuff on our blog for this month(Jan 2011). We already have some minor existing stuff related to DNS and troubleshooting it. Below are quick links to our existing DNS Server/Client stuff</p>
<p><a href="http://www.linuxnix.com/tag/dns-servers">http://www.linuxnix.com/tag/dns-servers</a></p>
<p><a href="http://www.linuxnix.com/tag/dns">http://www.linuxnix.com/tag/dns</a></p>
<p>Some of the DNS topics which are going to cover in this month are as follows. Please feel free to add requirements for DNS concepts which are not listed here  in either comments section or <a href="https://docs.google.com/spreadsheet/viewform?formkey=dFU3MmVZd3lHRUxUUlpMdXBMeWFuY3c6MQ" target="_blank">DNS Stuff Request Form</a>.</p>
<p><strong>Basics of DNS server</strong></p>
<ul>
<li>1)DNS Evolution</li>
<li>2)How Name resolution works?</li>
<li>3)How can I Setup DNS Lookup in Linux?</li>
<li>4)Linux / UNIX set the DNS from the GUI</li>
<li>5)How to set the DNS from the CLI in Linux?</li>
<li>6)How can we Find Out What My DNS Servers Address on client side?</li>
<li>7)DNS client configuration(Ubuntu/Windows/<wbr>Redhat/Solaries/AIX/HPUX etc)</wbr></li>
<li>8)What is NSORDER(DNS search order) and how to set it up in DNS Client?</li>
<li>9)Different DNS Records and their usages.</li>
<li>10)What is DNS server port number?</li>
<li>11)On what protocol DNS wroks?</li>
<li>12)What are DNS ROOT servers?</li>
</ul>
<p><strong>DNS server configuration</strong></p>
<ul>
<li>1)Installing DNS server</li>
<li>2)DNS named.conf, Zone files explained</li>
<li>3)Upgrading BIND DNS server software</li>
<li>4)DNS server implementation</li>
<li>5)DNS Master-Slave implementation</li>
<li>6)DDNS configuration(Requires DHCP)</li>
<li>7)BLDNS server configuration(For Black listing spam Domains from  <a href="http://dsbl.org/" target="_blank">dsbl.org</a> / <a href="http://spamhaus.org/" target="_blank">spamhaus.org</a> database)</li>
<li>8)Round Robin DNS server configuration</li>
<li>9)DNS cache server configuration</li>
<li>10)How to update named.conf file with out restarting DNS service?</li>
<li>11)How to update Zone files with out restarting DNS service?</li>
</ul>
<p><strong>DNS server troubleshooting</strong></p>
<ul>
<li>1)DNS logging</li>
<li>2)Named.conf file error checking</li>
<li>3)Zone file error checking</li>
<li>4)tcpdump command</li>
<li>5)DNS tool &#8211; DIG</li>
<li>6)DNS tool &#8211; nslookup</li>
<li>7)DNS tool &#8211; host</li>
<li>8)DNS tool &#8211; dnstop</li>
<li>9)DNS tool &#8211; fpdns</li>
<li>10)How to test or check reverse DNS</li>
<li>11)Linux Date Command: Convert Named Stats Dump Date</li>
<li>12)How to debug DNS logs using rndc query</li>
<li>13)How can i check on what port my DNS is working</li>
<li>14)DNS errors</li>
</ul>
<p>&nbsp;</p>
<p><strong>Improving speed of DNS</strong></p>
<ul>
<li>1)DNS response How to</li>
<li>2)Disable Dynamic Updates in DNS</li>
<li>3)How to Stop Recursion DNS queries Under Linux ?</li>
<li>4)How to Force BIND DNS Server to take full advantage of system resources?</li>
<li>5)How To Flush Linux BIND DNS Cache?</li>
<li>6)nsupdate Dynamic DNS Update Utility for Linux?</li>
</ul>
<p>&nbsp;</p>
<p><strong>Securing DNS</strong></p>
<ul>
<li>1)How to hide out DNS server version</li>
<li>2)Find out DNS Server Version With DNS Server Fingeprinting tool</li>
<li>3)How can I Find Out If My DNS Server is Free From DNS Cache Poisoning?</li>
<li>4)Find the DNS Authority Record for a DNS Domain (SOA)?</li>
<li>5)Linux Iptables block or open DNS / bind service port 53</li>
<li>6)Cache poisioning issue and how to resolve it</li>
<li>7)Configuring DNS in DMZ for security.</li>
<li>8)What is DNS spoofing?</li>
</ul>
<div></div>
<div>
<p><strong>Miscellaneous DNS topics</strong></p>
<ul>
<li>1)OpenDNS servers</li>
<li>2)FreeDNS servers</li>
<li>3)Google DNS servers</li>
<li>4)Go Daddy Registered Domain.</li>
<li>5)Configure Linux / UNIX dns resolver to append domain search</li>
<li>6)Configure BIND DNS Server to Listen Only On Certain IP Address or Network Interface.</li>
</ul>
<div></div>
</div>
<p><strong>Good places to find more info on DNS</strong></p>
<ul>
<li>1)Book review</li>
<li>2)Advanced DNS server configurations</li>
<li>3)Online tools</li>
</ul>
<p>Please feel free to contact us if you want to add up something or have a word to say at comments..!</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/TheLinuxJuggernaut?a=XqXT5Vv4n8M:c8rKdXHTr3w:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/TheLinuxJuggernaut?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/TheLinuxJuggernaut?a=XqXT5Vv4n8M:c8rKdXHTr3w:-BTjWOF_DHI"><img src="http://feeds.feedburner.com/~ff/TheLinuxJuggernaut?i=XqXT5Vv4n8M:c8rKdXHTr3w:-BTjWOF_DHI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/TheLinuxJuggernaut?a=XqXT5Vv4n8M:c8rKdXHTr3w:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/TheLinuxJuggernaut?d=dnMXMwOfBR0" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/TheLinuxJuggernaut/~4/XqXT5Vv4n8M" height="1" width="1"/>]]></content:encoded><description>&lt;p&gt;We are very much happy to announce that we started posting on DNS client and Server stuff on our blog for this month(Jan 2011). We already have some minor existing stuff related to DNS and troubleshooting it. Below are quick links to our existing DNS Server/Client stuff&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.linuxnix.com/tag/dns-servers"&gt;http://www.linuxnix.com/tag/dns-servers&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.linuxnix.com/tag/dns"&gt;http://www.linuxnix.com/tag/dns&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Some of the DNS topics which are going to cover in this month are as follows. Please feel free to add requirements for DNS concepts which are not &amp;#8230; &lt;a href="http://www.linuxnix.com/2012/01/coming-posts-dnsdomain-systemserver-linux.html" class="read_more"&gt;Continue Reading&lt;/a&gt;&lt;/p&gt;</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.linuxnix.com/2012/01/coming-posts-dnsdomain-systemserver-linux.html/feed</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">4</slash:comments><feedburner:origLink>http://www.linuxnix.com/2012/01/coming-posts-dnsdomain-systemserver-linux.html</feedburner:origLink></item><item><title>Wishing you Happy and prosperous New year 2012</title><link>http://feedproxy.google.com/~r/TheLinuxJuggernaut/~3/Ny40M2JzwHE/wishing-happy-prosperous-year-2012.html</link><category>News</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Surendra Anne</dc:creator><pubDate>Sun, 01 Jan 2012 09:59:02 PST</pubDate><guid isPermaLink="false">http://www.linuxnix.com/?p=1309</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[
<p><a href="http://feedads.g.doubleclick.net/~a/3gOSHjt_ADHlKS-FdoGiwC4NmkA/0/da"><img src="http://feedads.g.doubleclick.net/~a/3gOSHjt_ADHlKS-FdoGiwC4NmkA/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/3gOSHjt_ADHlKS-FdoGiwC4NmkA/1/da"><img src="http://feedads.g.doubleclick.net/~a/3gOSHjt_ADHlKS-FdoGiwC4NmkA/1/di" border="0" ismap="true"></img></a></p><div>
<div>
<div><a href="http://www.linuxnix.com/wp-content/uploads/2012/01/tux-new-year-2012.jpg"><img class="alignnone size-medium wp-image-1310" title="tux-new-year-2012" src="http://www.linuxnix.com/wp-content/uploads/2012/01/tux-new-year-2012-300x240.jpg" alt="" width="300" height="240" /></a></div>
<div>Dear Friends/Readers,</div>
<div></div>
<div>I take this opportunity to convey our sincere thanks to each one of you personally for your support and co-operation for several years. I request you to continue the same support and refer more people to our blog to grow bigger. We are very happy and personally congratulate each one of you for yourr successful career and continuous achievements.</div>
<p><span style="color: #888888;"><br />
</span></p>
</div>
</div>
<p>We personally request each one of you to give us your valuable suggestions and feed back for successful growth of our blog to reach new heights in new year. And also request you to send your comments (+&#8217;s / -&#8217;s) about  service / response, so that I can fix errors and serve you better. You response is highly appreciated.</p>
<h1 style="text-align: center;"><span style="color: #0000ff;"><strong>And once again have a wonderfull and prosperious new year 2012.</strong></span></h1>
<p>&nbsp;</p>
<p><strong>Thanks,<br />
A.Surendra Kumar</strong></p>
<p><strong>Founder, Mounix Systems, Hyderabad.<br />
</strong><strong>Linux: Fast, friendly, flexible and &#8230;. free!<br />
Support Open source.<br />
&lt;*,)}}+&lt;<br />
Only dead fish go with the flow!</strong><br />
<a href="http://www.linuxnix.com/" target="_blank">http://www.linuxnix.com</a></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/TheLinuxJuggernaut?a=Ny40M2JzwHE:VisY1326mnc:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/TheLinuxJuggernaut?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/TheLinuxJuggernaut?a=Ny40M2JzwHE:VisY1326mnc:-BTjWOF_DHI"><img src="http://feeds.feedburner.com/~ff/TheLinuxJuggernaut?i=Ny40M2JzwHE:VisY1326mnc:-BTjWOF_DHI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/TheLinuxJuggernaut?a=Ny40M2JzwHE:VisY1326mnc:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/TheLinuxJuggernaut?d=dnMXMwOfBR0" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/TheLinuxJuggernaut/~4/Ny40M2JzwHE" height="1" width="1"/>]]></content:encoded><description>&lt;div&gt;
&lt;div&gt;
&lt;div&gt;&lt;a href="http://www.linuxnix.com/wp-content/uploads/2012/01/tux-new-year-2012.jpg"&gt;&lt;img class="alignnone size-medium wp-image-1310" title="tux-new-year-2012" src="http://www.linuxnix.com/wp-content/uploads/2012/01/tux-new-year-2012-300x240.jpg" alt="" width="300" height="240" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;Dear Friends/Readers,&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;I take this opportunity to convey our sincere thanks to each one of you personally for your support and co-operation for several years. I request you to continue the same support and refer more people to our blog to grow bigger. We are very happy and personally congratulate each one of you for yourr successful career and continuous achievements.&lt;/div&gt;
&lt;p&gt;&lt;span style="color: #888888;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;We personally request each one of you to give us your valuable suggestions and feed &amp;#8230; &lt;a href="http://www.linuxnix.com/2012/01/wishing-happy-prosperous-year-2012.html" class="read_more"&gt;Continue Reading&lt;/a&gt;&lt;/p&gt;</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.linuxnix.com/2012/01/wishing-happy-prosperous-year-2012.html/feed</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">0</slash:comments><feedburner:origLink>http://www.linuxnix.com/2012/01/wishing-happy-prosperous-year-2012.html</feedburner:origLink></item><item><title>What is a sticky Bit and how to set it in Linux?</title><link>http://feedproxy.google.com/~r/TheLinuxJuggernaut/~3/e-yEYixaR-8/sticky-bit-set-linux.html</link><category>Administration</category><category>Basics</category><category>chmod</category><category>permissions</category><category>Stickybit</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Surendra Anne</dc:creator><pubDate>Sun, 01 Jan 2012 06:18:49 PST</pubDate><guid isPermaLink="false">http://www.linuxnix.com/?p=1297</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[
<p><a href="http://feedads.g.doubleclick.net/~a/gaBnYiqNmr_Vaj_2T9qT4eBxuR0/0/da"><img src="http://feedads.g.doubleclick.net/~a/gaBnYiqNmr_Vaj_2T9qT4eBxuR0/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/gaBnYiqNmr_Vaj_2T9qT4eBxuR0/1/da"><img src="http://feedads.g.doubleclick.net/~a/gaBnYiqNmr_Vaj_2T9qT4eBxuR0/1/di" border="0" ismap="true"></img></a></p><h2 style="text-align: left;"></h2>
<h2 style="text-align: center;"><strong><span style="color: #ff0000;"><span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;">What is a sticky Bit and how to set it in Linux?</span></span></strong></h2>
<h2 style="text-align: center;"></h2>
<p><span style="color: #000000;"><span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;"><span style="font-size: small;">This is next to </span></span></span><strong><span style="color: #000000;"><span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;"><span style="font-size: small;"><strong>SGID</strong></span></span></span></strong><strong></strong><span style="color: #000000;"><span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;"><span style="font-size: small;"> in our ongoing File and Folder permissions in Linux. We already discussed about</span></span></span><span style="color: #000000;"><span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;"><span style="font-size: small;"><strong> </strong></span></span></span><span style="color: #000080;"><span style="text-decoration: underline;"><a href="http://www.linuxnix.com/2011/10/chmod-command-explained-linuxunix.html"><span style="color: #000000;"><span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;"><span style="font-size: small;"><strong>CHMOD</strong></span></span></span></a></span></span><strong><span style="color: #000000;"><span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;"><span style="font-size: small;"><strong>, </strong></span></span></span></strong><span style="color: #000080;"><span style="text-decoration: underline;"><a href="http://www.linuxnix.com/2011/12/umask-define-linuxunix.html"><span style="color: #000000;"><span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;"><span style="font-size: small;"><strong>UMASK</strong></span></span></span></a></span></span><strong><span style="color: #000000;"><span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;"><span style="font-size: small;"><strong>, </strong></span></span></span></strong><span style="color: #000080;"><span style="text-decoration: underline;"><a href="http://www.linuxnix.com/2011/12/chown-command-linuxunix-explained-examples.html"><span style="color: #000000;"><span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;"><span style="font-size: small;"><strong>CHOWN</strong></span></span></span></a></span></span><strong><span style="color: #000000;"><span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;"><span style="font-size: small;"><strong>, </strong></span></span></span></strong><span style="color: #000080;"><span style="text-decoration: underline;"><a href="http://www.linuxnix.com/2011/12/chgrp-command-explained-linux-examples.html"><span style="color: #000000;"><span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;"><span style="font-size: small;"><strong>CHGRP</strong></span></span></span></a></span></span><strong><span style="color: #000000;"><span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;"><span style="font-size: small;"><strong> SGID and </strong></span></span></span></strong><span style="color: #000080;"><span style="text-decoration: underline;"><a href="http://www.linuxnix.com/2011/12/suid-set-suid-linuxunix.html"><span style="color: #000000;"><span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;"><span style="font-size: small;"><strong>SUID</strong></span></span></span></a></span></span><span style="color: #000000;"><span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;"><span style="font-size: small;"><strong> </strong></span></span></span><span style="color: #000000;"><span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;"><span style="font-size: small;">File and folder permissions etc in our previous posts. In this post we will see</span></span></span></p>
<h2 style="text-align: center;"></h2>
<pre><strong><span style="color: #000000;"><span style="font-family: Consolas, Monaco, monospace;"><span style="font-size: small;"><strong>What is Sticky Bit?</strong></span></span></span></strong>

<strong><span style="color: #000000;"><span style="font-family: Consolas, Monaco, monospace;"><span style="font-size: small;"><strong>Why we require Sticky Bit?</strong></span></span></span></strong>

<strong><span style="color: #000000;"><span style="font-family: Consolas, Monaco, monospace;"><span style="font-size: small;"><strong>Where we are going to implement Sticky Bit?</strong></span></span></span></strong>

<strong><span style="color: #000000;"><span style="font-family: Consolas, Monaco, monospace;"><span style="font-size: small;"><strong>How to implement Sticky Bit in Linux?</strong></span></span></span></strong>

<strong><span style="color: #000000;"><span style="font-family: Consolas, Monaco, monospace;"><span style="font-size: small;"><strong>What is Sticky Bit?</strong></span></span></span></strong></pre>
<h2 style="text-align: center;"></h2>
<p><strong><span style="color: #000000;"><span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;"><span style="font-size: small;">Sticky Bit</span></span></span></strong><span style="color: #000000;"><span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;"><span style="font-size: small;"> is used mainly on folders in order to avoid deletion of a folder and its content by other user though he is having write permissions. If Sticky bit is enabled on a folder, the folder is deleted by only owner of the folder and super user(root). This is a security measure to suppress deletion of critical folders where it is having full permissions by others.</span></span></span></p>
<h2 style="text-align: center;"></h2>
<p><strong><span style="font-size: small;"><strong>Learn Sticky Bit with examples:</strong></span></strong></p>
<h2 style="text-align: center;"></h2>
<p><strong><span style="color: #000000;"><span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;"><span style="font-size: small;">Example: Create a project(A folder) where people will try to dump files for sharing, but they should not delete the files created by other users.</span></span></span></strong></p>
<h2 style="text-align: center;"></h2>
<p><strong><span style="font-size: small;"><strong>How can I setup Sticky Bit for a Folder?</strong></span></strong><strong></strong></p>
<h2 style="text-align: center;"></h2>
<p><span style="color: #000000;"><span style="font-size: small;"><span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;">Sticky Bit can be set in two ways</span></span></span></p>
<h2 style="text-align: center;"></h2>
<pre><strong><span style="color: #000000;"><span style="font-family: Consolas, Monaco, monospace;"><span style="font-size: small;"><strong>1) Symbolic way (t,represents sticky bit)</strong></span></span></span></strong>

<strong><span style="color: #000000;"><span style="font-family: Consolas, Monaco, monospace;"><span style="font-size: small;"><strong>2) Numerical/octal way (1, Sticky Bit bit as value 1)</strong></span></span></span></strong></pre>
<h2 style="text-align: center;"></h2>
<p><span style="color: #000000;"><span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;"><span style="font-size: small;">Use </span></span></span><strong><span style="color: #000000;"><span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;"><span style="font-size: small;">chmod</span></span></span></strong><span style="color: #000000;"><span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;"><span style="font-size: small;"> command to set Sticky Bit on Folder: /opt/dump/</span></span></span></p>
<h2 style="text-align: center;"></h2>
<p><strong><span style="color: #000000;"><span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;"><span style="font-size: small;"><strong>Symbolic way:</strong></span></span></span></strong></p>
<h2 style="text-align: center;"></h2>
<pre><strong><span style="color: #000000;"><span style="font-family: Consolas, Monaco, monospace;"><span style="font-size: small;"><strong>chmod o+t /opt/dump/</strong></span></span></span></strong>
<strong><span style="color: #000000;"><span style="font-family: Consolas, Monaco, monospace;"><span style="font-size: small;"><strong>or </strong></span></span></span></strong>
<strong><span style="color: #000000;"><span style="font-family: Consolas, Monaco, monospace;"><span style="font-size: small;"><strong>chmod +t /opt/dump/</strong></span></span></span></strong></pre>
<h2 style="text-align: center;"></h2>
<p><span style="color: #000000;"><span style="font-size: small;"><span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;">Let me explain above command we are setting Sticky Bit(+t) to folder /opt/dump by using chmod command.</span></span></span></p>
<h2 style="text-align: center;"></h2>
<p><strong><span style="color: #000000;"><span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;"><span style="font-size: small;"><strong>Numerical way:</strong></span></span></span></strong></p>
<h2 style="text-align: center;"></h2>
<pre><strong><span style="color: #000000;"><span style="font-family: Consolas, Monaco, monospace;"><span style="font-size: small;"><strong>chmod 1757 /opt/dump/</strong></span></span></span></strong></pre>
<h2 style="text-align: center;"></h2>
<p><strong><span style="color: #000000;"><span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;"><span style="font-size: small;">Here in 1757, 1 indicates Sticky Bit set, 7 for full permissions for owner, 5 for write and execute permissions for group, and ful permissions for others.</span></span></span></strong></p>
<h2 style="text-align: center;"></h2>
<p><strong><span style="font-size: small;"><strong>Checking if a folder is set with Sticky Bit or not?</strong></span></strong></p>
<h2 style="text-align: center;"></h2>
<p><span style="color: #000000;"><span style="font-size: small;"><span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;">Use ls –l to check if the x in others permissions field is replaced by t or T</span></span></span></p>
<h2 style="text-align: center;"></h2>
<p><span style="color: #000000;"><span style="font-size: small;"><span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;">For example: /opt/dump/ listing before and after Sticky Bit set</span></span></span></p>
<h2 style="text-align: center;"></h2>
<p><strong><span style="color: #000000;"><span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;"><span style="font-size: small;"><strong>Before Sticky Bit set:</strong></span></span></span></strong></p>
<h2 style="text-align: center;"></h2>
<pre><strong><span style="color: #000000;"><span style="font-family: Consolas, Monaco, monospace;"><span style="font-size: small;"><strong>ls -l</strong></span></span></span></strong>

<strong><span style="color: #000000;"><span style="font-family: Consolas, Monaco, monospace;"><span style="font-size: small;"><strong>total 8</strong></span></span></span></strong>

<strong><span style="color: #000000;"><span style="font-family: Consolas, Monaco, monospace;"><span style="font-size: small;"><strong>-rwxr-xrwx 1 xyz xyzgroup 148 Dec 22 03:46 /opt/dump/</strong></span></span></span></strong></pre>
<h2 style="text-align: center;"></h2>
<p><strong><span style="color: #000000;"><span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;"><span style="font-size: small;"><strong>After Sticky Bit set:</strong></span></span></span></strong></p>
<h2 style="text-align: center;"></h2>
<pre><strong><span style="color: #000000;"><span style="font-family: Consolas, Monaco, monospace;"><span style="font-size: small;"><strong>ls -l</strong></span></span></span></strong>

<strong><span style="color: #000000;"><span style="font-family: Consolas, Monaco, monospace;"><span style="font-size: small;"><strong>total 8</strong></span></span></span></strong>

<strong><span style="color: #000000;"><span style="font-family: Consolas, Monaco, monospace;"><span style="font-size: small;"><strong>-rwxr-xrwt 1 xyz xyzgroup 148 Dec 22 03:46 /opt/dump/</strong></span></span></span></strong></pre>
<h2 style="text-align: center;"></h2>
<p><strong><span style="color: #000000;"><span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;"><span style="font-size: small;"><strong>Some FAQ’s related to Sticky Bit:</strong></span></span></span></strong></p>
<h2 style="text-align: center;"></h2>
<p><strong><span style="color: #000000;"><span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;"><span style="font-size: small;">Now sticky bit is set, lets check if user “temp” can delete this folder</span></span></span></strong></p>
<h2 style="text-align: center;"></h2>
<pre><strong>$ rm -rf /opt/dump</strong></pre>
<p>&nbsp;</p>
<h2 style="text-align: center;"></h2>
<p><strong><span style="font-size: small;"><strong>rm: cannot remove `/opt/dump&#8217;: Operation not permitted</strong></span></strong></p>
<h2 style="text-align: center;"></h2>
<p><strong><span style="color: #000000;"><span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;"><span style="font-size: small;"><strong>$ ls -l /opt</strong></span></span></span></strong></p>
<h2 style="text-align: center;"></h2>
<p><strong><span style="color: #000000;"><span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;"><span style="font-size: small;"><strong>total 8 </strong></span></span></span></strong></p>
<h2 style="text-align: center;"></h2>
<p><strong><span style="font-size: small;"><strong>drwxrwxrwt 4 xyz xyzgroup 4096 2012-01-01 17:37 dump</strong></span></strong></p>
<p><strong><span style="color: #000000;"><span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;"><span style="font-size: small;"><strong>$ </strong></span></span></span></strong></p>
<h2 style="text-align: center;"></h2>
<p><strong><span style="color: #000000;"><span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;"><span style="font-size: small;">if you observe he is unable to delete and even xyz user creted any files in dump folder, temp user can not delete it. But xyz user can crete and delte files in dump folder.</span></span></span></strong></p>
<h2 style="text-align: center;"></h2>
<p><strong><span style="font-size: small;">I am seeing “T” ie Capital s in the file permissions, what’s that?</span></strong></p>
<h2 style="text-align: center;"></h2>
<p><span style="color: #000000;"><span style="font-size: small;"><span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;">After setting Sticky Bit to a file/folder if you see ‘T’ in the file permission area that indicates that the file/folder does not have executable permissions for others on that particular file/folder.</span></span></span></p>
<h2 style="text-align: left;">Sticky bit without Executable permissions:</h2>
<p><a href="http://www.linuxnix.com/wp-content/uploads/2012/01/Untitleddrawing-8.jpg"><img class="alignnone size-medium wp-image-1306" title="sticky_bit_Linux" src="http://www.linuxnix.com/wp-content/uploads/2012/01/Untitleddrawing-8-300x194.jpg" alt="" width="300" height="194" /></a></p>
<p><span style="font-size: small;">so if you want executable permissions too, apply executable permissions to the file.</span></p>
<h2 style="text-align: center;"></h2>
<pre><strong><span style="color: #000000;"><span style="font-family: Consolas, Monaco, monospace;"><span style="font-size: small;"><strong>chmod o+x /opt/dump/</strong></span></span></span></strong></pre>
<h2 style="text-align: center;"></h2>
<p><span style="color: #000000;"><span style="font-size: small;"><strong><span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;">output: -rwxr-xrwt 1 xyz xyzgroup 0 Dec 5 11:24 /opt/dump/</span></strong></span></span></p>
<h2 style="text-align: center;"></h2>
<h2>Sticky bit with Executable permissions:</h2>
<p><a href="http://www.linuxnix.com/wp-content/uploads/2012/01/Untitleddrawing-7.jpg"><img title="Sticky bit Linux" src="http://www.linuxnix.com/wp-content/uploads/2012/01/Untitleddrawing-7-300x194.jpg" alt="sticky bit unix, unix sticky bit, suid, linux sticky bit, sticky bit in unix, sticky bit aix, sticky bit chmod, sticky bits, sticky bit linux, suid sgid sticky bit, set sticky bit, stickybit, sticky bit permission, setting sticky bit, solaris sticky bit, sticky bit solaris, sticky bit directory, remove sticky bit, ubuntu sticky bit, sticky bit t, aix sticky bit, sticky bit load balancer, directory sticky bit, umask" width="300" height="194" /></a></p>
<p><span style="font-size: small;">you should see a smaller &#8216;s&#8217; in the executable permission position.</span></p>
<h2 style="text-align: center;"></h2>
<p><strong><span style="color: #000000;"><span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;"><span style="font-size: small;"><strong>How can I find all the Sticky Bit set files in Linux/Unix.</strong></span></span></span></strong></p>
<h2 style="text-align: center;"></h2>
<pre><strong><span style="color: #000000;"><span style="font-family: Consolas, Monaco, monospace;"><span style="font-size: small;"><strong>find / -perm +1000</strong></span></span></span></strong></pre>
<h2 style="text-align: center;"></h2>
<p><span style="color: #000000;"><span style="font-size: small;"><span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;">The above find command will check all the files which is set with Sticky Bit bit(1000).</span></span></span></p>
<h2 style="text-align: center;"></h2>
<p><strong><span style="color: #000000;"><span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;"><span style="font-size: small;"><strong>Can I set Sticky Bit for files?</strong></span></span></span></strong></p>
<h2 style="text-align: center;"></h2>
<p><span style="color: #000000;"><span style="font-size: small;"><span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;">Yes, but most of the time its not required.</span></span></span></p>
<h2 style="text-align: center;"></h2>
<p><span style="color: #000000;"><span style="font-size: small;"><strong><span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;">How can I remove Sticky Bit bit on a file/folder?</span></strong></span></span></p>
<h2 style="text-align: center;"></h2>
<pre><strong><span style="color: #000000;"><span style="font-family: Consolas, Monaco, monospace;"><span style="font-size: small;"><strong>chmod o-t /opt/dump/</strong></span></span></span></strong></pre>
<h2 style="text-align: center;"></h2>
<p><span style="color: #000000;"><span style="font-size: small;"><span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;">Post your thoughts on this.</span></span></span></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/TheLinuxJuggernaut?a=e-yEYixaR-8:0_gr5viwvvo:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/TheLinuxJuggernaut?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/TheLinuxJuggernaut?a=e-yEYixaR-8:0_gr5viwvvo:-BTjWOF_DHI"><img src="http://feeds.feedburner.com/~ff/TheLinuxJuggernaut?i=e-yEYixaR-8:0_gr5viwvvo:-BTjWOF_DHI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/TheLinuxJuggernaut?a=e-yEYixaR-8:0_gr5viwvvo:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/TheLinuxJuggernaut?d=dnMXMwOfBR0" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/TheLinuxJuggernaut/~4/e-yEYixaR-8" height="1" width="1"/>]]></content:encoded><description>&lt;h2 style="text-align: left;"&gt;&lt;/h2&gt;
&lt;h2 style="text-align: center;"&gt;&lt;strong&gt;&lt;span style="color: #ff0000;"&gt;&lt;span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;"&gt;What is a sticky Bit and how to set it in Linux?&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/h2&gt;
&lt;h2 style="text-align: center;"&gt;&lt;/h2&gt;
&lt;p&gt;&lt;span style="color: #000000;"&gt;&lt;span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;"&gt;&lt;span style="font-size: small;"&gt;This is next to &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;strong&gt;&lt;span style="color: #000000;"&gt;&lt;span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;"&gt;&lt;span style="font-size: small;"&gt;&lt;strong&gt;SGID&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;strong&gt;&lt;/strong&gt;&lt;span style="color: #000000;"&gt;&lt;span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;"&gt;&lt;span style="font-size: small;"&gt; in our ongoing File and Folder permissions in Linux. We already discussed about&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;"&gt;&lt;span style="font-size: small;"&gt;&lt;strong&gt; &lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #000080;"&gt;&lt;span style="text-decoration: underline;"&gt;&lt;a href="http://www.linuxnix.com/2011/10/chmod-command-explained-linuxunix.html"&gt;&lt;span style="color: #000000;"&gt;&lt;span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;"&gt;&lt;span style="font-size: small;"&gt;&lt;strong&gt;CHMOD&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;strong&gt;&lt;span style="color: #000000;"&gt;&lt;span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;"&gt;&lt;span style="font-size: small;"&gt;&lt;strong&gt;, &lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;span style="color: #000080;"&gt;&lt;span style="text-decoration: underline;"&gt;&lt;a href="http://www.linuxnix.com/2011/12/umask-define-linuxunix.html"&gt;&lt;span style="color: #000000;"&gt;&lt;span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;"&gt;&lt;span style="font-size: small;"&gt;&lt;strong&gt;UMASK&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;strong&gt;&lt;span style="color: #000000;"&gt;&lt;span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;"&gt;&lt;span style="font-size: small;"&gt;&lt;strong&gt;, &lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;span style="color: #000080;"&gt;&lt;span style="text-decoration: underline;"&gt;&lt;a href="http://www.linuxnix.com/2011/12/chown-command-linuxunix-explained-examples.html"&gt;&lt;span style="color: #000000;"&gt;&lt;span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;"&gt;&lt;span style="font-size: small;"&gt;&lt;strong&gt;CHOWN&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;strong&gt;&lt;span style="color: #000000;"&gt;&lt;span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;"&gt;&lt;span style="font-size: small;"&gt;&lt;strong&gt;, &lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;span style="color: #000080;"&gt;&lt;span style="text-decoration: underline;"&gt;&lt;a href="http://www.linuxnix.com/2011/12/chgrp-command-explained-linux-examples.html"&gt;&lt;span style="color: #000000;"&gt;&lt;span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;"&gt;&lt;span style="font-size: small;"&gt;&lt;strong&gt;CHGRP&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;strong&gt;&lt;span style="color: #000000;"&gt;&lt;span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;"&gt;&lt;span style="font-size: small;"&gt;&lt;strong&gt; SGID and &lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;span style="color: #000080;"&gt;&lt;span style="text-decoration: underline;"&gt;&lt;a href="http://www.linuxnix.com/2011/12/suid-set-suid-linuxunix.html"&gt;&lt;span style="color: #000000;"&gt;&lt;span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;"&gt;&lt;span style="font-size: small;"&gt;&lt;strong&gt;SUID&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;"&gt;&lt;span style="font-size: small;"&gt;&lt;strong&gt; &lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;"&gt;&lt;span style="font-size: small;"&gt;File and folder permissions etc in our previous posts. In this post we will see&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;h2 style="text-align: center;"&gt;&lt;/h2&gt;
&lt;pre&gt;&lt;strong&gt;&lt;span style="color: #000000;"&gt;&lt;span style="font-family: Consolas, Monaco, monospace;"&gt;&lt;span style="font-size: small;"&gt;&lt;strong&gt;What is Sticky Bit?&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;

&lt;strong&gt;&lt;span style="color: #000000;"&gt;&lt;span style="font-family: Consolas, Monaco, monospace;"&gt;&lt;span style="font-size: small;"&gt;&lt;strong&gt;Why we require Sticky Bit?&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;

&lt;strong&gt;&lt;span style="color: #000000;"&gt;&lt;span style="font-family: Consolas, Monaco, monospace;"&gt;&lt;span style="font-size: small;"&gt;&lt;strong&gt;Where we are going to implement Sticky Bit?&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;

&lt;strong&gt;&lt;span style="color: #000000;"&gt;&lt;span style="font-family: Consolas, Monaco, monospace;"&gt;&lt;span style="font-size: small;"&gt;&lt;strong&gt;How &lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&amp;#8230; &lt;a href="http://www.linuxnix.com/2012/01/sticky-bit-set-linux.html" class="read_more"&gt;Continue Reading&lt;/a&gt;&lt;/pre&gt;</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.linuxnix.com/2012/01/sticky-bit-set-linux.html/feed</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">1</slash:comments><feedburner:origLink>http://www.linuxnix.com/2012/01/sticky-bit-set-linux.html</feedburner:origLink></item><item><title>What is SGID and how to set SGID in Linux?</title><link>http://feedproxy.google.com/~r/TheLinuxJuggernaut/~3/8532-tzcJaU/sgid-set-sgid-linuxunix.html</link><category>Administration</category><category>chmod</category><category>permissions</category><category>SGID</category><category>SUID</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Surendra Anne</dc:creator><pubDate>Thu, 29 Dec 2011 10:48:24 PST</pubDate><guid isPermaLink="false">http://www.linuxnix.com/?p=1273</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[
<p><a href="http://feedads.g.doubleclick.net/~a/L4mJ2Nk-kU-f-zz54WWRHRO7GRA/0/da"><img src="http://feedads.g.doubleclick.net/~a/L4mJ2Nk-kU-f-zz54WWRHRO7GRA/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/L4mJ2Nk-kU-f-zz54WWRHRO7GRA/1/da"><img src="http://feedads.g.doubleclick.net/~a/L4mJ2Nk-kU-f-zz54WWRHRO7GRA/1/di" border="0" ismap="true"></img></a></p><h2 align="center"><span style="color: #ff0000;"><strong>What is SGID and how to set SGID in Linux/Unix?</strong></span><strong></strong></h2>
<p>This is next to <strong>SUID</strong> in our ongoing File and Folder permissions in Linux. We already discussed about <strong><a href="http://www.linuxnix.com/2011/10/chmod-command-explained-linuxunix.html">CHMOD</a>, <a href="http://www.linuxnix.com/2011/12/umask-define-linuxunix.html">UMASK</a>, <a href="http://www.linuxnix.com/2011/12/chown-command-linuxunix-explained-examples.html">CHOWN</a>, <a href="http://www.linuxnix.com/2011/12/chgrp-command-explained-linux-examples.html">CHGRP</a> and <a href="http://www.linuxnix.com/2011/12/suid-set-suid-linuxunix.html">SUID</a></strong> File and folder permissions etc in our previous posts. In this post we will see</p>
<pre><strong>What is SGID?</strong>

<strong>Why we require SGID?</strong>

<strong>Where we are going to implement SGID?</strong>

<strong>How to implement SGID in Linux?</strong>

<strong>What is SGID?</strong></pre>
<p><strong>SGID</strong> (<strong>S</strong>et <strong>G</strong>roup <strong>ID</strong> up on execution) is a special type of file permissions given to a file/folder. Normally in Linux/Unix when a program runs, it inherits access permissions from the logged in user. SGID is defined as giving temporary permissions to a user to run a program/file with the permissions of the file group permissions to become member of that group to execute the file<strong>. In simple words users will get file Group’s permissions when executing a Folder/file/program/command.</strong></p>
<p>SGID is similar to SUID. The difference between both is that SUID assumes owner of the file permissions and SGID assumes group’s permissions when executing a file instead of logged in user inherit permissions.</p>
<p><strong> </strong><strong>Learn SGID with examples:</strong></p>
<p><strong>Example:</strong> <strong><a href="http://www.linuxnix.com/2010/03/how-to-linux-group-disk-quota-implementation.html">Linux Group quota implementation</a></strong></p>
<p>When implementing Linux Group quota for group of people SGID plays an important role in checking the quota timer. SGID bit set on folder is used to change their inherit permissions to group’s permissions to make it as single user who is dumping data. So that group members whoever dumps the data the data will be written with group permissions and inturn quota will be reduced centrally for all the users. For clear understanding of this you have to implement group quota from the above link. Without implementation of SGID the quota will not be effective.</p>
<p><strong>How can I setup SGID for a file?</strong></p>
<p>SGID can be set in two ways</p>
<pre><strong>1) Symbolic way (s)</strong>

<strong>2) Numerical/octal way (2, SGID bit as value 2)</strong></pre>
<p>Use <strong>chmod</strong> command to set SGID on file: file1.txt</p>
<p><strong>Symbolic way:</strong></p>
<pre><strong>chmod g+s file1.txt</strong></pre>
<p>Let me explain above command we are setting SGID(+s) to group who owns this file.</p>
<p><strong>Numerical way:</strong></p>
<pre><strong>chmod 2750 file1.txt</strong></pre>
<p><strong>Here in 2750, 2 indicates SGID bitset, 7 for full permissions for owner, 5 for write and execute permissions for group, and no permissions for others.</strong></p>
<p><strong>How can I check if a file is set with SGID bit or not?</strong></p>
<p>Use ls –l to check if the x in group permissions field is replaced by s or S</p>
<p>For example: file1.txt listing before and after SGID set</p>
<p><strong>Before SGID set:</strong></p>
<pre><strong>ls -l</strong>

<strong>total 8</strong>

<strong>-rwxr--r-- 1 xyz xyzgroup 148 Dec 22 03:46 file1.txt</strong></pre>
<p><strong>After SGID set:</strong></p>
<pre><strong>ls -l</strong>

<strong>total 8</strong>

<strong>-rwxr-sr-- 1 xyz xyzgroup 148 Dec 22 03:46 file1.txt</strong></pre>
<p><strong>Some FAQ’s related to SGID:</strong></p>
<p><strong>Where is SUID used?</strong></p>
<p>1) When implementing Linux group disk quota.</p>
<p><strong>I am seeing “S” ie Capital s in the file permissions, what’s that?</strong></p>
<p>After setting SUID or SGID to a file/folder if you see ‘S’ in the file permission area that indicates that the file/folder does not have executable permissions for that user or group on that particular file/folder.</p>
<pre><strong>chmod g+s file1.txt</strong></pre>
<p>output:<br />
-rwxrwSr-x 1 surendra surendra 0 Dec 27 11:24 file1.txt</p>
<p><a href="http://www.linuxnix.com/wp-content/uploads/2011/12/Untitleddrawing-6.jpg"><img class="alignnone size-medium wp-image-1283" title="SGID_Linux_without_exe_permissions" src="http://www.linuxnix.com/wp-content/uploads/2011/12/Untitleddrawing-6-300x194.jpg" alt="" width="300" height="194" /></a></p>
<p>so if you want executable permissions too, apply executable permissions to the file.</p>
<pre><strong>chmod g+x file1.txt</strong></pre>
<p>output:<br />
-rwxrwsr-x 1 surendra surendra 0 Dec 5 11:24 file1.txt</p>
<p><a href="http://www.linuxnix.com/wp-content/uploads/2011/12/Untitleddrawing-3.jpg"><img title="SGID_Linux" src="http://www.linuxnix.com/wp-content/uploads/2011/12/Untitleddrawing-3-300x194.jpg" alt="" width="300" height="194" /></a></p>
<p>you should see a smaller &#8216;s&#8217; in the executable permission position.</p>
<p><strong>How can I find all the SGID set files in Linux/Unix.</strong></p>
<pre><strong>find / -perm +2000</strong></pre>
<p>The above find command will check all the files which is set with SGID bit(2000).</p>
<p><strong>Can I set SGID for folders?</strong></p>
<p>Yes, you can if it’s required (you should remember one thing, that Linux treats everything as a file)</p>
<p>How can I remove SGID bit on a file/folder?</p>
<pre><strong>chmod g-s file1.txt</strong></pre>
<p>Post your thoughts on this.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/TheLinuxJuggernaut?a=8532-tzcJaU:y23WHIp-K8E:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/TheLinuxJuggernaut?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/TheLinuxJuggernaut?a=8532-tzcJaU:y23WHIp-K8E:-BTjWOF_DHI"><img src="http://feeds.feedburner.com/~ff/TheLinuxJuggernaut?i=8532-tzcJaU:y23WHIp-K8E:-BTjWOF_DHI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/TheLinuxJuggernaut?a=8532-tzcJaU:y23WHIp-K8E:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/TheLinuxJuggernaut?d=dnMXMwOfBR0" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/TheLinuxJuggernaut/~4/8532-tzcJaU" height="1" width="1"/>]]></content:encoded><description>&lt;h2 align="center"&gt;&lt;span style="color: #ff0000;"&gt;&lt;strong&gt;What is SGID and how to set SGID in Linux/Unix?&lt;/strong&gt;&lt;/span&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/h2&gt;
&lt;p&gt;This is next to &lt;strong&gt;SUID&lt;/strong&gt; in our ongoing File and Folder permissions in Linux. We already discussed about &lt;strong&gt;&lt;a href="http://www.linuxnix.com/2011/10/chmod-command-explained-linuxunix.html"&gt;CHMOD&lt;/a&gt;, &lt;a href="http://www.linuxnix.com/2011/12/umask-define-linuxunix.html"&gt;UMASK&lt;/a&gt;, &lt;a href="http://www.linuxnix.com/2011/12/chown-command-linuxunix-explained-examples.html"&gt;CHOWN&lt;/a&gt;, &lt;a href="http://www.linuxnix.com/2011/12/chgrp-command-explained-linux-examples.html"&gt;CHGRP&lt;/a&gt; and &lt;a href="http://www.linuxnix.com/2011/12/suid-set-suid-linuxunix.html"&gt;SUID&lt;/a&gt;&lt;/strong&gt; File and folder permissions etc in our previous posts. In this post we will see&lt;/p&gt;
&lt;pre&gt;&lt;strong&gt;What is SGID?&lt;/strong&gt;

&lt;strong&gt;Why we require SGID?&lt;/strong&gt;

&lt;strong&gt;Where we are going to implement SGID?&lt;/strong&gt;

&lt;strong&gt;How to implement SGID in Linux?&lt;/strong&gt;

&lt;strong&gt;What is SGID?&lt;/strong&gt;&amp;#8230; &lt;a href="http://www.linuxnix.com/2011/12/sgid-set-sgid-linuxunix.html" class="read_more"&gt;Continue Reading&lt;/a&gt;&lt;/pre&gt;</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.linuxnix.com/2011/12/sgid-set-sgid-linuxunix.html/feed</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">0</slash:comments><feedburner:origLink>http://www.linuxnix.com/2011/12/sgid-set-sgid-linuxunix.html</feedburner:origLink></item><item><title>What is SUID and how to set SUID in Linux/Unix?</title><link>http://feedproxy.google.com/~r/TheLinuxJuggernaut/~3/yb0vTrCfi9M/suid-set-suid-linuxunix.html</link><category>Administration</category><category>chmod</category><category>permissions</category><category>SUID</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Surendra Anne</dc:creator><pubDate>Wed, 28 Dec 2011 10:34:19 PST</pubDate><guid isPermaLink="false">http://www.linuxnix.com/?p=1264</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[
<p><a href="http://feedads.g.doubleclick.net/~a/csKfCUubTEd_afbtwtizIsJ0ScE/0/da"><img src="http://feedads.g.doubleclick.net/~a/csKfCUubTEd_afbtwtizIsJ0ScE/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/csKfCUubTEd_afbtwtizIsJ0ScE/1/da"><img src="http://feedads.g.doubleclick.net/~a/csKfCUubTEd_afbtwtizIsJ0ScE/1/di" border="0" ismap="true"></img></a></p><h1 style="text-align: center;"><span style="color: #ff0000;"><strong>What is SUID and how to set SUID in Linux/Unix?</strong></span></h1>
<p>There are some other special permission apart from the normal file permissions read, write and execute. They are <strong>SUID, SGID, Sticky Bit, ACL&#8217;s and SELinux</strong> etc for granular file/folder management by administrator. In this post we will see</p>
<pre><strong>1)What’s SUID?</strong>
<strong>2)How to set SUID?</strong>
<strong>3)Where to us SUID?</strong></pre>
<p><strong>What is SUID and how to set it in Linux?</strong></p>
<p><strong>SUID</strong> (<strong>S</strong>et owner <strong>U</strong>ser <strong>ID</strong> up on execution) is a special type of file permissions given to a file. Normally in Linux/Unix when a program runs, it inherits access permissions from the logged in user. SUID is defined as giving temporary permissions to a user to run a program/file with the permissions of the file owner rather that the user who is running it<strong>. In simple words users will get file owner’s permissions as well as their UID and GID when executing a file/program/command.</strong></p>
<p><strong></strong>The above sentence is bit tricky and should be explained in depth with examples.</p>
<p><strong>Learn SUID with examples:</strong></p>
<p><strong>Example1:</strong> <strong>passwd command</strong></p>
<p>When we try to change our password we will use <strong>passwd command</strong> which is owned by root as shown below. This <strong>passwd command</strong> file will try to edit some system config files such as /etc/passwd, /etc/shadow etc when we try to change our password. These files cannot be opened or viewed by normal user only root user will have permissions. So if we try to remove SUID and give full permissions to this passwd command file it cannot open other files such as /etc/shadow file to update the changes and we will get permission denied error or some other error when tried to execute passwd command. So passwd command is set with SUID to give root user permissions to normal user so that it can update /etc/shadow and other files.</p>
<p><strong>Example2: ping command</strong></p>
<p>Similarly if we take ping command, when we have to execute this command internally it should open socket files and open ports in order to send IP packets and receive IP packets to remote server. Normal users don’t have permissions to open socket files and open ports. So SUID bit is set on this file/command so that whoever executes this will get owner (Root user’s) permissions to them when executing this command. So when this command start executing it will inherits root user permissions to this normal user and opens require socket files and ports.</p>
<p>&nbsp;</p>
<p><strong>Example3: crontab and at command.</strong></p>
<p>When scheduling the jobs by using crontab or at command it is obious to edit some of the crontab related configuration files located in /etc which are not writable for normal users. So crontab/at commands are set with SUID in-order to write some data.</p>
<p><strong>How can I setup SUID for a file?</strong></p>
<p>SUID can be set in two ways</p>
<pre><strong>1) Symbolic way(s, Stands for Set) 2) Numerical/octal way(4)</strong></pre>
<p>Use chmod command to set SUID on file: file1.txt</p>
<p><strong>Symbolic way:</strong></p>
<pre><strong style="font-family: Consolas, Monaco, monospace; font-size: 12px; line-height: 18px; white-space: pre;">chmod u+s file1.txt</strong></pre>
<p>Here owner permission execute bit is set to SUID with +s</p>
<p><strong>Numerical way:</strong></p>
<pre><strong style="font-family: Consolas, Monaco, monospace; font-size: 12px; line-height: 18px; white-space: pre;">chmod 4750 file1.txt</strong></pre>
<p>Here in 4750, 4 indicates SUID bitset, 7 for full permissions for owner, 5 for write and execute permissions for group, and no permissions for others.</p>
<p><strong>How can I check if a file is set with SUID bit or not?</strong></p>
<p>Use ls –l to check if the x in owner permissions field is replaced by s or S</p>
<p>For example: file1.txt listing before and after SUID set</p>
<p><strong>Before SUID set:</strong></p>
<p><strong style="font-family: Consolas, Monaco, monospace; font-size: 12px; line-height: 18px; white-space: pre;">ls -l</strong></p>
<pre><strong>total 8</strong>

<strong>-rwxr--r-- 1 xyz xyzgroup 148 Dec 22 03:46 file1.txt</strong></pre>
<p><strong>After SUID set:</strong></p>
<p><strong style="font-family: Consolas, Monaco, monospace; font-size: 12px; line-height: 18px; white-space: pre;">ls -l</strong></p>
<pre><strong>total 8</strong>

<strong>-rw</strong><span style="color: #ff0000;"><strong>s</strong></span><strong>r--r-- 1 xyz xyzgroup 148 Dec 22 03:46 file1.txt</strong></pre>
<p><strong>Some FAQ’s related to SUID:</strong></p>
<p><strong>A) Where is SUID used?</strong></p>
<p>1) Where root login is required to execute some commands/programs/scripts.</p>
<p>2) Where you dont want to give credentials of a perticular user and but want to run some programs as the owner.</p>
<p>3) Where you dont want to use sudo command but want to give execute permission for a file/script etc.</p>
<p><strong>B) I am seeing “S” I.e. Capital “s” in the file permissions, what’s that?</strong></p>
<p>After setting SUID to a file/folder if you see ‘S’ in the file permission area that indicates that the file/folder does not have executable permissions for that user on that particular file/folder.</p>
<p>For example see below example</p>
<p><strong style="font-family: Consolas, Monaco, monospace; font-size: 12px; line-height: 18px; white-space: pre;">chmod u+s file1.txt</strong></p>
<pre><strong>ls -l</strong>
<strong>-rwSrwxr-x 1 surendra surendra 0 Dec 27 11:24 file1.txt</strong></pre>
<p>If you want to convert this S to s then add executable permissions to this file as show below</p>
<pre><strong>chmod u+x file1.txt</strong>
<strong>ls -l</strong>
<strong>-rwsrwxr-x 1 surendra surendra 0 Dec 5 11:24 file1.txt</strong></pre>
<p>you should see a smaller &#8216;s&#8217; in the executable permission position now.</p>
<p><strong>SUID with execute permissions:</strong></p>
<h1><strong><a href="http://www.linuxnix.com/wp-content/uploads/2011/12/Untitleddrawing-1.jpg"><img title="SUID_Linux" src="http://www.linuxnix.com/wp-content/uploads/2011/12/Untitleddrawing-1-300x195.jpg" alt="" width="300" height="195" /></a></strong></h1>
<p><strong>SUID with out execute permissions:</strong></p>
<p><a href="http://www.linuxnix.com/wp-content/uploads/2011/12/Untitleddrawing-2.jpg"><img class="alignnone size-medium wp-image-1280" title="SUID_Linux_without_execute_permissions" src="http://www.linuxnix.com/wp-content/uploads/2011/12/Untitleddrawing-2-300x185.jpg" alt="" width="300" height="185" /></a></p>
<p><strong>C) How can I find all the SUID set files in Linux/Unix.</strong></p>
<p><strong style="font-family: Consolas, Monaco, monospace; font-size: 12px; line-height: 18px; white-space: pre;">find / -perm +4000</strong></p>
<p>The above find command will check all the files which is set with SUID bit(4000).</p>
<p><strong>D) Can I set SUID for folders?</strong></p>
<p>Yes, you can if its required(you should remember one thing, that Linux treats everything as a file)</p>
<p><strong>E) What is SUID numerical value?</strong></p>
<p>It has the value 4 for SUID.</p>
<p>Please comment your thoughts about SUID usage in your company.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/TheLinuxJuggernaut?a=yb0vTrCfi9M:4eo9KP5OS6U:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/TheLinuxJuggernaut?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/TheLinuxJuggernaut?a=yb0vTrCfi9M:4eo9KP5OS6U:-BTjWOF_DHI"><img src="http://feeds.feedburner.com/~ff/TheLinuxJuggernaut?i=yb0vTrCfi9M:4eo9KP5OS6U:-BTjWOF_DHI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/TheLinuxJuggernaut?a=yb0vTrCfi9M:4eo9KP5OS6U:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/TheLinuxJuggernaut?d=dnMXMwOfBR0" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/TheLinuxJuggernaut/~4/yb0vTrCfi9M" height="1" width="1"/>]]></content:encoded><description>&lt;h1 style="text-align: center;"&gt;&lt;span style="color: #ff0000;"&gt;&lt;strong&gt;What is SUID and how to set SUID in Linux/Unix?&lt;/strong&gt;&lt;/span&gt;&lt;/h1&gt;
&lt;p&gt;There are some other special permission apart from the normal file permissions read, write and execute. They are &lt;strong&gt;SUID, SGID, Sticky Bit, ACL&amp;#8217;s and SELinux&lt;/strong&gt; etc for granular file/folder management by administrator. In this post we will see&lt;/p&gt;
&lt;pre&gt;&lt;strong&gt;1)What’s SUID?&lt;/strong&gt;
&lt;strong&gt;2)How to set SUID?&lt;/strong&gt;
&lt;strong&gt;3)Where to us SUID?&lt;/strong&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;What is SUID and how to set it in Linux?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;SUID&lt;/strong&gt; (&lt;strong&gt;S&lt;/strong&gt;et owner &lt;strong&gt;U&lt;/strong&gt;ser &amp;#8230; &lt;a href="http://www.linuxnix.com/2011/12/suid-set-suid-linuxunix.html" class="read_more"&gt;Continue Reading&lt;/a&gt;&lt;/p&gt;</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.linuxnix.com/2011/12/suid-set-suid-linuxunix.html/feed</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">1</slash:comments><feedburner:origLink>http://www.linuxnix.com/2011/12/suid-set-suid-linuxunix.html</feedburner:origLink></item><item><title>What is UMASK and how to define it in Linux/Unix?</title><link>http://feedproxy.google.com/~r/TheLinuxJuggernaut/~3/stkW6h3gXDE/umask-define-linuxunix.html</link><category>Uncategorized</category><category>chmod</category><category>permissions</category><category>umask</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Surendra Anne</dc:creator><pubDate>Tue, 27 Dec 2011 00:12:43 PST</pubDate><guid isPermaLink="false">http://www.linuxnix.com/?p=1256</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[
<p><a href="http://feedads.g.doubleclick.net/~a/kEcUFnmMqDpTLn-qbZx4EVV28Fw/0/da"><img src="http://feedads.g.doubleclick.net/~a/kEcUFnmMqDpTLn-qbZx4EVV28Fw/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/kEcUFnmMqDpTLn-qbZx4EVV28Fw/1/da"><img src="http://feedads.g.doubleclick.net/~a/kEcUFnmMqDpTLn-qbZx4EVV28Fw/1/di" border="0" ismap="true"></img></a></p><h1><strong>What is UMASK and how to define it in Linux?</strong></h1>
<p><strong></strong>UMASK(User Mask or User file creation MASK) is the default permission or base permissions given when a new file(even folder too, as Linux treats everything as files) is created on a Linux machine. Most of the Linux distros give 022(0022) as default UMASK. In other words, It is a system default permissions for newly created files/folders in the machine.</p>
<div>
<h2><strong>How to calculate UMASK in Linux?</strong></h2>
<p>Though umask value is same for files and folders but calculation of File base permissions and Directory base permissions are different.</p>
<pre><strong>The minimum and maximum UMASK value for a folder is 000 and 777</strong>
<strong> The minimum and maximum UMASK value for a file is 000 and 666</strong></pre>
<p><strong>Why 666 is the maximum value for file?</strong><br />
This is because only scripts and binaries should have execute permissions, normal and regular files should have just read and write permissions. Directories require execute permissions for viewing the contents in it, so they can have 777 as permissions.</p>
<p>Below are the permissions and its values used by UMASK. If you are Linux/Unix user you observe these are inverse to actual permissions values when setting up permissions to files/folders with CHMOD command.</p>
<pre><strong> 0 --Full permissions(Read, Write, Execute)</strong>
<strong> 1 --Write and read</strong>
<strong> 2 --Read and execute</strong>
<strong> 3 --Read only</strong>
<strong> 4 --Write and execute</strong>
<strong> 5 --Write only</strong>
<strong> 6 --Execute onlyadminadmin</strong>
<strong> 7 --No permissions</strong></pre>
<p><strong>How to remember these and calculate the file and folder permissions?</strong><br />
Consider above values are inverse to actual permissions. Suppose your UMASK value is 0027(027).</p>
<p><strong>For folder:</strong><br />
To calculate actual folder permissions from UMASK is done in two steps</p>
<p><strong>Step1:Logical Negate the UMASK</strong></p>
<pre><strong>Not(027) = 750</strong></pre>
<p><strong>Step2: Logical AND this number with 777</strong></p>
<pre><strong>777 AND 750 = 750</strong></pre>
<p>So actual folder permissions is 750 when its created. Owner will get full permission, group gets execute and write permissions and others no permissions</p>
<p>In other words and simple way..<br />
We have to subtract 027 from 777 then we will get the actual folder permissions.</p>
<pre><strong>777 - 027 = 750</strong></pre>
<p>which is nothing but full permissions for the owner, read and execute permissions for group and no permissions for others.</p>
<p><strong>For files:</strong><br />
To get actuall file permissions from UMASK is done in two steps</p>
<p><strong>Step1:Logical Negate the UMASK</strong></p>
<pre><strong>Not(027) = 750</strong></pre>
<p><strong>Step2: Logical AND this number with 666</strong></p>
<pre><strong>666 AND 750 = 640</strong></pre>
<p>For your understanding purpose we have calculated this below equation to get what actuall AND operator do.</p>
<pre><strong>110 + 111 = 110(6)</strong>
<strong>110 + 101 = 100(4)</strong>
<strong>110 + 000 = 000(0)</strong></pre>
<p><strong>How to see default UMASK?</strong><br />
just type umask and you will get whats the default UMASK</p>
<pre><strong>umask</strong></pre>
<p><strong>Output</strong></p>
<pre><strong>0022</strong></pre>
<p><strong>Some FAQ related to umask:</strong></p>
<p><strong>1)How to setup or change default UMASK for all the new users?</strong><br />
The UMASK value can be set in /etc/profile for all the new users. Open this file as root user and given the below line in the file.</p>
<pre><strong>umask 027</strong></pre>
<p><strong>2)How to setup or change default UMASK for existing users?</strong><br />
For existing users you can edit<strong> ~/.bashrc</strong> file in their home directory. This should be done for all the users one by one or if the machine is having lots and lots of users then you can write a shell script for this.</p>
<p><strong>3)I see people are using 0022 and 022 as UMASK, is there any difference between them?</strong></p>
<p>There is no difference between these two, both indicates one and the same. The preceding 0 indicates there is no SUID/SGID/Sticky bit information set.</p>
<p><strong>4)What is the perferred UMASK value for a system for Security reasons?</strong></p>
<p>Prefered is 027(0027) for security reasons becasue this will restrict others not to read/write/execute that file/folder</p>
<p><strong>5)I see umask value as 022 in my vsftpd config file? what actually this means?</strong></p>
<p>When you see 022 as umask value in vsftpd config file that indicates that users who are going to create files will get 644  and for folders its 755 respectively.</p>
<p>To know more about umask refer man pages and info pages.</p>
<pre><strong>man umask</strong>

<strong>info umask</strong></pre>
<p>Please comment at comments section for any queries related to umask.</p>
</div>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/TheLinuxJuggernaut?a=stkW6h3gXDE:2tc_AHvjvj0:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/TheLinuxJuggernaut?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/TheLinuxJuggernaut?a=stkW6h3gXDE:2tc_AHvjvj0:-BTjWOF_DHI"><img src="http://feeds.feedburner.com/~ff/TheLinuxJuggernaut?i=stkW6h3gXDE:2tc_AHvjvj0:-BTjWOF_DHI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/TheLinuxJuggernaut?a=stkW6h3gXDE:2tc_AHvjvj0:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/TheLinuxJuggernaut?d=dnMXMwOfBR0" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/TheLinuxJuggernaut/~4/stkW6h3gXDE" height="1" width="1"/>]]></content:encoded><description>&lt;h1&gt;&lt;strong&gt;What is UMASK and how to define it in Linux?&lt;/strong&gt;&lt;/h1&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;UMASK(User Mask or User file creation MASK) is the default permission or base permissions given when a new file(even folder too, as Linux treats everything as files) is created on a Linux machine. Most of the Linux distros give 022(0022) as default UMASK. In other words, It is a system default permissions for newly created files/folders in the machine.&lt;/p&gt;
&lt;div&gt;
&lt;h2&gt;&lt;strong&gt;How to calculate UMASK in Linux?&lt;/strong&gt;&lt;/h2&gt;&amp;#8230; &lt;a href="http://www.linuxnix.com/2011/12/umask-define-linuxunix.html" class="read_more"&gt;Continue Reading&lt;/a&gt;&lt;/div&gt;</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.linuxnix.com/2011/12/umask-define-linuxunix.html/feed</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">4</slash:comments><feedburner:origLink>http://www.linuxnix.com/2011/12/umask-define-linuxunix.html</feedburner:origLink></item><item><title>chgrp command explained in Linux with examples</title><link>http://feedproxy.google.com/~r/TheLinuxJuggernaut/~3/lhE0xuR7LHw/chgrp-command-explained-linux-examples.html</link><category>Administration</category><category>chgrp</category><category>chown</category><category>permissions</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Surendra Anne</dc:creator><pubDate>Fri, 16 Dec 2011 10:28:59 PST</pubDate><guid isPermaLink="false">http://www.linuxnix.com/?p=1246</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[
<p><a href="http://feedads.g.doubleclick.net/~a/KtsHKpPCMYu0g9QrsxoZ1pnRvBI/0/da"><img src="http://feedads.g.doubleclick.net/~a/KtsHKpPCMYu0g9QrsxoZ1pnRvBI/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/KtsHKpPCMYu0g9QrsxoZ1pnRvBI/1/da"><img src="http://feedads.g.doubleclick.net/~a/KtsHKpPCMYu0g9QrsxoZ1pnRvBI/1/di" border="0" ismap="true"></img></a></p><p><strong>CHGRP</strong>(CHange GRouP) is one more command which is useful to change group associated to a file/folder from one group to other in a Linux box. This is sister command to <strong>chown</strong> which is used to change owner of the file/folder as well as group name associated with that file.</p>
<h1></h1>
<h1><span style="text-decoration: underline;"><strong>chgrp command syntax:</strong></span></h1>
<p>&nbsp;</p>
<pre><span style="font-family: Consolas, Monaco, monospace; font-size: 12px; line-height: 18px; white-space: pre;"> </span><strong style="font-family: Consolas, Monaco, monospace; font-size: 12px; line-height: 18px; white-space: pre;">chgrp options groupname file/foldername</strong></pre>
<p>&nbsp;</p>
<h1><span style="text-decoration: underline;"><strong>Learn chgrp with examples:</strong></span></h1>
<p><strong>Example1:</strong> Change group name:sales of a file to other group name:hrgroup.</p>
<pre><strong>chgrp hrgroup file1</strong></pre>
<p><strong>Example2:</strong> Give access permissions to a command so that the command can be executed by all users belonging to apache-admins</p>
<pre><strong>chgrp apache-admins /etc/init.d/httpd</strong></pre>
<p><strong>Example3: </strong>Change group ownership all the files located in /var/apache to group:apache</p>
<pre><strong>chgrp -R apache /var/apache</strong></pre>
<p><strong>Example4:</strong>Change group ownership forcefully</p>
<pre><strong>chgrp -f apache /var/apache</strong></pre>
<pre></pre>
<h2><span style="text-decoration: underline;">Difference between chown and chgrp</span></h2>
<p>1) <strong>chown</strong> command is used to change ownership as well as group name associated to different one, where as <strong>chgrp</strong> can change only group associated to it.</p>
<p>2) Many people say that regular user only able to use <strong>chgrp</strong> to change the group if the user belongs to them. But it’s not true a user can use <strong>chown</strong> and <strong>chgrp</strong> irrespective to change group to one of their group because chown is located in /bin folder so every can use it with some limited access.</p>
<p>&nbsp;</p>
<p><span style="text-decoration: underline;"> <strong style="font-size: 20px;">Usages of chgrp command:</strong></span></p>
<p>1)Used to change group ownership from one group to other group for a file/folder</p>
<p>2)As a security measure if you want to give permissions to a command to some group you can use this command.</p>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Enhanced by Zemanta" href="http://www.zemanta.com/"><img class="zemanta-pixie-img" style="border: none; float: right;" src="http://img.zemanta.com/zemified_e.png?x-id=1c5163a2-a110-47b3-8194-68e3b73cfcda" alt="Enhanced by Zemanta" /></a></div>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/TheLinuxJuggernaut?a=lhE0xuR7LHw:ZIv7Ts6jJEI:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/TheLinuxJuggernaut?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/TheLinuxJuggernaut?a=lhE0xuR7LHw:ZIv7Ts6jJEI:-BTjWOF_DHI"><img src="http://feeds.feedburner.com/~ff/TheLinuxJuggernaut?i=lhE0xuR7LHw:ZIv7Ts6jJEI:-BTjWOF_DHI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/TheLinuxJuggernaut?a=lhE0xuR7LHw:ZIv7Ts6jJEI:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/TheLinuxJuggernaut?d=dnMXMwOfBR0" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/TheLinuxJuggernaut/~4/lhE0xuR7LHw" height="1" width="1"/>]]></content:encoded><description>&lt;p&gt;&lt;strong&gt;CHGRP&lt;/strong&gt;(CHange GRouP) is one more command which is useful to change group associated to a file/folder from one group to other in a Linux box. This is sister command to &lt;strong&gt;chown&lt;/strong&gt; which is used to change owner of the file/folder as well as group name associated with that file.&lt;/p&gt;
&lt;h1&gt;&lt;/h1&gt;
&lt;h1&gt;&lt;span style="text-decoration: underline;"&gt;&lt;strong&gt;chgrp command syntax:&lt;/strong&gt;&lt;/span&gt;&lt;/h1&gt;
&lt;p&gt;&amp;#160;&lt;/p&gt;
&lt;pre&gt;&lt;span style="font-family: Consolas, Monaco, monospace; font-size: 12px; line-height: 18px; white-space: pre;"&gt; &lt;/span&gt;&lt;strong style="font-family: Consolas, Monaco, monospace; font-size: 12px; line-height: 18px; white-space: pre;"&gt;chgrp options groupname file/foldername&lt;/strong&gt;&lt;/pre&gt;
&lt;p&gt;&amp;#160;&lt;/p&gt;
&lt;h1&gt;&lt;span style="text-decoration: underline;"&gt;&lt;strong&gt;Learn chgrp with examples:&lt;/strong&gt;&lt;/span&gt;&lt;/h1&gt;
&lt;p&gt;&lt;strong&gt;Example1:&lt;/strong&gt; Change group name:sales of a file to other group name:hrgroup.&amp;#8230; &lt;a href="http://www.linuxnix.com/2011/12/chgrp-command-explained-linux-examples.html" class="read_more"&gt;Continue Reading&lt;/a&gt;&lt;/p&gt;</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.linuxnix.com/2011/12/chgrp-command-explained-linux-examples.html/feed</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">1</slash:comments><feedburner:origLink>http://www.linuxnix.com/2011/12/chgrp-command-explained-linux-examples.html</feedburner:origLink></item></channel></rss>

