<?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>Tech Trivia &#187; Linux</title>
	<atom:link href="http://www.alethe.com/brad/category/tech-notes/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.alethe.com/brad</link>
	<description>For those who know just enough to be dangerous</description>
	<lastBuildDate>Sun, 28 Feb 2010 04:45:10 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Recursively set permissions on directories</title>
		<link>http://www.alethe.com/brad/2010/02/recursively-set-permissions-on-directories/</link>
		<comments>http://www.alethe.com/brad/2010/02/recursively-set-permissions-on-directories/#comments</comments>
		<pubDate>Sun, 28 Feb 2010 04:43:57 +0000</pubDate>
		<dc:creator>Brad</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tech Notes]]></category>

		<guid isPermaLink="false">http://www.alethe.com/brad/?p=129</guid>
		<description><![CDATA[The following command will execute a command on a directory and all its sub-directories: $ find plugins -type d -exec chmod g+w {} \; In this case, we&#8217;re changing the group permissions on the plugins directory and all sub-directories.]]></description>
			<content:encoded><![CDATA[<p>The following command will execute a command on a directory and all its sub-directories:</p>
<pre class="brush: bash">
$ find plugins -type d -exec chmod g+w {} \;
</pre>
<p>In this case, we&#8217;re changing the group permissions on the plugins directory and all sub-directories.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.alethe.com/brad/2010/02/recursively-set-permissions-on-directories/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Update your SELinux policy</title>
		<link>http://www.alethe.com/brad/2010/02/update-your-selinux-policy/</link>
		<comments>http://www.alethe.com/brad/2010/02/update-your-selinux-policy/#comments</comments>
		<pubDate>Mon, 22 Feb 2010 14:15:02 +0000</pubDate>
		<dc:creator>Brad</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tech Notes]]></category>

		<guid isPermaLink="false">http://www.alethe.com/brad/?p=115</guid>
		<description><![CDATA[If you&#8217;ve recently installed an application or applied some patches that begin to generate a lot of SELinux audit entries, you can update your local policy to accommodate your recent changes. Please note that this isn&#8217;t a substitute for ensuring your files have the appropriate selinux roles and types. # grep avc /var/log/audit/audit.log &#124; audit2allow [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;ve recently installed an application or applied some patches that begin to generate a lot of SELinux audit entries, you can update your local policy to accommodate your recent changes.  Please note that this isn&#8217;t a substitute for ensuring your files have the appropriate selinux roles and types.</p>
<pre class="brush: plain">
# grep avc /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.alethe.com/brad/2010/02/update-your-selinux-policy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Update text in multiple files in Linux</title>
		<link>http://www.alethe.com/brad/2009/06/update-text-in-multiple-files-in-linux/</link>
		<comments>http://www.alethe.com/brad/2009/06/update-text-in-multiple-files-in-linux/#comments</comments>
		<pubDate>Thu, 25 Jun 2009 21:34:09 +0000</pubDate>
		<dc:creator>Brad</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tech Notes]]></category>

		<guid isPermaLink="false">http://www.alethe.com/brad/?p=63</guid>
		<description><![CDATA[I recently came across a command that allows me to search and replace a string of text in all files within a directory structure. This is very useful for updating static information in HTML files and the like. find ./ -iname \*.htm\* -exec sed -i 's/www\.example\.com/www2\.example\.com/g' {} \; Note that you must denote special characters [...]]]></description>
			<content:encoded><![CDATA[<p>I recently came across a command that allows me to search and replace a string of text in all files within a directory structure.  This is very useful for updating static information in HTML files and the like.</p>
<p><code>find ./ -iname \*.htm\* -exec sed -i 's/www\.example\.com/www2\.example\.com/g' {} \;</code></p>
<p>Note that you must denote special characters with the backslash character (e.g., the dots in www.example.com).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.alethe.com/brad/2009/06/update-text-in-multiple-files-in-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Find world writable directories</title>
		<link>http://www.alethe.com/brad/2009/05/find-world-writable-directories/</link>
		<comments>http://www.alethe.com/brad/2009/05/find-world-writable-directories/#comments</comments>
		<pubDate>Tue, 12 May 2009 18:47:56 +0000</pubDate>
		<dc:creator>Brad</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tech Notes]]></category>

		<guid isPermaLink="false">http://www.alethe.com/brad/?p=60</guid>
		<description><![CDATA[I recently found myself needing to locate all world writable files in a directory tree and came across the following useful command: find /var/ -type d -perm -o+w -exec ls -ld {} \; The syntax may vary depending on the flavour of Unix/Linux you&#8217;re using, but this worked on Ubuntu for me.]]></description>
			<content:encoded><![CDATA[<p>I recently found myself needing to locate all world writable files in a directory tree and came across the following useful command:</p>
<p><code>find /var/ -type d -perm -o+w -exec ls -ld {} \;</code></p>
<p>The syntax may vary depending on the flavour of Unix/Linux you&#8217;re using, but this worked on Ubuntu for me.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.alethe.com/brad/2009/05/find-world-writable-directories/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using rsync over ssh</title>
		<link>http://www.alethe.com/brad/2009/05/using-rsync-over-ssh/</link>
		<comments>http://www.alethe.com/brad/2009/05/using-rsync-over-ssh/#comments</comments>
		<pubDate>Fri, 08 May 2009 00:58:46 +0000</pubDate>
		<dc:creator>Brad</dc:creator>
				<category><![CDATA[Apple OS X]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tech Notes]]></category>
		<category><![CDATA[rsync]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://www.alethe.com/brad/?p=43</guid>
		<description><![CDATA[You can securely synchronize directory structures between two Linux computers by using the following command: rsync -ave ssh --delete myhost.example.com:Documents/ Documents/ The &#8722;&#8722;delete option ensures that any files or directories that no longer exist on the source are also removed from the destination.]]></description>
			<content:encoded><![CDATA[<p>You can securely synchronize directory structures between two Linux computers by using the following command:</p>
<p><code>rsync -ave ssh --delete myhost.example.com:Documents/ Documents/</code></p>
<p>The &#8722;&#8722;delete option ensures that any files or directories that no longer exist on the source are also removed from the destination.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.alethe.com/brad/2009/05/using-rsync-over-ssh/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ruby on Rails for RHEL 5</title>
		<link>http://www.alethe.com/brad/2008/04/ruby-on-rails-for-rhel-5/</link>
		<comments>http://www.alethe.com/brad/2008/04/ruby-on-rails-for-rhel-5/#comments</comments>
		<pubDate>Mon, 28 Apr 2008 02:06:49 +0000</pubDate>
		<dc:creator>Brad</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ruby and Rails]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[RHEL]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://www.alethe.com/brad/?p=37</guid>
		<description><![CDATA[Here is the quick and dirty Ruby on Rails setup for Redhat Enterprise Linux v5.0 with MySQL. (2009-12-04 Update: This does not work with RHEL 5.4. The mysql ruby gem requires ruby 1.8.6 and RHEL 5.4 only ships with ruby 1.8.5) Using yum install ruby and mysql. The command below does not list all the [...]]]></description>
			<content:encoded><![CDATA[<p>Here is the quick and dirty Ruby on Rails setup for Redhat Enterprise Linux v5.0 with MySQL.</p>
<p><em>(2009-12-04 Update: This does not work with RHEL 5.4.  The mysql ruby gem requires ruby 1.8.6 and RHEL 5.4 only ships with ruby 1.8.5)</em></p>
<p>Using <code>yum</code> install ruby and mysql.  The command below does not list all the required packages, but due to dependencies, the additional packages will be installed (or should be &#8211; this is all from memory).<br />
<span id="more-37"></span><br />
<code>[bm@app3 ~]$ sudo su -<br />
[root@app3 ~]# yum install ruby ruby-devel ruby-libs ruby-irb \<br />
> ruby-rdoc subversion-ruby mysql-server mysql-devel<br />
[....]</code></p>
<p>Complete the basic configuration of MySQL.<br />
<code>[root@app3 ~]# /sbin/chkconfig mysqld on<br />
[root@app3 ~]# service mysqld start<br />
[root@app3 ~]# mysql_secure_installation<br />
</code></p>
<p><a href="http://rubyforge.org/projects/rubygems/">Download</a> and install RubyGems.  As of the date this post was written, the latest version is 1.1.1.<br />
<code>[root@app3 ~]# wget http://rubyforge.org/frs/download.php/35284/rubygems-1.1.1.zip<br />
[root@app3 ~]# unzip rubygems-1.1.1.zip<br />
[root@app3 ~]# cd rubygems-1.1.1<br />
[root@app3 rubygems-1.1.1]# ruby setup.rb<br />
[root@app3 ~]# cd ..<br />
[root@app3 ~]# rm -rf rubygems-1.1.1<br />
</code></p>
<p>Now install Rails, Mongrel, the Ruby MySQL interface, Capistrano<br />
<code>[root@app3 ~]# gem install rails --include-dependencies --no-rdoc --no-ri<br />
[root@app3 ~]# gem install mongrel --include-dependencies --no-rdoc --no-ri<br />
[root@app3 ~]# gem install mysql -- --with-mysql-config=/usr/bin/mysql_config<br />
[root@app3 ~]# gem install capistrano --include-dependencies --no-rdoc --no-ri<br />
</code></p>
<p>Phusion&#8217;s <a href="http://modrails.com/">passenger</a> gem provides a &#8220;mod_rails&#8221; module for Apache.  The installation is very straight forward.<br />
<code>[root@app3 ~]# gem install passenger<br />
[root@app3 ~]# passenger-install-apache2-module<br />
</code></p>
<p>Just follow the on-screen instructions to finish the installation.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.alethe.com/brad/2008/04/ruby-on-rails-for-rhel-5/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Move an LVM-based virtual machine to another host</title>
		<link>http://www.alethe.com/brad/2008/04/move-an-lvm-based-virtual-machine-to-another-host/</link>
		<comments>http://www.alethe.com/brad/2008/04/move-an-lvm-based-virtual-machine-to-another-host/#comments</comments>
		<pubDate>Sun, 27 Apr 2008 03:18:26 +0000</pubDate>
		<dc:creator>Brad</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tech Notes]]></category>
		<category><![CDATA[Virtualization]]></category>
		<category><![CDATA[LVM]]></category>
		<category><![CDATA[Xen]]></category>

		<guid isPermaLink="false">http://www.alethe.com/brad/?p=35</guid>
		<description><![CDATA[For those running Xen on servers with no back-end SAN, the following instructions detail the steps necessary to move an LVM-based virtual machine to a new physical host. There may be more elegant ways to achieve this, but this is what worked for me. Environment Ok, so let&#8217;s set the scene: vmhost is a RHEL [...]]]></description>
			<content:encoded><![CDATA[<p>For those running Xen on servers with no back-end SAN, the following instructions detail the steps necessary to move an LVM-based virtual machine to a new physical host.  There may be more elegant ways to achieve this, but this is what worked for me.</p>
<p><strong>Environment</strong><br />
Ok, so let&#8217;s set the scene:</p>
<ul>
<li><code>vmhost</code> is a RHEL 5 server running several virtual machines using the Xen virtualization technology. Each virtual machine is allocated a 60 GB logical volume within an LVM volume group. One of these virtual machines, &#8220;win2k3vm&#8221;, needs to be moved to a new server.</li>
<li><code>new-vmhost</code> is almost identical to vmhost, but has updated hardware and more memory.  This is the server that &#8220;win2k3vm&#8221; will be moved to.</li>
</ul>
<p><span id="more-35"></span><br />
<strong>Migrate the Virtual Machine</strong><br />
1. Create a snapshot of virtual machine LVM volume.  This can be run on a live virtual machine, but it is probably safer to perform a graceful shutdown of your virtual machine first.</p>
<p><code>[root@vmhost]# lvcreate -s -L 300m -n win2k3vm-snap VolGroup01</code></p>
<p>2. Export the snapshot of the guest VM to a file that can be moved between physical servers.</p>
<p><code>[root@vmhost]# dd if=/dev/VolGroup01/win2k3vm-snap of=/mnt/temp/win2k3vm.img bs=4096</code></p>
<p>3. Remove the snapshot LVM volume.</p>
<p><code>[root@vmhost]# lvremove /dev/VolGroup01/win2k3vm-snap</code></p>
<p>4. Copy the file to the new VM host.  Make sure you have sufficient free drive space.</p>
<p><code>[root@vmhost]# scp /mnt/temp/win2k3vm.img user@new-vmhost:/mnt/temp/</code></p>
<p>5. On the new VM host, create an LVM volume that is at least as big as the guest VM file.</p>
<p><code>[root@new-vmhost]# lvcreate -n win2k3vm -L 60G VMGroup</code></p>
<p>6. Transfer the guest VM file to the new LVM volume.</p>
<p><code>[root@new-vmhost]# dd if=win2k3vm.img of=/dev/VMGroup/win2k3vm bs=4096</code></p>
<p>7. Copy the VM config file from the old VM host to the new VM host server.</p>
<p><code>[root@vmhost]# scp /etc/xen/win2k3vm user@new-vmhost:</code></p>
<p>8. Copy the file to the appropriate directory.</p>
<p><code>[usr@new-vmhost]$ sudo mv ~/win2k3vm /etc/xen/</code></p>
<p><strong>Summary of Commands</strong><br />
<code>[root@vmhost]# lvcreate -s -L 300m -n win2k3vm-snap VolGroup01<br />
[root@vmhost]# dd if=/dev/VolGroup01/win2k3vm-snap of=/mnt/temp/win2k3vm.img bs=4096<br />
[root@vmhost]# lvremove /dev/VolGroup01/win2k3vm-snap<br />
[root@vmhost]# scp /mnt/temp/win2k3vm.img user@new-vmhost:/mnt/temp/<br />
[root@new-vmhost]# lvcreate -n win2k3vm -L 60G VMGroup<br />
[root@new-vmhost]# dd if=win2k3vm.img of=/dev/VMGroup/win2k3vm bs=4096<br />
[root@vmhost]# scp /etc/xen/win2k3vm user@new-vmhost:<br />
[usr@new-vmhost]$ sudo mv ~/win2k3vm /etc/xen/<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.alethe.com/brad/2008/04/move-an-lvm-based-virtual-machine-to-another-host/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Install phpMyAdmin</title>
		<link>http://www.alethe.com/brad/2008/02/install-phpmyadmin/</link>
		<comments>http://www.alethe.com/brad/2008/02/install-phpmyadmin/#comments</comments>
		<pubDate>Thu, 21 Feb 2008 03:01:13 +0000</pubDate>
		<dc:creator>Brad</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.alethe.com/brad/?p=38</guid>
		<description><![CDATA[phpMyAdmin is web-based PHP application for managing MySQL databases. It is fairly easy to install and configure. Download the latest stable version from the phpMyAdmin web site, and extract it to a location of your choice. I prefer to keep the installation outside of the web root and use an apache alias to reference it. [...]]]></description>
			<content:encoded><![CDATA[<p>phpMyAdmin is web-based PHP application for managing MySQL databases.  It is fairly easy to install and configure.</p>
<p>Download the latest stable version from the <a href="http://www.phpmyadmin.net">phpMyAdmin web site</a>, and extract it to a location of your choice.  I prefer to keep the installation outside of the web root and use an apache alias to reference it.<br />
<span id="more-38"></span><br />
<code>[root@app3 ~]# cd /var/www<br />
[root@app3 ~]# wget http://superb-west.dl.sourceforge.net/sourceforge/phpmyadmin/phpMyAdmin-2.11.5.2-all-languages-utf-8-only.tar.gz<br />
[root@app3 ~]# tar xzf phpMyAdmin-2.11.5.2-all-languages-utf-8-only.tar.gz<br />
</code><br />
Now that&#8217;s a lengthy directory name!  Let&#8217;s create a link to that directory with a more friendly name.<br />
<code><br />
[root@app3 ~]# ln -s phpMyAdmin-2.11.5.2-all-languages-utf-8-only phpMyAdmin<br />
</code></p>
<p>SELinux may generate a number of errors regarding this new directory that will be referenced by the apache web server.  Let&#8217;s correct the security context of the entire phpMyAdmin directory structure.<br />
<code><br />
[root@app3 ~]# chcon -R -h -t httpd_sys_content_t \<br />
> phpMyAdmin-2.11.5.2-all-languages-utf-8-only<br />
</code></p>
<p>Configure the phpMyAdmin installation to use http authentication.  We&#8217;ll make sure it is secure by forcing SSL encryption using apache directives in a later step.<br />
<code><br />
[root@app3 ~]# cd phpMyAdmin<br />
[root@app3 ~]# cp config.sample.inc.php config.inc.php<br />
[root@app3 ~]# vi config.inc.php<br />
</code></p>
<p>Change the line:<br />
<code>$cfg['Servers'][$i]['auth_type'] = 'cookie';</code><br />
to:<br />
<code>$cfg['Servers'][$i]['auth_type'] = 'http';</code></p>
<p>Now we need to configure the apache web server.  To keep things modular, create a file <code>phpmyadmin.conf</code> in <code>/etc/httpd/conf.d</code>.  Any configuration directives in this file will automatically be loaded into the main apache configuration when the daemon is restarted.<br />
<code><br />
[root@app3 ~]# vi /etc/httpd/conf.d/phpmyadmin.conf<br />
</code></p>
<p>The <code>phpmyadmin.conf</code> file should contain the following directives.  Just modify the paths to suit your installation.<br />
<code></p>
<pre>
Alias /phpmyadmin /var/www/phpMyAdmin
&lt;Directory "/var/www/phpMyAdmin"&gt;
    Options FollowSymLinks
    AllowOverride None
    Order allow,deny
    Allow from all
    SSLRequireSSL
&lt;/Directory&gt;
</pre>
<p></code></p>
<p>Restart apache and see if your installation works.<br />
<code><br />
[root@app3 ~]# service httpd restart<br />
</code></p>
<p>If there are problems, check your logs.  It is possible that SELinux may be complaining about something.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.alethe.com/brad/2008/02/install-phpmyadmin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mount an ISO file</title>
		<link>http://www.alethe.com/brad/2008/01/mount-an-iso-file/</link>
		<comments>http://www.alethe.com/brad/2008/01/mount-an-iso-file/#comments</comments>
		<pubDate>Fri, 25 Jan 2008 14:50:24 +0000</pubDate>
		<dc:creator>Brad</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tech Notes]]></category>

		<guid isPermaLink="false">http://www.alethe.com/brad/?p=31</guid>
		<description><![CDATA[You can mount a CD or DVD image in Linux so that it appears like a regularly inserted disc. Use the following command: prompt# mount Fedora-8-x86_64-DVD.iso /mnt/isofile/ -o ro,loop=/dev/loop0 Ensure that the /mnt/isofile directory exists before trying to mount the ISO to that location.]]></description>
			<content:encoded><![CDATA[<p>You can mount a CD or DVD image in Linux so that it appears like a regularly inserted disc.  Use the following command:</p>
<p><code>prompt# mount Fedora-8-x86_64-DVD.iso /mnt/isofile/ -o ro,loop=/dev/loop0</code></p>
<p>Ensure that the /mnt/isofile directory exists before trying to mount the ISO to that location.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.alethe.com/brad/2008/01/mount-an-iso-file/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VNC over SSH</title>
		<link>http://www.alethe.com/brad/2007/05/vnc-over-ssh/</link>
		<comments>http://www.alethe.com/brad/2007/05/vnc-over-ssh/#comments</comments>
		<pubDate>Sat, 26 May 2007 03:12:32 +0000</pubDate>
		<dc:creator>Brad</dc:creator>
				<category><![CDATA[Apple OS X]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tech Notes]]></category>

		<guid isPermaLink="false">http://www.alethe.com/brad/?p=34</guid>
		<description><![CDATA[Sometimes it is useful to manage a Linux server remotely using VNC. A simple and secure method for doing so is to tunnel the VNC connection using Secure Shell. The following instructions have been tested on Redhat Enterprise Linux 5 AS. On the server side: First, we need to ensure the vncserver is actually running. [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes it is useful to manage a Linux server remotely using VNC.  A simple and secure method for doing so is to tunnel the VNC connection using Secure Shell.  The following instructions have been tested on Redhat Enterprise Linux 5 AS.</p>
<p><strong>On the server side:</strong><br />
First, we need to ensure the vncserver is actually running.  SSH to the server or logon at the console as your regular user account.  No root privileges are necessary.  Once logged in, just type <code>vncserver</code>.  You should see something like this:<br />
<span id="more-34"></span><br />
<code>
<pre>[bm@app3 ~]$ vncserver 

You will require a password to access your desktops.

Password:
Verify:
xauth:  creating new authority file /home/bm/.Xauthority

New 'app3.domain.com:1 (app3)' desktop is app3.domain.com:1

Creating default startup script /home/bm/.vnc/xstartup
Starting applications specified in /home/bm/.vnc/xstartup
Log file is /home/bm/.vnc/app3.domain.com:1.log
</pre>
<p></code></p>
<p>If this is the first time you&#8217;ve run the application, you&#8217;ll be prompted to set a password for vnc clients, and it will also create default X Windows session configurations.  You probably don&#8217;t want to use the defaults, so kill the current vnc server instance and edit those files.<br />
<code><br />
[bm@app3 ~] vncserver -kill :1<br />
Killing Xvnc process ID 29181<br />
[bm@app3 ~]$ cat .vnc/xstartup<br />
#!/bin/sh</p>
<p># Uncomment the following two lines for normal desktop:<br />
<strong># unset SESSION_MANAGER<br />
# exec /etc/X11/xinit/xinitrc</strong></p>
<p>[ -x /etc/vnc/xstartup ] &#038;&#038; exec /etc/vnc/xstartup<br />
[ -r $HOME/.Xresources ] &#038;&#038; xrdb $HOME/.Xresources<br />
xsetroot -solid grey<br />
vncconfig -iconic &#038;<br />
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &#038;<br />
twm &#038;<br />
</code></p>
<p>Uncomment the lines in bold and then start <code>vncserver</code> again.</p>
<p><strong>On the client side:</strong><br />
Open up a shell window (on your Linux/Mac OS X client) and configure your tunnel to forward the server&#8217;s VNC port (e.g., 5901/tcp) to your localhost.  Please note that the VNC port range starts at 5900 and increases by screen number.  For example, if you are trying to connect to myserver.domain.com:23 (i.e., screen 23), you will need to reference port 5923/tcp.  For the purpose of this article, we&#8217;re assuming there is only one VNC instance running on the server, and the screen number is :1.</p>
<p><code>client:~ user$ ssh remoteserver.domain.com -L 5901/127.0.0.1/5901</code></p>
<p>Now, use your VNC client to connect to localhost:1 or localhost port:5901.</p>
<p>There are several good VNC clients for Mac OS X and Windows, and most distributions of Linux already have VNC installed.</p>
<p><strong>Free VNC Applications:</strong></p>
<ul>
<li><a href="http://www.tightvnc.com/">TightVNC</a>(multi-platform)</li>
<li><a href="http://sourceforge.net/projects/cotvnc/">Chicken of the VNC</a>(Mac OS X)</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.alethe.com/brad/2007/05/vnc-over-ssh/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
