<?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>Envision Systems</title>
	<atom:link href="http://www.envision-systems.com.au/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.envision-systems.com.au/blog</link>
	<description>Envision Systems Blog</description>
	<lastBuildDate>Mon, 16 Apr 2012 01:14:44 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Manipulating configuration files using sed</title>
		<link>http://www.envision-systems.com.au/blog/2012/04/16/manipulating-configuration-files-using-sed/</link>
		<comments>http://www.envision-systems.com.au/blog/2012/04/16/manipulating-configuration-files-using-sed/#comments</comments>
		<pubDate>Mon, 16 Apr 2012 01:14:44 +0000</pubDate>
		<dc:creator>William Jamieson</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Performance Tuning]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[bash script]]></category>
		<category><![CDATA[block]]></category>
		<category><![CDATA[change]]></category>
		<category><![CDATA[cli]]></category>
		<category><![CDATA[edit]]></category>
		<category><![CDATA[ganglia]]></category>
		<category><![CDATA[manipulate]]></category>
		<category><![CDATA[manipulating]]></category>
		<category><![CDATA[multiple line]]></category>
		<category><![CDATA[replace]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[section]]></category>
		<category><![CDATA[sed]]></category>
		<category><![CDATA[single line]]></category>

		<guid isPermaLink="false">http://www.envision-systems.com.au/blog/?p=233</guid>
		<description><![CDATA[Here at Envision Systems we have a standardised Linux operating environment for all our servers. We run a large bash script over our servers that installs what we need and fine tunes the server perfectly for our needs. As part &#8230; <a href="http://www.envision-systems.com.au/blog/2012/04/16/manipulating-configuration-files-using-sed/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Here at Envision Systems we have a standardised Linux operating environment for all our servers.  We run a large bash script over our servers that installs what we need and fine tunes the server perfectly for our needs.  As part of this script we do a lot of configuration file manipulation.  </p>
<p>Today we&#8217;re going to use the example of maniplulating the configuration files for <a target="_blank"href="http://ganglia.sourceforge.net/">Ganglia</a> using cli commands that you can include in a bash script.</p>
<h2>Changing a single line entry</h2>
<p>In this example, we just need to find a single line in the configuration file and replace it:</p>
<p><strong>From:</strong>&nbsp;&nbsp;data_source &#8220;my cluster&#8221; localhost</p>
<p><strong>To:</strong>&nbsp;&nbsp;data_source &#8220;Envision Cluster&#8221; 60 localhost</p>
<ol>
<li>
        <strong>Backup the configuration file first:</strong></p>
<pre class="brush: bash; light: true; title: ; notranslate">
        cp /etc/ganglia/gmetad.conf /etc/ganglia/gmetad.conf.orig
        </pre>
<p>
    </li>
<li>
        <strong>Perform the sed replace</strong></p>
<pre class="brush: bash; light: true; title: ; notranslate">
        sed -e &quot;s/^data_source \&quot;my cluster\&quot; localhost/data_source \&quot;Envision Cluster\&quot; 60 localhost/g&quot; /etc/ganglia/gmetad.conf &gt; /etc/ganglia/gmetad.conf.postreplace
        </pre>
<p>        <strong>sed -e</strong>: tell sed to execute the command string<br />
        <strong>s/</strong>: means search<br />
        <strong>^</strong>: means that the search string must be found at the very start of the line<br />
        <strong>/g</strong>: means replace every occurrence of the found string<br />
        <strong>/etc/ganglia/gmetad.conf > /etc/ganglia/gmetad.conf.postreplace</strong>: look for the search string in /etc/ganglia/gmetad.conf but save the replaced version to /etc/ganglia/gmetad.conf.postreplace.  We do this because sed struggles to find and replace in the same file.
    </li>
<li>
        <strong>Replace the original file with the modified one</strong></p>
<pre class="brush: bash; light: true; title: ; notranslate">
        if [ -e /etc/ganglia/gmetad.conf ]; then
        	rm -f /etc/ganglia/gmetad.conf
        fi
        mv -f /etc/ganglia/gmetad.conf.postreplace /etc/ganglia/gmetad.conf.cnf
        </pre>
</li>
</ol>
<h2>Replacing content between two defined strings</h2>
<p>In this example, a single line find and replace is not practical for 2 reasons.  Firstly, its too much work to replace each line individually.  Secondly, there are multiple lines in the configuration file containing &#8216;name = &#8220;unspecified&#8221;&#8216; and whilst we could use sed to replace the first occurrence of the search string, it&#8217;s less reliable over time.  So we&#8217;re going to tell sed to search for the string &#8216;cluster {&#8216; and delete it and everything after it until it hits the string &#8216;}&#8217;.  Once we&#8217;ve deleted this configuration block, we can just add a new one at the bottom of the file easily.</p>
<p><strong>From:</strong><br />
cluster {<br />
&nbsp;&nbsp;&nbsp;&nbsp;name = &#8220;unspecified&#8221;<br />
&nbsp;&nbsp;&nbsp;&nbsp;owner = &#8220;unspecified&#8221;<br />
&nbsp;&nbsp;&nbsp;&nbsp;latlong = &#8220;unspecified&#8221;<br />
&nbsp;&nbsp;&nbsp;&nbsp;url = &#8220;unspecified&#8221;<br />
}</p>
<p><strong>To:</strong><br />
cluster {<br />
&nbsp;&nbsp;&nbsp;&nbsp;name = &#8220;Envision Cluster&#8221;<br />
&nbsp;&nbsp;&nbsp;&nbsp;owner = &#8220;Envision Systems&#8221;<br />
&nbsp;&nbsp;&nbsp;&nbsp;latlong = &#8220;unspecified&#8221;<br />
&nbsp;&nbsp;&nbsp;&nbsp;url = &#8220;http://www.envision-systems.com.au&#8221;<br />
}</p>
<ol>
<li>
        <strong>Backup the configuration file first:</strong></p>
<pre class="brush: bash; light: true; title: ; notranslate">
        cp /etc/ganglia/gmond.conf /etc/ganglia/gmond.conf.orig
        </pre>
<p>
    </li>
<li>
        <strong>Use sed to delete the old configuration block</strong></p>
<pre class="brush: bash; light: true; title: ; notranslate">
        sed '/cluster {/,/}/d' /etc/ganglia/gmond.conf &gt; /etc/ganglia/gmond.conf.postreplace
        </pre>
<p>        <strong>/d</strong>: tells sed to delete<br />
        <strong>/etc/ganglia/gmond.conf > /etc/ganglia/gmond.conf.postreplace</strong>: look for the search string in /etc/ganglia/gmond.conf but save the replaced version to /etc/ganglia/gmond.conf.postreplace.  We do this because sed struggles to find and replace in the same file.
    </li>
<li>
        <strong>Add the new configuration block</strong></p>
<pre class="brush: bash; light: true; title: ; notranslate">
        echo &quot;&quot; &gt;&gt; /etc/ganglia/gmond.conf
        echo &quot;/* CUSTOM CONFIGURATION SECTION */&quot; &gt;&gt; /etc/ganglia/gmond.conf
        echo &quot;cluster {&quot; &gt;&gt; /etc/ganglia/gmond.conf
        echo &quot;  name = \&quot;Envision Cluster\&quot;&quot; &gt;&gt; /etc/ganglia/gmond.conf
        echo &quot;  owner = \&quot;Envision Systems\&quot;&quot; &gt;&gt; /etc/ganglia/gmond.conf
        echo &quot;  latlong = \&quot;unspecified\&quot;&quot; &gt;&gt; /etc/ganglia/gmond.conf
        echo &quot;  url = \&quot;http://www.envision-systems.com.au/\&quot;&quot; &gt;&gt; /etc/ganglia/gmond.conf
        echo &quot;}&quot; &gt;&gt; /etc/ganglia/gmond.conf
        echo &quot;&quot; &gt;&gt; /etc/ganglia/gmond.conf
        </pre>
</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.envision-systems.com.au/blog/2012/04/16/manipulating-configuration-files-using-sed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting up Linux user accounts for sftp without shell access</title>
		<link>http://www.envision-systems.com.au/blog/2012/04/12/setting-up-linux-user-accounts-for-sftp-without-shell-access/</link>
		<comments>http://www.envision-systems.com.au/blog/2012/04/12/setting-up-linux-user-accounts-for-sftp-without-shell-access/#comments</comments>
		<pubDate>Thu, 12 Apr 2012 06:22:19 +0000</pubDate>
		<dc:creator>William Jamieson</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://www.envision-systems.com.au/blog/?p=228</guid>
		<description><![CDATA[Often I need to allow people to send me files over a secure traffic connection (SFTP) but not allow them shell access to my server. Here&#8217;s how I do it: Create a new linux user account for your sftp user &#8230; <a href="http://www.envision-systems.com.au/blog/2012/04/12/setting-up-linux-user-accounts-for-sftp-without-shell-access/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Often I need to allow people to send me files over a secure traffic connection (SFTP) but not allow them shell access to my server.  Here&#8217;s how I do it:</p>
<ol>
<li>
        <strong>Create a new linux user account for your sftp user</strong></p>
<pre class="brush: bash; light: true; title: ; notranslate">
        #useradd sftpuser
        </pre>
<p>
    </li>
<li>
        <strong>Set the password for your new sftp account</strong></p>
<pre class="brush: bash; light: true; title: ; notranslate">
        #passwd sftp
        </pre>
<p>
    </li>
<li>
        <strong>Change the login shell</strong><br />
        Edit /etc/passwd and change the sftp user&#8217;s login shell to /usr/libexec/openssh/sftp-server</p>
<pre class="brush: bash; light: true; title: ; notranslate">
        sftpuser:x:1234:3234:SFTP User:/home/sftpuser:/usr/libexec/openssh/sftp-server
        </pre>
<p>
    </li>
<li>
        <strong>Test</strong><br />
        Confirm that you can SFTP files to and from the sftp user&#8217;s home directory (/home/sftpuser/) but not ssh or sftp to the server using the sftp user account
    </li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.envision-systems.com.au/blog/2012/04/12/setting-up-linux-user-accounts-for-sftp-without-shell-access/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Extending VMWare ESX 4.1 root logical volume disk size on Scientific Linux / CentOS /RedHat 6 guest operating system</title>
		<link>http://www.envision-systems.com.au/blog/2012/03/11/extending-vmware-esx-4-1-root-logical-volume-disk-size-on-scientific-linux-centos-redhat-6-guest-operating-system/</link>
		<comments>http://www.envision-systems.com.au/blog/2012/03/11/extending-vmware-esx-4-1-root-logical-volume-disk-size-on-scientific-linux-centos-redhat-6-guest-operating-system/#comments</comments>
		<pubDate>Sun, 11 Mar 2012 06:03:35 +0000</pubDate>
		<dc:creator>William Jamieson</dc:creator>
				<category><![CDATA[File Systems]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[df]]></category>
		<category><![CDATA[ESX]]></category>
		<category><![CDATA[extend]]></category>
		<category><![CDATA[fdisk]]></category>
		<category><![CDATA[logical volume]]></category>
		<category><![CDATA[lvextend]]></category>
		<category><![CDATA[Partition]]></category>
		<category><![CDATA[pvcreate]]></category>
		<category><![CDATA[RedHat]]></category>
		<category><![CDATA[resize2fs]]></category>
		<category><![CDATA[root]]></category>
		<category><![CDATA[root partition]]></category>
		<category><![CDATA[Scientific Linux]]></category>
		<category><![CDATA[vgdisplay]]></category>
		<category><![CDATA[vgextend]]></category>
		<category><![CDATA[VMWare]]></category>
		<category><![CDATA[Volume Group]]></category>

		<guid isPermaLink="false">http://www.envision-systems.com.au/blog/?p=204</guid>
		<description><![CDATA[I use VMWare fusion for development and my infrastructure partner uses VMWare ESX 4.1 to host one of my virtualised servers running Scientific Linux 6.x. Recently I needed some extra storage and so we tried to increase the root partition &#8230; <a href="http://www.envision-systems.com.au/blog/2012/03/11/extending-vmware-esx-4-1-root-logical-volume-disk-size-on-scientific-linux-centos-redhat-6-guest-operating-system/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I use VMWare fusion for development and my infrastructure partner uses VMWare ESX 4.1 to host one of my virtualised servers running Scientific Linux 6.x.  Recently I needed some extra storage and so we tried to increase the root partition size from 50GB to 100GB.  </p>
<p>This tutorial will step you through how to do it:</p>
<ol>
<li><strong>Log into your guest operating system as root</strong>
<p></li>
<li>
        <strong>Install VMWare tools</strong><br />
        <a target="_blank" href="http://www.envision-systems.com.au/blog/2012/03/11/installing-vmware-tools-for-vmware-esx-4-1-on-a-scientific-linux-centos-redhat-6-x-guest-operating-system-using-yum/">See my instructions here</a></p>
</li>
<li>
        <strong>Ask your ESX Infrastructure provider to increase your virtual disk size</strong></p>
</li>
<li>
        <strong>List devices and identify device number (part of /dev/sda by default)</strong></p>
<pre class="brush: bash; light: true; title: ; notranslate">
        fdisk -l
        </pre>
<p>
    </li>
<li>
        <strong>Create the new primary partition</strong></p>
<ul>
<li>
                        Run fdisk (the default device is usually /dev/sda)</p>
<pre class="brush: bash; light: true; title: ; notranslate">
                        fdisk /dev/sda
                        </pre>
<p>
                </li>
<li>
                        Press <strong>p</strong> to print the partition table and identify the number of partitions (there are 2 by default)</p>
</li>
<li>
                        Press <strong>n</strong> to create a new primary partition</p>
</li>
<li>
                        Press <strong>p</strong> for primary</p>
</li>
<li>
                        Press <strong>Enter</strong> twice</p>
</li>
<li>
                        Press <strong>w</strong> to write the changes to the partition table</p>
</li>
</ul>
</li>
<li>
        <strong>Restart the guest operating system</strong></p>
<pre class="brush: bash; light: true; title: ; notranslate">
        reboot
        </pre>
<p>
    </li>
<li>
        <strong>Verify that the new partition was created:</strong></p>
<pre class="brush: bash; light: true; title: ; notranslate">
        fdisk -l
        </pre>
</li>
<li>
        <strong>Convert the new partition to a physical volume:</strong></p>
<pre class="brush: bash; light: true; title: ; notranslate">
        pvcreate /dev/sda3
        </pre>
<p>        where /dev/sda3 is your new partition
    </li>
<li>
        <strong>Extend physical volume:</strong></p>
<pre class="brush: bash; light: true; title: ; notranslate">
        vgextend  VolGroup /dev/sda3
        </pre>
<p>        where /dev/sda3 is your new partition
    </li>
<li>
        <strong>Verify that there is new space available:</strong></p>
<pre class="brush: bash; light: true; title: ; notranslate">
        vgdisplay VolGroup | grep &quot;Free&quot;
        </pre>
<p>
    </li>
<li>
        <strong>Extend the logical volume to take up 100% of the free space:</strong><br />
        In this case we&#8217;re extending the root logical volume</p>
<pre class="brush: bash; light: true; title: ; notranslate">
        lvextend -l +100%FREE /dev/mapper/VolGroup-lv_root
        </pre>
<p>
    </li>
<li>
        <strong>Expand the ext3 filesystem online:</strong><br />
        In this case we&#8217;re extending the root logical volume</p>
<pre class="brush: bash; light: true; title: ; notranslate">
        resize2fs /dev/mapper/VolGroup-lv_root
        </pre>
<p>
    </li>
<li>
        <strong>Verify that your disk space has increased:</strong></p>
<pre class="brush: bash; light: true; title: ; notranslate">
        df -h
        </pre>
<p>
    </li>
</ol>
<p>Based on VMWare instructions <a href="http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&#038;cmd=displayKC&#038;externalId=1006371" target="_blank">found here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.envision-systems.com.au/blog/2012/03/11/extending-vmware-esx-4-1-root-logical-volume-disk-size-on-scientific-linux-centos-redhat-6-guest-operating-system/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>yum update</title>
		<link>http://www.envision-systems.com.au/blog/2012/03/11/installing-vmware-tools-for-vmware-esx-4-1-on-a-scientific-linux-centos-redhat-6-x-guest-operating-system-using-yum/</link>
		<comments>http://www.envision-systems.com.au/blog/2012/03/11/installing-vmware-tools-for-vmware-esx-4-1-on-a-scientific-linux-centos-redhat-6-x-guest-operating-system-using-yum/#comments</comments>
		<pubDate>Sun, 11 Mar 2012 05:33:19 +0000</pubDate>
		<dc:creator>William Jamieson</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[VMWare]]></category>
		<category><![CDATA[4.1]]></category>
		<category><![CDATA[6.x]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[ESX]]></category>
		<category><![CDATA[install]]></category>
		<category><![CDATA[RedHat]]></category>
		<category><![CDATA[Repository]]></category>
		<category><![CDATA[Scientific Linux]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[VMWare Tools]]></category>
		<category><![CDATA[yum]]></category>

		<guid isPermaLink="false">http://www.envision-systems.com.au/blog/?p=205</guid>
		<description><![CDATA[I run my SL servers very lean and was having trouble compiling VMWare Tools due to missing dependencies, so I was hoping to find a good solution using yum. Here&#8217;s how to do it if your hosting provider is using &#8230; <a href="http://www.envision-systems.com.au/blog/2012/03/11/installing-vmware-tools-for-vmware-esx-4-1-on-a-scientific-linux-centos-redhat-6-x-guest-operating-system-using-yum/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I run my SL servers very lean and was having trouble compiling VMWare Tools due to missing dependencies, so I was hoping to find a good solution using yum.</p>
<p>Here&#8217;s how to do it if your hosting provider is using ESX v4.1 and you are using a RedHat v6 variant:</p>
<ol>
<li>
        <strong>Log into the guest operating system as root.</strong></p>
</li>
<li>
        <strong>Add VMware GPG keys</strong></p>
<pre class="brush: bash; light: true; title: ; notranslate">
            rpm --import http://packages.vmware.com/tools/keys/VMWARE-PACKAGING-GPG-DSA-KEY.pub
            rpm --import http://packages.vmware.com/tools/keys/VMWARE-PACKAGING-GPG-RSA-KEY.pub
        </pre>
<p>
    </li>
<li>
        <strong>Add the VMWare yum Repository</strong></p>
<pre class="brush: bash; light: true; title: ; notranslate">
        echo -e &quot;[vmware-tools]&quot; &gt; /etc/yum.repos.d/vmware-tools.repo
        echo -e &quot;name=VMware Tools&quot; &gt;&gt; /etc/yum.repos.d/vmware-tools.repo
        echo -e &quot;baseurl=http://packages.vmware.com/tools/esx/4.1/rhel6/x86_64&quot; &gt;&gt; /etc/yum.repos.d/vmware-tools.repo
        echo -e &quot;enabled=1&quot; &gt;&gt; /etc/yum.repos.d/vmware-tools.repo
        echo -e &quot;gpgcheck=1&quot; &gt;&gt; /etc/yum.repos.d/vmware-tools.repo
        </pre>
<p>
    </li>
<li>
        <strong>Clean your yum cache</strong></p>
<pre class="brush: bash; light: true; title: ; notranslate">
        yum clean all
        </pre>
<p>
    </li>
<li>
        <strong> Install VMTools:</strong></p>
<pre class="brush: bash; light: true; title: ; notranslate">
        yum install vmware-open-vm-tools-nox vmware-tools-nox vmware-open-vm-tools vmware-tools
        </pre>
<p>
    </li>
</ol>
<p>For other versions of VMWare ESX look at <a href="http://packages.vmware.com/tools/esx/index.html" target="_blank">Other VMWare ESX YUM Repositories</a>, then select the most appropriate guest operating system.  Then replace the <em>baseurl</em> setting in your /etc/yum.repos.d/vmware-tools.repo file to match your new chosen repository.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.envision-systems.com.au/blog/2012/03/11/installing-vmware-tools-for-vmware-esx-4-1-on-a-scientific-linux-centos-redhat-6-x-guest-operating-system-using-yum/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mounting remote directories to Scientific Linux / CentOS /RedHat 6 via SSH using Fuse</title>
		<link>http://www.envision-systems.com.au/blog/2011/09/01/mounting-remote-directories-to-scientific-linux-centos-redhat-6-via-ssh-using-fuse/</link>
		<comments>http://www.envision-systems.com.au/blog/2011/09/01/mounting-remote-directories-to-scientific-linux-centos-redhat-6-via-ssh-using-fuse/#comments</comments>
		<pubDate>Thu, 01 Sep 2011 04:26:58 +0000</pubDate>
		<dc:creator>William Jamieson</dc:creator>
				<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://www.envision-systems.com.au/blog/?p=182</guid>
		<description><![CDATA[Often I need to mount a directory from a remote machine onto my Linux server so that I can dump backups or perform other tasks. You can certainly use samba to mount windows shares but for Mac and Linux shares &#8230; <a href="http://www.envision-systems.com.au/blog/2011/09/01/mounting-remote-directories-to-scientific-linux-centos-redhat-6-via-ssh-using-fuse/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Often I need to mount a directory from a remote machine onto my Linux server so that I can dump backups or perform other tasks.  You can certainly use samba to mount windows shares but for Mac and Linux shares SSHFS shares are more consistently supported, especially since Apple&#8217;s change&#8217;s to Samba in Mac OS X 10.7 Lion.</p>
<p>This tutorial will step you through how to mount a remote directory onto your Scientific Linux / CentOS /RedHat 6 machine.</p>
<h2>For a mount on demand solution</h2>
<ol>
<li><strong>Login to your linux server as root</strong>
<p></li>
<li>
        <strong>Install fuse-sshfs</strong></p>
<pre class="brush: bash; light: true; title: ; notranslate">
        #yum install fuse-sshfs
        </pre>
</li>
<li>
        <strong>Create a mount directory</strong></p>
<pre class="brush: bash; light: true; title: ; notranslate">
        #mkdir /mnt/sshfsMount
        </pre>
</li>
<li>
        <strong>Mount the remote directory</strong></p>
<pre class="brush: bash; light: true; title: ; notranslate">
        #sshfs user@192.168.1.1:/mySharePath /mnt/sshfsMount/
        </pre>
<p>        SSHFS will then ask you to authenticate with the password for the user account you supplied
    </li>
<li>
        <strong>To unmount the drive:</strong></p>
<pre class="brush: bash; light: true; title: ; notranslate">
        #umount /sshfs/sshfsMount/
        </pre>
</li>
</ol>
<h2>To automate the process so that the server automatically mounts</h2>
<ol>
<li>
               <strong> Setup SSH keys so that the linux machine can automatically login to the remote machine via SSH</strong><br />
               To set this up you can see our tutorial on <a href="http://www.envision-systems.com.au/blog/setting-up-automatic-ssh-login-without-password-on-centos/">setting up automatic SSH logins without using a password</a></p>
</li>
<li>
               <strong> Setup SSH keys so that the linux machine can automatically login to the remote machine via SSH</strong><br />
               To set this up you can see our tutorial on <a href="http://www.envision-systems.com.au/blog/setting-up-automatic-ssh-login-without-password-on-centos/">setting up automatic SSH logins without using a password</a></p>
<p>                Now you should be able to use the following command without being asked for a password</p>
<pre class="brush: bash; light: true; title: ; notranslate">
                #sshfs user@192.168.1.1:/mySharePath /mnt/sshfsMount/
                </pre>
</li>
<li>
               <strong>Install autofs</strong></p>
<pre class="brush: bash; light: true; title: ; notranslate">
                #yum install autofs
                </pre>
</li>
<li>
               <strong>Get the user and group id of the user you wish to control the share.</strong><br />
                In this example I&#8217;m going to use the root account<br />
               </p>
<pre class="brush: bash; light: true; title: ; notranslate">
                #cat /etc/passwd | grep root
                root:x:0:0:root:/root:/bin/bash
                </pre>
<p>                The user id is the first number, and the coup id is the second number (0 and 0)
            </li>
<li>
               <strong>Edit the /etc/auto.master file and add the following line under the line for /misc, substituting your chosen user and group id&#8217;s</strong><br />
               This allows us to mount to any single directory of our choosing under root ( / ) as the local mounting point without having to use sub directories.</p>
<pre class="brush: bash; light: true; title: ; notranslate">
                /-              /etc/auto.sshfs  uid=0,gid=0,--timeout=30,--ghost
                </pre>
<p>                Also comment out the following line by placing a # in front of it to avoid nsswitch errors</p>
<pre class="brush: bash; light: true; title: ; notranslate">
                +auto.master
                </pre>
</li>
<li>
               <strong>Now create the file /etc/auto.sshfs and add the following line to it</strong></p>
<pre class="brush: bash; light: true; title: ; notranslate">
                /mnt/sshfsMount/ -fstype=fuse,rw,nodev,nonempty,noatime,allow_other,max_read=65536  :sshfs\#user@192.168.1.1\:/mySharePath
                </pre>
<p>                Now this remote directory will mount into the folder /mnt/sshfsMount every time we access that folder. If the folder is not being used for more than 30 seconds, it will automatically be unmounted.
            </li>
<li>
                <strong>Restart autos:</strong></p>
<pre class="brush: bash; light: true; title: ; notranslate">
                #service autofs restart
                </pre>
</li>
<li>
                <strong>test that the directory is mounted by listing its contents:</strong></p>
<pre class="brush: bash; light: true; title: ; notranslate">
                #ls /mnt/sshfsMount
                </pre>
</li>
<li>
                <strong>To unmount the drive:</strong></p>
<pre class="brush: bash; light: true; title: ; notranslate">
                #umount /mnt/sshfsMount/
                </pre>
</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.envision-systems.com.au/blog/2011/09/01/mounting-remote-directories-to-scientific-linux-centos-redhat-6-via-ssh-using-fuse/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Installing VMWare Tools on a terminal only Scientific Linux / CentOS /RedHat 6 Machine</title>
		<link>http://www.envision-systems.com.au/blog/2011/09/01/installing-vmware-tools-on-a-terminal-only-scientific-linux-centos-redhat-6-machine/</link>
		<comments>http://www.envision-systems.com.au/blog/2011/09/01/installing-vmware-tools-on-a-terminal-only-scientific-linux-centos-redhat-6-machine/#comments</comments>
		<pubDate>Thu, 01 Sep 2011 04:12:16 +0000</pubDate>
		<dc:creator>William Jamieson</dc:creator>
				<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://www.envision-systems.com.au/blog/?p=171</guid>
		<description><![CDATA[VMWare Tools can greatly improve the speed, efficiency and manageability of your virtual environment as well as provide a number of other key benefits. This tutorial will step you through how to install VMWare tools on a Scientific Linux / &#8230; <a href="http://www.envision-systems.com.au/blog/2011/09/01/installing-vmware-tools-on-a-terminal-only-scientific-linux-centos-redhat-6-machine/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>VMWare Tools can greatly improve the speed, efficiency and manageability of your virtual environment as well as provide a number of <a href="http://reformedmusings.wordpress.com/2008/08/15/what-does-vmware-tools-do/">other key benefits</a>.</p>
<p>This tutorial will step you through how to install VMWare tools on a Scientific Linux / CentOS /RedHat 6 virtual machine with no GUI.</p>
<ol>
<li><strong>Start your virtual machine instance and log in as root using the actual VMWare window rather than a remote terminal session.</strong>
<p></li>
<li>
        <strong>Go to the /tmp directory</strong></p>
<pre class="brush: bash; light: true; title: ; notranslate">
        #cd /tmp
        </pre>
</li>
<li>
        <strong>On the parent host system, select the menu option: Virtual Machine > Install VMWare Tools</strong></p>
<p>        VMWare will then download the latest version of VMWare Tools and ask you to authenticate using a valid admin account on the parent host system.<br />
        A dialog box will appear asking you to confirm the installation, click &#8216;Install&#8217;.</p>
</li>
<li>
        <strong>Mount the virtual CD-ROM and copy the files to /tmp</strong></p>
<pre class="brush: bash; light: true; title: ; notranslate">
        #mount -o ro /dev/cdrom /mnt
        #cp /mnt/* .
        </pre>
</li>
<li>
        <strong>Extract the files from the archive</strong></p>
<pre class="brush: bash; light: true; title: ; notranslate">
        #tar xvfz VMwareTools*
        #cd vmware-tools-distrib
        </pre>
</li>
<li>
        <strong>Run the installation script</strong></p>
<pre class="brush: bash; light: true; title: ; notranslate">
        #perl vmware-install.pl
        </pre>
<p>        Press Enter at all of the prompts to accept the script default settings
    </li>
<li>
        <strong>Reboot the virtual machine</strong></p>
<pre class="brush: bash; light: true; title: ; notranslate">
        #reboot
        </pre>
<p>        Then re-login as root when it comes back up
    </li>
<li>
        <strong>Check that the installation was successful</strong></p>
<pre class="brush: bash; light: true; title: ; notranslate">
        #vmware-checkvm
        VMware software version 6 (good)
        </pre>
</li>
</ol>
<p><strong>You will need to reinstall VMWare tools each time you upgrade/change the kernel on the virtual machine</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.envision-systems.com.au/blog/2011/09/01/installing-vmware-tools-on-a-terminal-only-scientific-linux-centos-redhat-6-machine/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to upgrade Scientific Linux / CentOS /RedHat From 6.0 to 6.1</title>
		<link>http://www.envision-systems.com.au/blog/2011/08/31/how-to-upgrade-scientific-linux-centos-redhat-from-6-0-to-6-1/</link>
		<comments>http://www.envision-systems.com.au/blog/2011/08/31/how-to-upgrade-scientific-linux-centos-redhat-from-6-0-to-6-1/#comments</comments>
		<pubDate>Wed, 31 Aug 2011 06:44:52 +0000</pubDate>
		<dc:creator>William Jamieson</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[RedHat]]></category>
		<category><![CDATA[Scientific Linux]]></category>
		<category><![CDATA[SL]]></category>
		<category><![CDATA[Upgrade]]></category>
		<category><![CDATA[version]]></category>
		<category><![CDATA[yum]]></category>

		<guid isPermaLink="false">http://www.envision-systems.com.au/blog/?p=151</guid>
		<description><![CDATA[Problem Simply running the following command won&#8217;t upgrade your system from 6.0 to 6.1 as it will only draw updated packages from the repository associated with it&#8217;s current release (6.0): Solution First let&#8217;s check the version we are currently using: &#8230; <a href="http://www.envision-systems.com.au/blog/2011/08/31/how-to-upgrade-scientific-linux-centos-redhat-from-6-0-to-6-1/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<h2>Problem</h2>
<p>
Simply running the following command won&#8217;t upgrade your system from 6.0 to 6.1 as it will only draw updated packages from the repository associated with it&#8217;s current release (6.0):</p>
<pre class="brush: bash; light: true; title: ; notranslate">
#yum update
</pre>
<hr />
<h2>Solution</h2>
<p>
First let&#8217;s check the version we are currently using:</p>
<pre class="brush: bash; light: true; title: ; notranslate">
#cat /etc/redhat-release
Scientific Linux release 6.0 (Carbon)
</pre>
<p>All we need to do is tell yum the version number you&#8217;d like to source updates from as follows:</p>
<pre class="brush: bash; light: true; title: ; notranslate">
#yum --releasever=6.1 update
</pre>
<p>Now lets check that the update worked:</p>
<pre class="brush: bash; light: true; title: ; notranslate">
#cat /etc/redhat-release
Scientific Linux release 6.1 (Carbon)
</pre>
<p>Simple as that!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.envision-systems.com.au/blog/2011/08/31/how-to-upgrade-scientific-linux-centos-redhat-from-6-0-to-6-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting up a self-signed SSL certificate using ModSSL, Apache 2 and Scientific / CentOS / RedHat</title>
		<link>http://www.envision-systems.com.au/blog/2011/07/25/setting-up-a-self-signed-ssl-certificate-using-modssl-apache-2-and-scientific-centos-redhat/</link>
		<comments>http://www.envision-systems.com.au/blog/2011/07/25/setting-up-a-self-signed-ssl-certificate-using-modssl-apache-2-and-scientific-centos-redhat/#comments</comments>
		<pubDate>Mon, 25 Jul 2011 01:44:11 +0000</pubDate>
		<dc:creator>William Jamieson</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[443]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[Certificate]]></category>
		<category><![CDATA[Encryption]]></category>
		<category><![CDATA[ModSSL]]></category>
		<category><![CDATA[mod_ssl]]></category>
		<category><![CDATA[OpenSSL]]></category>
		<category><![CDATA[Port 443]]></category>
		<category><![CDATA[RedHat]]></category>
		<category><![CDATA[Scientific Linux]]></category>
		<category><![CDATA[Secure connection]]></category>
		<category><![CDATA[Secure Socket Layer]]></category>
		<category><![CDATA[Self-signed]]></category>
		<category><![CDATA[SSL]]></category>
		<category><![CDATA[wget]]></category>

		<guid isPermaLink="false">http://www.envision-systems.com.au/blog/?p=138</guid>
		<description><![CDATA[Self-signed certificates are very handy for helping two known machines talk to each other in a secure (encrypted) manner over https. Self signed certificates are simply certificates that you vouch for (or trust) yourself, without having to be externally verified &#8230; <a href="http://www.envision-systems.com.au/blog/2011/07/25/setting-up-a-self-signed-ssl-certificate-using-modssl-apache-2-and-scientific-centos-redhat/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Self-signed certificates are very handy for helping two known machines talk to each other in a secure (encrypted) manner over https.  Self signed certificates are simply certificates that you vouch for (or trust) yourself, without having to be externally verified by a third party such as Thawte or Verisign.</p>
<p>Here&#8217;s how to set it up using ModSSL, Apache 2, and Scientific, CentOS, or RedHat Linux&#8230;</p>
<p></p>
<h2>Configure the Server</h2>
<hr />
<ol>
<li><strong>Install mod_ssl if you haven&#8217;t already:</strong>
<pre class="brush: bash; light: true; title: ; notranslate">
yum install mod_ssl openssl openssl-devel
</pre>
</li>
<li><strong>To generate a self signed certificate, login to the server as root and generate the private key, replacing www.mysite.com with the domain you require:</strong>
<pre class="brush: bash; light: true; title: ; notranslate">
cd ~/
openssl genrsa -out www.mysite.com.key 1024
</pre>
</li>
<li><strong>Now generate the certificate signing request (CSR) and answer the questions is asks you as guided:</strong>
<pre class="brush: bash; light: true; title: ; notranslate">
openssl req -new -key www.mysite.com.key -out www.mysite.com.csr

---------------------------------------------------------------------------------------
Country Name (2 letter code) [GB]: &lt;Your 2 Character Country Code&gt;
State or Province Name (full name) [Berkshire]: &lt;Your State&gt;
Locality Name (eg, city) [Newbury]: &lt;Your City&gt;
Organization Name (eg, company) [My Company Ltd]: &lt;Your Company Name&gt;
Organizational Unit Name (eg, section) []: &lt;Leave Empty Unless Required&gt;
Common Name (eg, your name or your server's hostname) []:&lt;Your Full Domain Name To Use With SSL&gt;
Email Address []:&lt;Generic Organisation Email Address.  eg. info@mysite.com&gt;

Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []: &lt;Leave Empty Unless Required&gt;
An optional company name []: &lt;Leave Empty Unless Required&gt;
---------------------------------------------------------------------------------------
</pre>
</li>
<li><strong>Now use the CSR and key to create a self-signed certificate:</strong>
<pre class="brush: bash; light: true; title: ; notranslate">
openssl x509 -req -in www.mysite.com.csr -signkey www.mysite.com.key -out www.mysite.com.crt
</pre>
</li>
<li><strong>Create the apache SSL certificate and key directories, copy the required files and set permissions:</strong>
<pre class="brush: bash; light: true; title: ; notranslate">
mkdir -p /etc/httpd/conf/ssl.crt
mkdir -p /etc/httpd/conf/ssl.key
cat ~/www.envision-systems.com.au.crt &gt; /etc/httpd/conf/ssl.crt/www.envision-systems.com.au.crt
cat ~/www.envision-systems.com.au.key &gt; /etc/httpd/conf/ssl.key/www.envision-systems.com.au.key
chmod -R 600 /etc/httpd/conf/ssl.key
chmod -R 600 /etc/httpd/conf/ssl.crt
</pre>
</li>
<li><strong>Configure apache SSL:</strong>
<pre class="brush: bash; light: true; title: ; notranslate">
vim /etc/httpd/conf.d/ssl.conf
</pre>
<pre class="brush: bash; light: true; title: ; notranslate">
&lt;VirtualHost _default_:443&gt;
        DocumentRoot /var/www/html/www.mysite.com
        DirectoryIndex index.php
        ServerName etc/httpd

        SSLEngine on
        SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL

        SSLCertificateFile /etc/httpd/conf/ssl.crt/www.mysite.com.crt
        SSLCertificateKeyFile /etc/httpd/conf/ssl.key/www.mysite.com.key

        &lt;Files ~ &quot;\.(cgi|shtml|phtml|php3?)$&quot;&gt;
            SSLOptions +StdEnvVars
        &lt;/Files&gt;
        &lt;Directory &quot;/usr/local/apache/cgi-bin&quot;&gt;
            SSLOptions +StdEnvVars
        &lt;/Directory&gt;

        SetEnvIf User-Agent &quot;.*MSIE.*&quot; \
                 nokeepalive ssl-unclean-shutdown \
                 downgrade-1.0 force-response-1.0
        CustomLog /usr/local/apache/logs/ssl_request_log \
                  &quot;%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \&quot;%r\&quot; %b&quot;

&lt;/VirtualHost&gt;
</pre>
<p><strong>Ensure that your vim /etc/httpd/conf/httpd.conf contains a NameVirtualHost entry for port 443:</strong></p>
<pre class="brush: bash; light: true; title: ; notranslate">
NameVirtualHost *:443
</pre>
</li>
<li><strong>Test apache configuration and restart if ok:</strong>
<pre class="brush: bash; light: true; title: ; notranslate">
apachectl configtest
apachectl restart
</pre>
</li>
</ol>
<h2>Configure the Client</h2>
<hr />
<ol>
<li><strong>Login to your client machine as root, and copy the www.mysite.com.crt file to your client machine then set permissions:</strong>
<pre class="brush: bash; light: true; title: ; notranslate">
cd ~/
chmod 600 www.envision-systems.com.au.crt
</pre>
</li>
<li><strong>Install wget if you haven&#8217;t already:</strong>
<pre class="brush: bash; light: true; title: ; notranslate">
yum install wget
</pre>
<p><strong>Test the certificate using wget:</strong></p>
<pre class="brush: bash; light: true; title: ; notranslate">
wget --ca-certificate=www.mysite.com.crt https://www.mysite.com/
</pre>
<p><strong>If all went well you should see something like this:</strong></p>
<pre class="brush: bash; light: true; title: ; notranslate">
--2011-07-25 10:36:56--  https://www.mysite.com/
Resolving www.mysite.com... 29.141.129.5
Connecting to www.mysite.com|29.141.129.5|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified 1
Saving to: `index.html.1'
    [ &lt;=&gt; ] 13,355      --.-K/s   in 0.001s
2011-07-25 10:36:56 (17.1 MB/s) - `index.html.1' saved [13355]
</pre>
</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.envision-systems.com.au/blog/2011/07/25/setting-up-a-self-signed-ssl-certificate-using-modssl-apache-2-and-scientific-centos-redhat/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Get a list of ranked client IP addresses from your apache log</title>
		<link>http://www.envision-systems.com.au/blog/2011/07/15/get-a-list-of-ranked-client-ip-addresses-from-your-apache-log/</link>
		<comments>http://www.envision-systems.com.au/blog/2011/07/15/get-a-list-of-ranked-client-ip-addresses-from-your-apache-log/#comments</comments>
		<pubDate>Fri, 15 Jul 2011 03:54:57 +0000</pubDate>
		<dc:creator>William Jamieson</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://www.envision-systems.com.au/blog/?p=133</guid>
		<description><![CDATA[Most of the software I write is for businesses that have multiple office locations. Even though the software is web based, my clients often want to lock access down so that the software can only be accessed from within one &#8230; <a href="http://www.envision-systems.com.au/blog/2011/07/15/get-a-list-of-ranked-client-ip-addresses-from-your-apache-log/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Most of the software I write is for businesses that have multiple office locations.  Even though the software is web based, my clients often want to lock access down so that the software can only be accessed from within one of their offices.  We do this by getting the public IP address of each office and allowing only that traffic through.  Because I block requests from non-registered IP addresses using PHP, apache will still handle the request.  Therefore all user IP addresses will be registered within the /var/log/http/access_log whether they are registered IP addresses or not.</p>
<p>Sometimes you need to see if a specific IP address is trying to access your server.  Here&#8217;s a handy little bash command that will list all of the IP addresses contained in the current apache log and rank them by the number of times they appear (# of requests they have made).</p>
<pre class="brush: bash; light: true; title: ; notranslate">
cat /var/log/http/access_log | awk '{print $1}' | sort | uniq -c | sort -n
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.envision-systems.com.au/blog/2011/07/15/get-a-list-of-ranked-client-ip-addresses-from-your-apache-log/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting up automatic SSH login without password on CentOS</title>
		<link>http://www.envision-systems.com.au/blog/2010/08/23/setting-up-automatic-ssh-login-without-password-on-centos/</link>
		<comments>http://www.envision-systems.com.au/blog/2010/08/23/setting-up-automatic-ssh-login-without-password-on-centos/#comments</comments>
		<pubDate>Mon, 23 Aug 2010 04:56:54 +0000</pubDate>
		<dc:creator>William Jamieson</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[authentication]]></category>
		<category><![CDATA[automatic]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[keys]]></category>
		<category><![CDATA[login]]></category>
		<category><![CDATA[scp]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://williamjamieson.wordpress.com/?p=122</guid>
		<description><![CDATA[Its reasonably common for me to require one server to log into another server automatically over SSH. Whether you&#8217;re transferring backup files to a remote server using scp or just performing a scheduled remote function, automating the authentication process can &#8230; <a href="http://www.envision-systems.com.au/blog/2010/08/23/setting-up-automatic-ssh-login-without-password-on-centos/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Its reasonably common for me to require one server to log into another server automatically over SSH.  Whether you&#8217;re transferring backup files to a remote server using scp or just performing a scheduled remote function, automating the authentication process can make this a lot easier.</p>
<p>For the sake of this tutorial, my username on the local machine will be <em>localuser</em>@localserver and my username on the remote machine will be <em>remoteuser</em>@remoteserver.  If you are running these automated taks in your crontab remember to specify the <em>localuser</em> as the user account running the script in your /etc/crontab file:</p>
<pre class="brush: bash; light: true; title: ; notranslate">
# Running backup for server conf files every night at 1.00 am
00  1   *   *   *   localuser   /backup/scripts/backupToRemoteServer.sh
</pre>
<p><span style="color:#8A0808;">WARNING: Allowing a local server to automatically log into a remote server means that if the local server gets compromised, then the intruders will also have automatic access to the remote server, compromising it also.</span></p>
<p>For this reason I always ensure that the remoteuser account has its privileges reduced to the point where it can&#8217;t do anything except what I require it to do. Setting up user privileges is outside the scope of this tutorial and depends greatly on the specific task you need to perform on the remote server.</p>
<h3>1.  Login to the local machine as localuser</h3>
<pre class="brush: bash; light: true; title: ; notranslate">
#ssh localuser@localserver
</pre>
<h3>2.  Create an .ssh directory on the local machine in the localuser&#8217;s home directory</h3>
<pre class="brush: bash; light: true; title: ; notranslate">
#mkdir ~/.ssh
#chmod 700 ~/.ssh
</pre>
<h3>3.  Generate the ssh keys on the local machine</h3>
<pre class="brush: bash; light: true; title: ; notranslate">
#ssh-keygen -t dsa -C '&lt;enter a description about your local server here&gt;'
</pre>
<p><strong>Output:</strong></p>
<pre class="brush: plain; light: true; title: ; notranslate">
Generating public/private dsa key pair.
Enter file in which to save the key (/home/localuser/.ssh/id_dsa):
Enter passphrase (empty for no passphrase):  &lt;Leave Empty&gt;
Enter same passphrase again:  &lt;Leave Empty&gt;
Your identification has been saved in /home/localuser/.ssh/id_dsa.
Your public key has been saved in /home/localuser/.ssh/id_dsa.pub.
The key fingerprint is:
64:be:2f:ec:d4:30:61:28:d4:8b:58:e9:bd:ea:f4:65 &lt;local machine description as entered in above&gt;
</pre>
<h3>4.  Set permissions for the SSH key on the local server</h3>
<pre class="brush: bash; light: true; title: ; notranslate">
#chmod 600 ~/.ssh/id_dsa.pub
</pre>
<h3>5.  Open the ~/.ssh/id_dsa.pub file and copy its contents to your clipboard</h3>
<pre class="brush: bash; light: true; title: ; notranslate">
#cat ~/.ssh/id_dsa.pub
</pre>
<h3>6.  Login to the remote server</h3>
<pre class="brush: bash; light: true; title: ; notranslate">
#ssh remoteuser@remoteserver
</pre>
<h3>7.  Create an .ssh directory on the remote machine in the remoteuser&#8217;s home directory</h3>
<pre class="brush: bash; light: true; title: ; notranslate">
#mkdir ~/.ssh
#chmod 700 ~/.ssh
</pre>
<h3>8.  Paste your clipboard contents (the local servers id_dsa.pub file) at the bottom of the authorized_keys file on the remote server</h3>
<pre class="brush: bash; light: true; title: ; notranslate">
#vim ~/.ssh/authorized_keys
</pre>
<h3>9.  Set permissions on the remote servers authorized_keys file</h3>
<pre class="brush: bash; light: true; title: ; notranslate">
#chmod 600 ~/.ssh/authorized_keys
</pre>
<h3>10.  Go back to the local machine as localuser and then try to log into the remote machine</h3>
<p>Login to the local server:</p>
<pre class="brush: bash; light: true; title: ; notranslate">
#ssh localuser@localserver
</pre>
<p>Then try to access the remote server from the local server:</p>
<pre class="brush: bash; light: true; title: ; notranslate">
#ssh remoteuser@remoteserver
</pre>
<p>It should now login automatically.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.envision-systems.com.au/blog/2010/08/23/setting-up-automatic-ssh-login-without-password-on-centos/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

