<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>I loved Ubutu.Did you?</title>
	<atom:link href="http://livebythecode.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://livebythecode.wordpress.com</link>
	<description>Just another WordPress.com weblog</description>
	<lastBuildDate>Sat, 25 Aug 2007 12:38:27 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='livebythecode.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>I loved Ubutu.Did you?</title>
		<link>http://livebythecode.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://livebythecode.wordpress.com/osd.xml" title="I loved Ubutu.Did you?" />
	<atom:link rel='hub' href='http://livebythecode.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Its a fortnight</title>
		<link>http://livebythecode.wordpress.com/2007/08/25/its-a-fortnight/</link>
		<comments>http://livebythecode.wordpress.com/2007/08/25/its-a-fortnight/#comments</comments>
		<pubDate>Sat, 25 Aug 2007 12:38:27 +0000</pubDate>
		<dc:creator>livlifekingsize</dc:creator>
				<category><![CDATA[chmod]]></category>
		<category><![CDATA[file permissions in ubuntu]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://livebythecode.wordpress.com/2007/08/25/its-a-fortnight/</guid>
		<description><![CDATA[since I installed Ubuntu.And must say, I loved it.Especially with the new 3d look offered by beryl,its a browsing and operating pleasure.Whats more,you have so much online help available,its easy learning to operate it.For those moving from Windows to Ubuntu,it must be scary in the beginning installing new softwares,as you don&#8217;t have .exe files where [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=livebythecode.wordpress.com&amp;blog=1583101&amp;post=3&amp;subd=livebythecode&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>since I installed Ubuntu.And must say, I loved it.Especially with the new 3d look offered by beryl,its a browsing and operating pleasure.Whats more,you have so much online help available,its easy learning<br />
to operate it.For those moving from Windows to Ubuntu,it must be scary in the beginning installing new softwares,as you don&#8217;t have .exe files where you double click on them,and lo! , the software gets installed.</p>
<p>Since its an open source thing,you not only have the previledge of making changes as you like,but it also becomes a necessity.And this OS might look impossible at times.But to quote Walt Disney -</p>
<p>&#8220;Doing the impossible is kind of fun&#8221;</p>
<p>One of the major commands to use at the terminal(yeah,the command prompt of Linux) is chmod,and here I explain how to use it :</p>
<p>There are three types of access restrictions:</p>
<table width="282">
<tr>
<td><strong>Permission</strong></td>
<td><strong>Action</strong></td>
<td><strong>chmod option</strong></td>
</tr>
<tr>
<td>read</td>
<td>(view)</td>
<td>r or 4</td>
</tr>
<tr>
<td>write</td>
<td>(edit)</td>
<td>w or 2</td>
</tr>
<tr>
<td>execute</td>
<td>(execute)</td>
<td>x or 1</td>
</tr>
</table>
<p>There are also three types of user restrictions:</p>
<table>
<tr>
<td><strong>User</strong></td>
<td><strong><em>ls</em> output</strong></td>
</tr>
<tr>
<td>owner</td>
<td><tt>-rwx------</tt></td>
</tr>
<tr>
<td>group</td>
<td><tt>----rwx---</tt></td>
</tr>
<tr>
<td>other</td>
<td><tt>-------rwx</tt></td>
</tr>
</table>
<p>Directories have directory permissions. The directory permissions restrict different actions than with files or device nodes.</p>
<table>
<tr>
<td><strong>Permission</strong></td>
<td><strong>Action</strong></td>
<td><strong>chmod option</strong></td>
</tr>
<tr>
<td>read</td>
<td>(view contents, i.e. ls command)</td>
<td>r or 4</td>
</tr>
<tr>
<td>write</td>
<td>(create or remove files from dir)</td>
<td>w or 2</td>
</tr>
<tr>
<td>execute</td>
<td>(cd into directory)</td>
<td>x or 1</td>
</tr>
</table>
<ul>
<li> read restricts or allows viewing the directories contents, i.e. <em>ls</em> command</li>
<li> write restricts or allows creating new files or deleting files in the directory. (Caution: <strong>write access for a directory allows deleting of files in the directory even if the user does not have write permissions for the file!</strong>)</li>
<li> execute restricts or allows changing into the directory, i.e. <em>cd</em> command<br />
<h3>Permissions in Action</h3>
<pre>user@host:/home/user$ ls -l /etc/hosts

-rw-r--r--  1 root root 288 2005-11-13 19:24 /etc/hosts

user@host:/home/user$</pre>
<p>Using the example above we have the file &#8220;/etc/hosts&#8221; which is owned by the user root and belongs to the root group.</p>
<p>What are the permissions from the above /etc/hosts ls output?</p>
<pre>-rw-r--r--owner = Read &amp; Write (rw-)

group = Read (r--)

other = Read (r--)</pre>
<h3>Changing Permissions</h3>
<p>The command to use when modifying permissions is chmod. There are two ways to modify permissions, with numbers or with letters. Using letters is easier to understand for most people. When modifying permissions be careful not to create security problems. Some files are configured to have very restrictive permissions to prevent unauthorized access. For example, the /etc/shadow file (file that stores all local user passwords) does not have permissions for regular users to read or otherwise access.</p>
<pre>user@host:/home/user# ls -l /etc/shadow

-rw-r-----  1 root shadow 869 2005-11-08 13:16 /etc/shadow

user@host:/home/user#Permissions:

owner = Read &amp; Write (rw-)

group = Read (r--)

other = None (---)

Ownership:

owner = root

group = shadow</pre>
<h4>chmod with Letters</h4>
<pre>Usage: chmod {options} filename</pre>
<table>
<tr>
<td><strong>Options</strong></td>
<td><strong>Definition</strong></td>
</tr>
<tr>
<td>u</td>
<td>owner</td>
</tr>
<tr>
<td>g</td>
<td>group</td>
</tr>
<tr>
<td>o</td>
<td>other</td>
</tr>
<tr>
<td>x</td>
<td>execute</td>
</tr>
<tr>
<td>w</td>
<td>write</td>
</tr>
<tr>
<td>r</td>
<td>read</td>
</tr>
<tr>
<td>+</td>
<td>add permission</td>
</tr>
<tr>
<td>-</td>
<td>remove permission</td>
</tr>
<tr>
<td>=</td>
<td>set permission</td>
</tr>
</table>
<p>Here are a few examples of chmod usage with letters (try these out on your system).</p>
<p>First create some empty files:</p>
<pre>user@host:/home/user$ touch file1 file2 file3 file4

user@host:/home/user$ ls -l

total 0

-rw-r--r--  1 user user 0 Nov 19 20:13 file1

-rw-r--r--  1 user user 0 Nov 19 20:13 file2

-rw-r--r--  1 user user 0 Nov 19 20:13 file3

-rw-r--r--  1 user user 0 Nov 19 20:13 file4</pre>
<p>Add owner execute bit:</p>
<pre>user@host:/home/user$ chmod u+x file1

user@host:/home/user$ ls -l file1

-rwxr--r--  1 user user 0 Nov 19 20:13 file1</pre>
<p>Add other write &amp; execute bit:</p>
<pre>user@host:/home/user$ chmod o+wx file2

user@host:/home/user$ ls -l file2

-rw-r--rwx  1 user user 0 Nov 19 20:13 file2</pre>
<p>Remove group read bit:</p>
<pre>user@host:/home/user$ chmod g-r file3

user@host:/home/user$ ls -l file3

-rw----r--  1 user user 0 Nov 19 20:13 file3</pre>
<p>Add read, write and execute to everyone:</p>
<pre>user@host:/home/user$ chmod ugo+rwx file4

user@host:/home/user$ ls -l file4

-rwxrwxrwx  1 user user 0 Nov 19 20:13 file4

user@host:/home/user$</pre>
<h4>chmod with Numbers</h4>
<pre>Usage: chmod {options} filename</pre>
<table>
<tr>
<td><strong>Options</strong></td>
<td><strong>Definition</strong></td>
</tr>
<tr>
<td><tt>#--</tt></td>
<td>owner</td>
</tr>
<tr>
<td><tt>-#-</tt></td>
<td>group</td>
</tr>
<tr>
<td><tt>--#</tt></td>
<td>other</td>
</tr>
<tr>
<td>1</td>
<td>execute</td>
</tr>
<tr>
<td>2</td>
<td>write</td>
</tr>
<tr>
<td>4</td>
<td>read</td>
</tr>
</table>
<p>Owner, Group and Other is represented by three numbers. To get the value for the options determine the type of access needed for the file then add.</p>
<p>For example if you want a file that has -rw-rw-rwx permissions you will use the following:</p>
<table>
<tr>
<td><strong>Owner</strong></td>
<td><strong>Group</strong></td>
<td><strong>Other</strong></td>
</tr>
<tr>
<td>read &amp; write</td>
<td>read &amp; write</td>
<td>read, write &amp; execute</td>
</tr>
<tr>
<td>4+2=6</td>
<td>4+2=6</td>
<td>4+2+1=7</td>
</tr>
</table>
<pre>user@host:/home/user$ chmod 667 filename</pre>
<p>Another example if you want a file that has &#8211;w-r-x&#8211;x permissions you will use the following:</p>
<table>
<tr>
<td><strong>Owner</strong></td>
<td><strong>Group</strong></td>
<td><strong>Other</strong></td>
</tr>
<tr>
<td>write</td>
<td>read &amp; execute</td>
<td>execute</td>
</tr>
<tr>
<td>2</td>
<td>4+1=5</td>
<td>1</td>
</tr>
</table>
<pre>user@host:/home/user$ chmod 251 filename</pre>
<p>Here are a few examples of chmod usage with numbers .</p>
<p>First create some empty files:</p>
<pre>user@host:/home/user$ touch file1 file2 file3 file4

user@host:/home/user$ ls -l

total 0

-rw-r--r--  1 user user 0 Nov 19 20:13 file1

-rw-r--r--  1 user user 0 Nov 19 20:13 file2

-rw-r--r--  1 user user 0 Nov 19 20:13 file3

-rw-r--r--  1 user user 0 Nov 19 20:13 file4</pre>
<p>Add owner execute bit:</p>
<pre>user@host:/home/user$ chmod 744 file1

user@host:/home/user$ ls -l file1

-rwxr--r--  1 user user 0 Nov 19 20:13 file1</pre>
<p>Add other write &amp; execute bit:</p>
<pre>user@host:/home/user$ chmod 647 file2

user@host:/home/user$ ls -l file2

-rw-r--rwx  1 user user 0 Nov 19 20:13 file2</pre>
<p>Remove group read bit:</p>
<pre>user@host:/home/user$ chmod 604 file3

user@host:/home/user$ ls -l file3

-rw----r--  1 user user 0 Nov 19 20:13 file3</pre>
<p>Add read, write and execute to everyone:</p>
<pre>user@host:/home/user$ chmod 777 file4

user@host:/home/user$ ls -l file4

-rwxrwxrwx  1 user user 0 Nov 19 20:13 file4

user@host:/home/user$</pre>
<h4>chmod with sudo</h4>
<p>Changing permissions on files that you do not have ownership of: (<strong>Note</strong> that changing permissions the wrong way on the wrong files can quickly mess up your system a great deal! Please be careful when using <strong>sudo</strong>!)</p>
<pre>user@host:/home/user$ ls -l /usr/local/bin/somefile

-rw-r--r--  1 root root 550 2005-11-13 19:45 /usr/local/bin/somefile

user@host:/home/user$user@host:/home/user$ sudo chmod o+x /usr/local/bin/somefile

user@host:/home/user$ ls -l /usr/local/bin/somefile

-rw-r--r-x  1 root root 550 2005-11-13 19:45 /usr/local/bin/somefile

user@host:/home/user$</pre>
<h3>Recursive Permission Changes</h3>
<p>To change the permissions of multiple files and directories with one command. Please note the warning in the chmod with sudo section and the Warning with Recursive chmod section.</p>
<h4>Recursive chmod with -R and sudo</h4>
<p>To change all the permissions of each file and folder under a specified directory at once, use sudo chmod with -R</p>
<pre>user@host:/home/user$ sudo chmod 777 -R /path/to/someDirectory

user@host:/home/user$ ls -l

total 3

-rwxrwxrwx  1 user user 0 Nov 19 20:13 file1

drwxrwxrwx  2 user user 4096 Nov 19 20:13 folder

-rwxrwxrwx  1 user user 0 Nov 19 20:13 file2</pre>
<h4>Recursive chmod using find, pipemill, and sudo</h4>
<p>To assign reasonably secure permissions to files and folders/directories, it&#8217;s common to give files a permission of 644, and directories a 755 permission, since chmod -R assigns to both. Use the find command and a pipemill to chmod as in the following example.</p>
<p>To change permission of only files under a specified directory.</p>
<pre>user@host:/home/user$ find /path/to/someDirectory -type f | while read var1; do sudo chmod 644 $var1; done

user@host:/home/user$ ls -l

total 3

-rw-r--r--  1 user user 0 Nov 19 20:13 file1

drwxrwxrwx  2 user user 4096 Nov 19 20:13 folder

-rw-r--r--  1 user user 0 Nov 19 20:13 file2</pre>
<p>To change permission of only directories under a specified directory (including that directory):</p>
<pre>user@host:/home/user$ find /path/to/someDirectory -type d | while read var1; do sudo chmod 755 $var1; done

user@host:/home/user$ ls -l

total 3

-rw-r--r--  1 user user 0 Nov 19 20:13 file1

drwxr--r--  2 user user 4096 Nov 19 20:13 folder

-rw-r--r--  1 user user 0 Nov 19 20:13 file2</pre>
<p>If you accidentally change the permissions and this command no longer works because find doesn&#8217;t have permission to read the directory you specified, put sudo before find.</p>
<h3>Recursive chmod</h3>
<p>To grant file permissions to all containing folders sub-folders and files,use Recursive chmod .Please note, Recursively deleting or chown-ing files are extremely dangerous. You will not be the first, nor the last, person to add one too many spaces into the command. This example will hose your system:</p>
<pre>user@host:/home/user$ sudo chmod -R / home/john/Desktop/tempfiles</pre>
<p>Note the space between the first / and home.I haven&#8217;t tried this one personally.</li>
</ul>
<p>Long Live Ubuntu!</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/livebythecode.wordpress.com/3/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/livebythecode.wordpress.com/3/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/livebythecode.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/livebythecode.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/livebythecode.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/livebythecode.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/livebythecode.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/livebythecode.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/livebythecode.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/livebythecode.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/livebythecode.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/livebythecode.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/livebythecode.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/livebythecode.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/livebythecode.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/livebythecode.wordpress.com/3/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=livebythecode.wordpress.com&amp;blog=1583101&amp;post=3&amp;subd=livebythecode&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://livebythecode.wordpress.com/2007/08/25/its-a-fortnight/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/dc4155595a08428480bcd5e115b55e00?s=96&#38;d=identicon" medium="image">
			<media:title type="html">livlifekingsize</media:title>
		</media:content>
	</item>
		<item>
		<title>Hello world!</title>
		<link>http://livebythecode.wordpress.com/2007/08/25/hello-world/</link>
		<comments>http://livebythecode.wordpress.com/2007/08/25/hello-world/#comments</comments>
		<pubDate>Sat, 25 Aug 2007 12:21:21 +0000</pubDate>
		<dc:creator>livlifekingsize</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Welcome to WordPress.com. This is your first post. Edit or delete it and start blogging!<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=livebythecode.wordpress.com&amp;blog=1583101&amp;post=1&amp;subd=livebythecode&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Welcome to <a href="http://wordpress.com/">WordPress.com</a>. This is your first post. Edit or delete it and start blogging!</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/livebythecode.wordpress.com/1/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/livebythecode.wordpress.com/1/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/livebythecode.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/livebythecode.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/livebythecode.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/livebythecode.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/livebythecode.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/livebythecode.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/livebythecode.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/livebythecode.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/livebythecode.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/livebythecode.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/livebythecode.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/livebythecode.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/livebythecode.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/livebythecode.wordpress.com/1/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=livebythecode.wordpress.com&amp;blog=1583101&amp;post=1&amp;subd=livebythecode&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://livebythecode.wordpress.com/2007/08/25/hello-world/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/dc4155595a08428480bcd5e115b55e00?s=96&#38;d=identicon" medium="image">
			<media:title type="html">livlifekingsize</media:title>
		</media:content>
	</item>
	</channel>
</rss>
