<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>&#60;Code Zen /&#62; &#187; permissions</title>
	<atom:link href="http://www.code-zen.net/tag/permissions/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.code-zen.net</link>
	<description>Peter Anselmo&#039;s Home on the Web</description>
	<lastBuildDate>Wed, 12 Oct 2011 01:11:59 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>The Sticky Bit</title>
		<link>http://www.code-zen.net/2009/sticky-bit/</link>
		<comments>http://www.code-zen.net/2009/sticky-bit/#comments</comments>
		<pubDate>Wed, 21 Jan 2009 06:50:48 +0000</pubDate>
		<dc:creator>Peter Anselmo</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[permissions]]></category>

		<guid isPermaLink="false">http://code-zen.net/?p=189</guid>
		<description><![CDATA[Just about any linux user is familiar with the unix permission system. You have three categories of users (user, group, other) and three different permission options (read, write execute). However, most users don&#8217;t know about several advanced permissions, one of which is the sticky bit. Besides having a cool name, the sticky bit provides a [...]]]></description>
			<content:encoded><![CDATA[<p>Just about any linux user is familiar with the unix permission system.  You have three categories of users (user, group, other) and three different permission options (read, write execute).  However, most users don&#8217;t know about several advanced permissions, one of which is the sticky bit.</p>
<p>Besides having a cool name, the sticky bit provides a very useful function: when set as a directory permission it lets anyone add things the the directory (write access), but they can only delete things they own.  Normally, allowing all users write access also allows all users to delete anything (yeah, that&#8217;s dangerous).</p>
<p>In particular, users can only remove files if at least one of the following is true:<br />
-The user is the owner of the file<br />
-The user is the owner of the parent directory<br />
-The user has write permissions on the file</p>
<p>When is this useful?  It&#8217;s commonly found in var directories, when everyone needs to be able to create files, but shouldn&#8217;t modify files for other users.  It&#8217;s also common in mailbox directories for the same reason.  I found it particularly useful for a media folder that is shared between users.  Users can add Pictures and Videos to the folder, but can&#8217;t delete those belonging to others.</p>
<p>So how do you set it?<br />
-For chmod in relative mode, the sticky bit is designated by a &#8220;t&#8221;</p>
<pre># chmod t filename</pre>
<p>-For chmod in absolute mode, the sticky bit can be added by prepending a &#8220;1&#8243; the the permission.</p>
<pre>#chmod 1777 dirname</pre>
<p>Cool huh?</p>
<div class="lightsocial_container"><a class="lightsocial_a" href="http://digg.com/submit?url=http%3A%2F%2Fwww.code-zen.net%2F2009%2Fsticky-bit%2F&amp;title=The+Sticky+Bit" ><img class="lightsocial_img" src="http://www.code-zen.net/wp-content/plugins/light-social/digg.png" alt="Digg This" title="Digg This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.reddit.com/submit?url=http%3A%2F%2Fwww.code-zen.net%2F2009%2Fsticky-bit%2F&amp;title=The+Sticky+Bit" ><img class="lightsocial_img" src="http://www.code-zen.net/wp-content/plugins/light-social/reddit.png" alt="Reddit This" title="Reddit This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.code-zen.net%2F2009%2Fsticky-bit%2F&amp;title=The+Sticky+Bit" ><img class="lightsocial_img" src="http://www.code-zen.net/wp-content/plugins/light-social/stumbleupon.png" alt="Stumble Now!" title="Stumble Now!" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://buzz.yahoo.com/buzz?targetUrl=http%3A%2F%2Fwww.code-zen.net%2F2009%2Fsticky-bit%2F&amp;headline=The+Sticky+Bit" ><img class="lightsocial_img" src="http://www.code-zen.net/wp-content/plugins/light-social/yahoo_buzz.png" alt="Buzz This" title="Buzz This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dzone.com/links/add.html?title=The+Sticky+Bit&amp;url=http%3A%2F%2Fwww.code-zen.net%2F2009%2Fsticky-bit%2F" ><img class="lightsocial_img" src="http://www.code-zen.net/wp-content/plugins/light-social/dzone.png" alt="Vote on DZone" title="Vote on DZone" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=The+Sticky+Bit&amp;u=http%3A%2F%2Fwww.code-zen.net%2F2009%2Fsticky-bit%2F" ><img class="lightsocial_img" src="http://www.code-zen.net/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://delicious.com/save?title=The+Sticky+Bit&amp;url=http%3A%2F%2Fwww.code-zen.net%2F2009%2Fsticky-bit%2F" ><img class="lightsocial_img" src="http://www.code-zen.net/wp-content/plugins/light-social/delicious.png" alt="Bookmark this on Delicious" title="Bookmark this on Delicious" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=The+Sticky+Bit&amp;url=http%3A%2F%2Fwww.code-zen.net%2F2009%2Fsticky-bit%2F" ><img class="lightsocial_img" src="http://www.code-zen.net/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=The+Sticky+Bit&amp;url=http%3A%2F%2Fwww.code-zen.net%2F2009%2Fsticky-bit%2F" ><img class="lightsocial_img" src="http://www.code-zen.net/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fwww.code-zen.net%2F2009%2Fsticky-bit%2F&amp;title=The+Sticky+Bit&amp;summary=&amp;source=" ><img class="lightsocial_img" src="http://www.code-zen.net/wp-content/plugins/light-social/linkedin.png" alt="Share on LinkedIn" title="Share on LinkedIn" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.technorati.com/faves?add=http%3A%2F%2Fwww.code-zen.net%2F2009%2Fsticky-bit%2F" ><img class="lightsocial_img" src="http://www.code-zen.net/wp-content/plugins/light-social/technorati.png" alt="Bookmark this on Technorati" title="Bookmark this on Technorati" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Fwww.code-zen.net%2F2009%2Fsticky-bit%2F" ><img class="lightsocial_img" src="http://www.code-zen.net/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.google.com/buzz/post?url=http%3A%2F%2Fwww.code-zen.net%2F2009%2Fsticky-bit%2F" ><img class="lightsocial_img" src="http://www.code-zen.net/wp-content/plugins/light-social/google_buzz.png" alt="Google Buzz (aka. Google Reader)" title="Google Buzz (aka. Google Reader)" /></a>&nbsp;&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://www.code-zen.net/2009/sticky-bit/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

