<?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/"
	>

<channel>
	<title>MJS1&#124;dotcom &#187; Linux</title>
	<atom:link href="http://www.mjs1.com/category/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mjs1.com</link>
	<description>Gettin' It Done with Code</description>
	<pubDate>Thu, 01 Apr 2010 11:05:25 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Creating a favicon</title>
		<link>http://www.mjs1.com/2009/06/03/creating-a-favicon/</link>
		<comments>http://www.mjs1.com/2009/06/03/creating-a-favicon/#comments</comments>
		<pubDate>Wed, 03 Jun 2009 12:08:04 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Apache]]></category>

		<guid isPermaLink="false">http://www.mjs1.com/?p=92</guid>
		<description><![CDATA[To jazz up your site and make it look professional, you should add a favicon icon.  This is the icon that shows up in the url of your browser.  An easy way to create a favicon is to use one of the free favicon site out there.  One such on is.
http://www.favicon.cc/?action=edit_image&#38;file_id=35382
]]></description>
			<content:encoded><![CDATA[<p>To jazz up your site and make it look professional, you should add a favicon icon.  This is the icon that shows up in the url of your browser.  An easy way to create a favicon is to use one of the free favicon site out there.  One such on is.</p>
<p><a href="http://www.favicon.cc/?action=edit_image&amp;file_id=35382">http://www.favicon.cc/?action=edit_image&amp;file_id=35382</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.mjs1.com/2009/06/03/creating-a-favicon/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Securing your WordPress installation</title>
		<link>http://www.mjs1.com/2009/05/15/securing-your-wordpress-installation/</link>
		<comments>http://www.mjs1.com/2009/05/15/securing-your-wordpress-installation/#comments</comments>
		<pubDate>Fri, 15 May 2009 15:40:04 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Linux]]></category>

		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.mjs1.com/?p=67</guid>
		<description><![CDATA[Found this nice article on securing your wordpress installation,  http://codex.wordpress.org/Hardening_WordPress.
The chmod command it used to change the permissions of files and directories.  It should be noted that directories and files need different types of permisssions.  For instance, directories need the x (execute) permision to be able to list files and yence for your wordpress to [...]]]></description>
			<content:encoded><![CDATA[<p>Found this nice article on securing your wordpress installation,  <a href="http://codex.wordpress.org/Hardening_WordPress">http://codex.wordpress.org/Hardening_WordPress</a>.</p>
<p>The chmod command it used to change the permissions of files and directories.  It should be noted that directories and files need different types of permisssions.  For instance, directories need the x (execute) permision to be able to list files and yence for your wordpress to run. </p>
<p>For the most secure installation, make your permissions very restrictive and open them up as necessary.</p>
<p>In general, you should be the owner of your files and directories and be able to read, write and execute, rwx or 7.  The group assigned to the files and folders should be the group that is running the apache web service.  For the default CentOS installation, this group is apache.  For the group chmod setting, directories should be set to r-x (5)and files should be r&#8211; (4).  To get all the functionality out of wordpress, you may have to loosen that a bit, but it is a good starting point.  See the article mentioned above for more information.</p>
<p>Ok, so here comes the tricky part.  How do you get directories to be one type of permission and files to be another type of permission.  The -R option for chmod will apply the setting to all files and folders recursively and this is not exactly what we want.  So we need to do this in multiple steps.</p>
<ol style="text-align: left;">
<li>cd (change directory) to the directory where wordpress is installed.</li>
<li>Use the chmod command with the -R recursive flag to change all directories and files to a value of 750.  This will give the owner, you, full permissions, it will give the group, apache, write and execute permissions (note, we will remove the execute on files in the next step), and is give no permissions to anyone else.
<ul>
<li>chmod -R 750 wordpress</li>
</ul>
</li>
<li>Next we use a little gem of code I found on the net to change all the files ONLY to a new chmod value.
<ul>
<li>find . -type f -exec chmod 640{} \;</li>
<li>This finds all the files starting in the current directory and executes the chmod 640 on them.</li>
</ul>
</li>
<li>There you have it.  Now we have 750 protection on directories and 640 on files.  The next step would be to set permissions on individual files on a case by  case basis to support additional wordpress functionality.  Note, you should always turn the permissions back when you are done using the functionality.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.mjs1.com/2009/05/15/securing-your-wordpress-installation/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Changing file permissions</title>
		<link>http://www.mjs1.com/2009/05/15/changing-file-permissions/</link>
		<comments>http://www.mjs1.com/2009/05/15/changing-file-permissions/#comments</comments>
		<pubDate>Fri, 15 May 2009 15:18:31 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.mjs1.com/?p=65</guid>
		<description><![CDATA[Found this little nugget.  It will change all the files from the current directory and any files in its subdirectories to the chmod value while leaving the chmod value of the directories in tact.  Pretty sweet&#8230;
find . -type f -exec chmod 644 {} \;
]]></description>
			<content:encoded><![CDATA[<p>Found this little nugget.  It will change all the files from the current directory and any files in its subdirectories to the chmod value while leaving the chmod value of the directories in tact.  Pretty sweet&#8230;</p>
<p>find . -type f -exec chmod 644 {} \;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mjs1.com/2009/05/15/changing-file-permissions/feed/</wfw:commentRss>
		</item>
		<item>
		<title>chomod -linux change file permissions</title>
		<link>http://www.mjs1.com/2009/05/15/chomod-linux-change-file-permissions/</link>
		<comments>http://www.mjs1.com/2009/05/15/chomod-linux-change-file-permissions/#comments</comments>
		<pubDate>Fri, 15 May 2009 14:43:48 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.mjs1.com/?p=62</guid>
		<description><![CDATA[Changes the permission of a file.
Syntax
chmod [OPTION]&#8230; MODE[,MODE]&#8230; FILE&#8230;
chmod [OPTION]&#8230; OCTAL-MODE FILE&#8230;
chmod [OPTION]&#8230; &#8211;reference=RFILE FILE&#8230;



-c, &#8211;changes
like verbose but report only when a change is made


&#8211;no-preserve-root
do not treat `/&#8217; specially (the default)


&#8211;preserve-root
fail to operate recursively on `/&#8217;


-f, &#8211;silent, &#8211;quiet
suppress most error messages


-v, verbose
output a diagnostic for every file processed


&#8211;reference=RFILE
use RFILE&#8217;s mode instead of MODE values


-R, &#8211;recursive
change [...]]]></description>
			<content:encoded><![CDATA[<p>Changes the permission of a file.</p>
<p class="nb"><a name="02"></a>Syntax</p>
<p><em>chmod [OPTION]&#8230; MODE[,MODE]&#8230; FILE&#8230;<br />
chmod [OPTION]&#8230; OCTAL-MODE FILE&#8230;<br />
chmod [OPTION]&#8230; &#8211;reference=RFILE FILE&#8230;</em></p>
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tbody>
<tr>
<td width="120" valign="top">-c, &#8211;changes</td>
<td valign="top">like verbose but report only when a change is made</td>
</tr>
<tr>
<td width="120" valign="top">&#8211;no-preserve-root</td>
<td valign="top">do not treat `/&#8217; specially (the default)</td>
</tr>
<tr>
<td width="120" valign="top">&#8211;preserve-root</td>
<td valign="top">fail to operate recursively on `/&#8217;</td>
</tr>
<tr>
<td width="120" valign="top">-f, &#8211;silent, &#8211;quiet</td>
<td valign="top">suppress most error messages</td>
</tr>
<tr>
<td width="120" valign="top">-v, verbose</td>
<td valign="top">output a diagnostic for every file processed</td>
</tr>
<tr>
<td width="120" valign="top">&#8211;reference=RFILE</td>
<td valign="top">use RFILE&#8217;s mode instead of MODE values</td>
</tr>
<tr>
<td width="120" valign="top">-R, &#8211;recursive</td>
<td valign="top">change files and directories recursively</td>
</tr>
<tr>
<td width="120" valign="top">&#8211;help</td>
<td valign="top">display this help and exit</td>
</tr>
<tr>
<td width="120" valign="top">&#8211;version</td>
<td valign="top">output version information and exit</td>
</tr>
</tbody>
</table>
<p><span style="text-decoration: underline;">Permissions</span><br />
<em>u</em> - User who owns the file.<br />
<em>g</em> - Group that owns the file.<br />
<em>o</em> - Other.<br />
<em>a</em> - All.<br />
<em>r</em> - Read the file.<br />
<em>w</em> - Write or edit the file.<br />
<em>x</em> - Execute or run the file as a program.</p>
<p><span style="text-decoration: underline;">Numeric Permissions:<br />
</span>CHMOD can also to attributed by using Numeric Permissions:</p>
<p>400 read by owner<br />
040 read by group<br />
004 read by anybody (other)<br />
200 write by owner<br />
020 write by group<br />
002 write by anybody<br />
100 execute by owner<br />
010 execute by group<br />
001 execute by anybody</p>
<p class="nb"><a name="03"></a>Examples</p>
<p>The above numeric permissions can be added to set a certain permission, for example, a common HTML file on a Unix server to be only viewed over the Internet would be:</p>
<p class="tab">chmod 644 file.htm</p>
<p>This gives the file read/write by the owner and only read by everyone else (-rw-r&#8211;r&#8211;).</p>
<p>Files such as scripts that need to be executed need more permissions. Below is another example of a common permission given to scripts.</p>
<p class="tab">chmod 755 file.cgi</p>
<p>This would be the following 400+040+004+200+020+100+010+001 = 775 where you are giving all the rights but the capability for anyone to edit your file.cgi (-rwxr-xr-x).</p>
<p>Finally, another common CHMOD permission is 666, as shown below, which is read and write by everyone.</p>
<p class="tab">chmod 666 file.txt</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mjs1.com/2009/05/15/chomod-linux-change-file-permissions/feed/</wfw:commentRss>
		</item>
		<item>
		<title>chmod - Linux change permissions</title>
		<link>http://www.mjs1.com/2009/05/15/chmod-linux-change-permissions/</link>
		<comments>http://www.mjs1.com/2009/05/15/chmod-linux-change-permissions/#comments</comments>
		<pubDate>Fri, 15 May 2009 14:41:24 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.mjs1.com/?p=59</guid>
		<description><![CDATA[

The read, write and execute permissions apply slightly differently to directories than they do to files. The read permission on a directory controls the ability to list the contents of that directory. In this example we’ll create a directory and place a blank file in it. We’ll then modify the permissions on the directory so [...]]]></description>
			<content:encoded><![CDATA[<div id="main">
<div id="content">
<div class="post">
<div class="post-content">The read, write and execute permissions apply slightly differently to directories than they do to files. The <strong>read permission on a directory</strong> controls the ability to list the contents of that directory. In this example we’ll create a directory and place a blank file in it. We’ll then modify the permissions on the directory so the owner cannot see the contents.<code>$ <strong>mkdir secret_dir</strong><br />
$ <strong>touch secret_dir/my_secret.txt</strong><br />
$ <strong>ls secret_dir/</strong><br />
my_secret.txt<br />
$ <strong>chmod u-r secret_dir/</strong><br />
$ <strong>ls secret_dir/</strong><br />
ls: secret_dir/: Permission denied<br />
$ <strong>cd secret_dir/</strong><br />
$ <strong>ls</strong><br />
ls: .: Permission denied<br />
$ <strong>cd ../</strong></code></p>
<p>We see that we get a Permission denied error when trying to view the contents of the directory when the read permission has been revoked. Despite not being able to see what is in the directory we can still change our working directory to that directory.</p>
<p>The <strong>write permission on a directory</strong> behaves somewhat as expected. If a user has write on a directory they can create or remove files from that directory even if they are not the owner of the files. This is important to note as giving a user, group or other users write on a directory with other user’s files in it will allow them to delete other users files.</p>
<p>Now we’ll give read permissions back to the owner and revoke the execute permission:</p>
<p><code>$ <strong>chmod u+r secret_dir/</strong><br />
$ <strong>chmod u-x secret_dir/</strong><br />
$ <strong>ls secret_dir/</strong><br />
my_secret.txt<br />
$ <strong>cd secret_dir/</strong><br />
-bash: cd: secret_dir/: Permission denied</code></p>
<p>We can now view the contents of the directory again but look at what happened when we tried to cd into it! Not having the <strong>execute permission on a directory</strong> will prevent you from changing into that directory even though you can view the contents. It is understandable how this can cause some confusion.<br />
 </div>
</div>
</div>
</div>
<div id="main0">
<div id="content0">
<div class="post">
<div class="post-content">
<h2>Chmod and sticky bits</h2>
<p>There are a few special permission mode settings that are worthy of noting. <strong>Note</strong> that the Set UID and Set GID permissions are disabled in some operating systems for security reasons.<br />
 </p>
<table border="1">
<tbody>
<tr style="background: #d9d9d9;">
<td>Mode</td>
<td>Description</td>
</tr>
<tr>
<td>Sticky bit</td>
<td>Used for shared directories to prevent users from renaming or deleting each others’ files. The only users who can rename or delete files in directories with the sticky bit set are the file owner, the directory owner, or the super-user (root). The sticky bit is represented by the letter t in the last position of the other permissions display.</td>
</tr>
<tr>
<td>SUID</td>
<td>Set user ID, used on executable files to allow the executable to be run as the file owner of the executable rather than as the user logged into the system.<br />
SUID can also be used on a directory to change the ownership of files created in or moved to that directory to be owned by the directory owner rather than the user who created it.</td>
</tr>
<tr>
<td>SGID</td>
<td>Set group ID, used on executable files to allow the file to be run as if logged into the group (like SUID but uses file group permissions).<br />
SGID can also be used on a directory so that every file created in that directory will have the directory group owner rather than the group owner of the user creating the file.</td>
</tr>
</tbody>
</table>
<p>The following example displays the SUID permission mode that is set on the passwd command, indicated by the letter s in the last position of the user permission display. Users would like to be able to change their own passwords instead of having to ask the System Administrator to do it for them. Since changing a password involves updating the /etc/passwd file which is owned by root and protected from modification by any other user, the passwd command must be executed as the root user.</p>
<p>The which command will be used to find the full path name for the passwd command, then the attributes of the passwd command will be listed, showing the SUID permission(s).</p>
<p><code>$ <strong>which passwd</strong><br />
/usr/bin/passwd<br />
$ ls -l /usr/bin/passwd<br />
-r-s–x–x 1 root root 17700 Jun 25 2004 /usr/bin/passwd</code></p>
<p>Here we see not only that the SUID permissions are set up on the passwd command but also that the command is owned by the root user. These two factors tell us that the passwd command will run with the permissions of root regardless of who executes it.</p>
<p>These special modes can be very helpful on multi-user systems. To set or unset the sticky bit use the the t option with the chmod command. When setting the sticky bit we do not have to specify if it is for user, group or other. In the following example we will make a directory called public which anyone can write to but we’ll use the sticky bit to make sure only the file owners can remove their own files.</p>
<p><code>$ <strong>mkdir public</strong><br />
$ <strong>chmod 777 public</strong><br />
$ <strong>chmod +t public</strong><br />
$ <strong>ls -l</strong><br />
total 4<br />
drwxrwxrwt 2 tclark authors 4096 Sep 14 10:45 public</code></p>
<p>We see that the last character of the permissions string has a t indicating the sticky bit has been set. We could also prefix the number 1 to the chmod command using the number to achieve the same results. The following chmod command will accomplish the same thing as the two chmod commands in the last example:</p>
<p><code>$ <strong>chmod 1777 public</strong><br />
$ <strong>ls -l</strong><br />
total 4<br />
drwxrwxrwt 2 tclark authors 4096 Sep 14 10:45 public</code></p>
<p>Now let’s say we instead want to make a directory which other users can copy files but which we want the files to instantly become owned by our username and group. This is where the SUID and SGID options come in.</p>
<p><code>$ <strong>mkdir drop_box</strong><br />
$ <strong>chmod 777 drop_box</strong><br />
$ <strong>chmod u+s,g+s drop_box</strong><br />
$ <strong>ls -l</strong><br />
total 4<br />
drwsrwsrwx 2 tclark authors 4096 Sep 14 10:55 drop_box</code></p>
<p>Now anyone can move files to this directory but upon creation in drop_box they will become owned by tclark and the group authors. This example also illustrates how you can change multiple levels of permissions with a single command by separating them with a comma. Just like with the other permissions this could have been simplified into one command using the SUID and SGID numeric values (4 and 2 respectively.) Since we are changing both in this case we use 6 as the first value for the chmod command.</p>
<p><code>$ <strong>chmod 6777 drop_box/</strong><br />
$ <strong>ls -l</strong><br />
total 4<br />
drwsrwsrwx 2 oracle users 4096 Sep 14 10:55 drop_box</code></div>
</div>
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.mjs1.com/2009/05/15/chmod-linux-change-permissions/feed/</wfw:commentRss>
		</item>
		<item>
		<title>chown - Linux command line tool to change the owner/group of a file</title>
		<link>http://www.mjs1.com/2009/05/15/chown-linux-command-line-tool-to-change-the-ownergroup-of-a-file/</link>
		<comments>http://www.mjs1.com/2009/05/15/chown-linux-command-line-tool-to-change-the-ownergroup-of-a-file/#comments</comments>
		<pubDate>Fri, 15 May 2009 14:39:11 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.mjs1.com/?p=56</guid>
		<description><![CDATA[chown
Changes the owner or the group the file is associated with.
Usage
chown [options] owner file-list
chown [options] owner:group file-list 
chown [options] :group file-list 
Keep in mind that only root can change the owner of a file and only a user who belongs to the new group can change the group a file is associated with (also root [...]]]></description>
			<content:encoded><![CDATA[<p><!-- google_ad_section_start --></p>
<p><strong>chown</strong></p>
<p>Changes the owner or the group the file is associated with.</p>
<p><strong>Usage</strong></p>
<p><em>chown [options] owner file-list</em><br />
<em>chown [options] owner:group file-list </em><br />
<em>chown [options] :group file-list </em></p>
<p>Keep in mind that only <strong><em>root</em></strong> can change the owner of a file and only a user who belongs to the new group can change the group a file is associated with (also <strong><em>root</em></strong> can do this).</p>
<p>The <em>owner</em> is the user who will be the new owner of the file-list.<br />
The <em>file-list</em> are the files or file which is going to change its owner.</p>
<p><strong>Options</strong></p>
<dl>
<dt>-c </dt>
<dd>Displays a message for each fiel whose ownership or group is changed </dd>
<dt>&#8211;dereference </dt>
<dd>Changes the ownership/group of the files symbolic links point to, not the symbolic links themselves. The default is &#8211;no-dereference. </dd>
<dt>-f </dt>
<dd>Prevents chown from displaying error messages when it is unable to change the ownership/group of a file </dd>
<dt>-R </dt>
<dd>When you include directories in the <em>file-list</em> this options makes all the files in that directory to be affected by the command<strong>Examples</strong></p>
<p>chown jose:contabilidad /home/account/ -R</p>
<p>This is going to make all files inside /home/account/ and its subdirectories to belong to jose and to be associated with the group contabilidad.</p>
</dd>
</dl>
]]></content:encoded>
			<wfw:commentRss>http://www.mjs1.com/2009/05/15/chown-linux-command-line-tool-to-change-the-ownergroup-of-a-file/feed/</wfw:commentRss>
		</item>
		<item>
		<title>SendMail Configuration on Linux</title>
		<link>http://www.mjs1.com/2009/05/13/sendmail-configuration-on-linux/</link>
		<comments>http://www.mjs1.com/2009/05/13/sendmail-configuration-on-linux/#comments</comments>
		<pubDate>Wed, 13 May 2009 20:30:32 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Mail Server]]></category>

		<guid isPermaLink="false">http://www.mjs1.com/?p=40</guid>
		<description><![CDATA[http://www.linuxselfhelp.com/quick/sendmail.html
]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.linuxselfhelp.com/quick/sendmail.html">http://www.linuxselfhelp.com/quick/sendmail.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.mjs1.com/2009/05/13/sendmail-configuration-on-linux/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Configure Sendmail to use your ISP’s mail server</title>
		<link>http://www.mjs1.com/2009/05/13/configure-sendmail-to-use-your-isp%e2%80%99s-mail-server/</link>
		<comments>http://www.mjs1.com/2009/05/13/configure-sendmail-to-use-your-isp%e2%80%99s-mail-server/#comments</comments>
		<pubDate>Wed, 13 May 2009 20:20:23 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Mail Server]]></category>

		<category><![CDATA[stmp mail server sendmail linux bellsouth home dsl]]></category>

		<guid isPermaLink="false">http://www.mjs1.com/?p=36</guid>
		<description><![CDATA[On a local SMTP server I have for testing I need to use my isp’s mail server for sending emails.  My provider, bellsouth, blocks port 25 so all mail has to be routed through their server. Apparently, they use IP based ACL&#8217;s so authentication is not required.
After moving my previously working SMTP mail server from an work [...]]]></description>
			<content:encoded><![CDATA[<p>On a local SMTP server I have for testing I need to use my isp’s mail server for sending emails.  My provider, bellsouth, blocks port 25 so all mail has to be routed through their server. Apparently, they use IP based ACL&#8217;s so authentication is not required.</p>
<p>After moving my previously working SMTP mail server from an work location to my residence, I spend several days trying to figure out why my mail server no longer worked.  Even though test through sendmail in verbose mode told me the email was going through, the qmail command told me that the connection timed out.  Apparently, Bellsouth blocks port 25 and you must route email through their server.   I was able to finally get it work by defining a SmartHost directive in the sendmail.mc, recompiling the sendmail file and restarting the sendmail service.</p>
<p>All it took was opening</p>
<p><code>/etc/mail/sendmail.mc</code></p>
<p>adding/changing:</p>
<p><code>define(`SMART_HOST',`[mail.bellsouth.net]‘)</code></p>
<p>and then reseeting the sendmail config via:</p>
<p><code>make -C /etc/mail<br />
service sendmail restart</code></p>
<p>Now any mail sent from my machine (system status, php’s mail function, etc) will be routed through my isp’s mail server.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mjs1.com/2009/05/13/configure-sendmail-to-use-your-isp%e2%80%99s-mail-server/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>

