<?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>Steve Jenkins&#039; Blog &#187; Fedora 12</title>
	<atom:link href="http://stevejenkins.com/blog/tag/fedora-12/feed/" rel="self" type="application/rss+xml" />
	<link>http://stevejenkins.com/blog</link>
	<description>Tech articles, product reviews, and other geeky stuff.</description>
	<lastBuildDate>Thu, 22 Dec 2011 19:59:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Tips for installing Amavis-new, ClamAV, and SpamAssassin using Postfix on Fedora 12</title>
		<link>http://stevejenkins.com/blog/2011/02/tips-for-installing-amavis-new-clamav-and-spamassassin-using-postfix-on-fedora-12/</link>
		<comments>http://stevejenkins.com/blog/2011/02/tips-for-installing-amavis-new-clamav-and-spamassassin-using-postfix-on-fedora-12/#comments</comments>
		<pubDate>Tue, 15 Feb 2011 02:13:18 +0000</pubDate>
		<dc:creator>Steve Jenkins</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Reference]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Amavis-new]]></category>
		<category><![CDATA[ClamAV]]></category>
		<category><![CDATA[Fedora]]></category>
		<category><![CDATA[Fedora 12]]></category>
		<category><![CDATA[Fedora Core 12]]></category>
		<category><![CDATA[Postfix]]></category>
		<category><![CDATA[SPAM]]></category>
		<category><![CDATA[SpamAssassin]]></category>

		<guid isPermaLink="false">http://stevejenkins.com/blog/?p=1162</guid>
		<description><![CDATA[This is another one of those articles I write mainly so I can reference it later to help me remember how I got something working, but if it helps someone else trying to get Amavis, ClamAV, and SpamAssassin working with Postfix on Fedora, then great! I&#8217;ve got a server running Fedora 12 that I don&#8217;t [...]
Related posts:<ol>
<li><a href='http://stevejenkins.com/blog/2011/03/how-to-use-address-tagging-usertagexample-com-with-postfix/' rel='bookmark' title='How to use Address Tagging (user+tag@example.com) with Postfix'>How to use Address Tagging (user+tag@example.com) with Postfix</a></li>
<li><a href='http://stevejenkins.com/blog/2011/08/installing-opendkim-rpm-via-yum-with-postfix-or-sendmail-for-rhel-centos-fedora/' rel='bookmark' title='Installing OpenDKIM RPM via Yum with Postfix or Sendmail (for RHEL / CentOS / Fedora)'>Installing OpenDKIM RPM via Yum with Postfix or Sendmail (for RHEL / CentOS / Fedora)</a></li>
<li><a href='http://stevejenkins.com/blog/2011/06/fixing-postfix-certificate-verification-failed-for-gmail-untrusted-issuer-error-message/' rel='bookmark' title='Fixing Postfix &#8220;certificate verification failed for gmail untrusted issuer&#8221; Error Message'>Fixing Postfix &#8220;certificate verification failed for gmail untrusted issuer&#8221; Error Message</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>This is another one of those articles I write mainly so I can reference it later to help me remember how I got something working, but if it helps someone else trying to get Amavis, ClamAV, and SpamAssassin working with Postfix on Fedora, then great!<span id="more-1162"></span></p>
<p>I&#8217;ve got a server running Fedora 12 that I don&#8217;t want to upgrade yet (the current Fedora is 14 as of the date of this article). I handle a fair amount of incoming mail on this box, and I have Postfix configured to block all the incoming mail coming from non RFC-compliant SMTP servers, servers relaying through dynamic IP addresses, and servers on popular DNS blacklists. These three measures successfully block more than 98% of all incoming spam.</p>
<p>In an attempt to eat into that last 2%, I decided to add some server-side SPAM scanning on the server. And as long as I&#8217;m going through the effort to do that, I figured it was very little additional effort to also scan incoming messages for viruses at the same time.</p>
<p>The current &#8220;holy trinity&#8221; of anti-SPAM and virus tools are:</p>
<ul>
<li><a target="_blank" href="http://spamassassin.apache.org/" target="_blank">SpamAssassin</a>: a widely used and highly configurable SPAM checking program.</li>
<li><a target="_blank" href="http://www.clamav.net/lang/en/" target="_blank">Clam AntiVirus</a> (aka ClamAV): an open source (GPL) antivirus engine designed for detecting Trojans, viruses, malware and other malicious threats.</li>
<li><a target="_blank" href="http://www.amavis.org/" target="_blank">Amavisd-new</a>: a high-performance interface between mailers (like Postfix) and content checkers (like ClamAV and SpamAssassin). It essentially links Postfix with external content checking applications.</li>
</ul>
<p>I came across <a target="_blank" href="http://fedoraunity.org/solved/server-solutions/postfix-mail-server" target="_blank">this article</a> at Fedora Unity and used it as my guide starting at Step 5 (I also ignored the grey listing steps). I was able to get everything working <em>almost</em> perfectly. The only thing I needed to add to get things working properly was explained in <a target="_blank" href="http://www200.pair.com/mecham/spam/clamav-amavisd-new.html" target="_blank">this article</a> &#8211; I needed to manually create and set permissions on a directory for the clamd.pid file.</p>
<p>Configuration files locations were:</p>
<ul>
<li>Amavis-new: <strong>/etc/amavisd/amavisd.conf</strong></li>
<li>SpamAssassin: <strong>/etc/mail/spamassassin/local.cf</strong></li>
<li>ClamAV: <strong>/etc/clam.d/amavis.conf</strong> (yep &#8211; that&#8217;s not a typo)</li>
<li>FreshClam: <strong>/etc/sysconfig/freshclam </strong>and <strong>/etc/freshclam.conf</strong></li>
</ul>
<p>I also chose to use DCC in SpamAssassin, so I needed to download and compile DCC from <a target="_blank" href="http://www.rhyolite.com/dcc/" target="_blank">here</a>, as well as enable it as explained <a target="_blank" href="http://wiki.apache.org/spamassassin/UsingDcc" target="_blank">here</a>.</p>
<p>Here&#8217;s my current SpamAssassin local.cf file:</p>
<pre>required_score          4.0
report_safe             0
rewrite_header          Subject [SPAM]
use_bayes               1
bayes_ignore_header     0
bayes_auto_learn        1
skip_rbl_checks         0
use_razor2              1
use_dcc                 1
dcc_path                /usr/local/bin/dccproc
use_pyzor               1
whitelist_from          *@mypersonaldomain.com

# Custom Rules
urirhssub       URIBL_BLACK  multi.uribl.com.        A   2
body            URIBL_BLACK  eval:check_uridnsbl('URIBL_BLACK')
describe        URIBL_BLACK  Contains an URL listed in the URIBL blacklist
tflags          URIBL_BLACK  net
score           URIBL_BLACK  3.0

urirhssub       URIBL_GREY  multi.uribl.com.        A   4
body            URIBL_GREY  eval:check_uridnsbl('URIBL_GREY')
describe        URIBL_GREY  Contains an URL listed in the URIBL greylist
tflags          URIBL_GREY  net
score           URIBL_GREY  0.25</pre>
<p>and here are the important sections of my amavisd.conf file:</p>
<pre>$sa_tag_level_deflt  = '-9999';  # add spam info headers if at, or above that level
$sa_tag2_level_deflt = 4.0;  # add 'spam detected' headers at that level
$sa_kill_level_deflt = 15.0;  # triggers spam evasive actions (e.g. blocks mail)
$sa_dsn_cutoff_level = 15.0;   # spam level beyond which a DSN is not sent</pre>
<p>Anyone else using this post should adjust these values based on their preferences. You may want higher or lower thresholds for spam marking, blocking, etc.</p>
<h2>Amavis-new with OpenDKIM and Postfix</h2>
<p>If you&#8217;re running <a title="How to get DKIM (DomainKeys Identified Mail) working with Postfix on RHEL 5 / CentOS 5 using OpenDKIM" href="http://stevejenkins.com/blog/2010/09/how-to-get-dkim-domainkeys-identified-mail-working-on-centos-5-5-and-postfix-using-opendkim/">OpenDKIM</a> and Amavis-new through Postfix on the same server (and you probably should), then in order to prevent OpenDKIM from signing your messages twice, you&#8217;ll need to add the <strong>no_milters</strong> option to one of the sections you added to Postfix&#8217;s <strong>master.cf</strong> file when setting up Amavis-new. Find the section:</p>
<pre>127.0.0.1:10025 inet n  -       n       -       -  smtpd</pre>
<p>and add <strong>no_milters</strong> at the end of the receive_override_options line, so that it looks like this:</p>
<pre>-o receive_override_options=no_header_body_checks,no_unknown_recipient_checks,no_milters</pre>
<p>Then restart Postfix and Amavis-new.</p>
<p>Related posts:<ol>
<li><a href='http://stevejenkins.com/blog/2011/03/how-to-use-address-tagging-usertagexample-com-with-postfix/' rel='bookmark' title='How to use Address Tagging (user+tag@example.com) with Postfix'>How to use Address Tagging (user+tag@example.com) with Postfix</a></li>
<li><a href='http://stevejenkins.com/blog/2011/08/installing-opendkim-rpm-via-yum-with-postfix-or-sendmail-for-rhel-centos-fedora/' rel='bookmark' title='Installing OpenDKIM RPM via Yum with Postfix or Sendmail (for RHEL / CentOS / Fedora)'>Installing OpenDKIM RPM via Yum with Postfix or Sendmail (for RHEL / CentOS / Fedora)</a></li>
<li><a href='http://stevejenkins.com/blog/2011/06/fixing-postfix-certificate-verification-failed-for-gmail-untrusted-issuer-error-message/' rel='bookmark' title='Fixing Postfix &#8220;certificate verification failed for gmail untrusted issuer&#8221; Error Message'>Fixing Postfix &#8220;certificate verification failed for gmail untrusted issuer&#8221; Error Message</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://stevejenkins.com/blog/2011/02/tips-for-installing-amavis-new-clamav-and-spamassassin-using-postfix-on-fedora-12/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Set up VNC from Windows to Fedora 12 Over the Internet</title>
		<link>http://stevejenkins.com/blog/2010/03/set-up-vnc-from-windows-to-fedora-12-over-the-internet/</link>
		<comments>http://stevejenkins.com/blog/2010/03/set-up-vnc-from-windows-to-fedora-12-over-the-internet/#comments</comments>
		<pubDate>Wed, 03 Mar 2010 22:11:28 +0000</pubDate>
		<dc:creator>Steve Jenkins</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Reference]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[Fedora]]></category>
		<category><![CDATA[Fedora 12]]></category>
		<category><![CDATA[GNOME]]></category>
		<category><![CDATA[KDE]]></category>
		<category><![CDATA[PuTTY]]></category>
		<category><![CDATA[SecureCRT]]></category>
		<category><![CDATA[SSH tunneling]]></category>
		<category><![CDATA[TigerVNC]]></category>
		<category><![CDATA[VNC]]></category>
		<category><![CDATA[VNC Server]]></category>
		<category><![CDATA[vncserver]]></category>
		<category><![CDATA[vncservers]]></category>
		<category><![CDATA[Windows to Fedora VNC]]></category>

		<guid isPermaLink="false">http://stevejenkins.com/blog/?p=400</guid>
		<description><![CDATA[I&#8217;m writing this in a VNC session from Windows 7, via a secure SSH tunnel over the Internet, to a remote Fedora 12 desktop (if you&#8217;re running Fedora 14, I&#8217;ve written a separate blog post about how to do that, too). If you&#8217;d like to be able to do the same thing, just follow these [...]
Related posts:<ol>
<li><a href='http://stevejenkins.com/blog/2010/11/how-to-set-up-vnc-from-windows-to-fedora-14-over-the-internet/' rel='bookmark' title='How to Set Up VNC from Windows to Fedora 14 Over the Internet'>How to Set Up VNC from Windows to Fedora 14 Over the Internet</a></li>
<li><a href='http://stevejenkins.com/blog/2009/12/dual-boot-windows-7-and-fedora-linux-with-dell-utility-and-recovery-partitions/' rel='bookmark' title='Dual Boot Windows 7 and Fedora 12 Linux with Dell Utility and Recovery Partitions'>Dual Boot Windows 7 and Fedora 12 Linux with Dell Utility and Recovery Partitions</a></li>
<li><a href='http://stevejenkins.com/blog/2010/08/set-up-vnc-on-rhel-5-5-centos-5-5/' rel='bookmark' title='Set up VNC on RHEL 5.5 / CentOS 5.5'>Set up VNC on RHEL 5.5 / CentOS 5.5</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m writing this in a VNC session from Windows 7, via a secure SSH tunnel over the Internet, to a remote Fedora 12 desktop (if you&#8217;re running Fedora 14, I&#8217;ve written a <a href="http://stevejenkins.com/blog/2010/11/how-to-set-up-vnc-from-windows-to-fedora-14-over-the-internet/" target="_self">separate blog post</a> about how to do that, too). If you&#8217;d like to be able to do the same thing, just follow these 10 easy steps:</p>
<h3>Step 1: Install VNC on the Remote Fedora 12 Box</h3>
<p>There are many VNC servers available for Fedora. The TigerVNC server package may have been installed by default on your Fedora 12 box when you installed the OS, but to make sure, become root (or sudo) and type:</p>
<pre>yum install vnc-server</pre>
<p>If it&#8217;s already installed, Fedora will let you know. If it&#8217;s not, it will be now!</p>
<h3>Step 2: Configure Screen Resolutions, Port Number, and Users on the Remote Fedora 12 Box</h3>
<p>The <strong>/etc/sysconfig/vncservers</strong> file controls which <em>users</em> are allowed to access your Fedora box via VNC, as well as what <em>ports </em>they will connect to, and what <em>screen resolutions</em> each of those users will use when connecting. As root (or with sudo), open the <strong>/etc/sysconfig/vncservers</strong> file with your favorite text editor and find the lines at the bottom that look something like this:</p>
<pre># VNCSERVERS="2:myusername"
# VNCSERVERARGS[2]="-geometry 800x600 -nolisten tcp -localhost"</pre>
<div>Uncomment those lines, then change &#8220;myusername&#8221; to your Linux username on the first line. On the second line, change the geometry to whatever screen resolution you&#8217;d like for your desktop when remotely connecting (to avoid seeing scroll bars, make sure it&#8217;s smaller than the size of your local desktop), and then, for right now, remove the default <strong>-localhost</strong> option. We&#8217;ll test your VNC connection without it first, and then add that option back later when we&#8217;re sure VNC is working. Assuming your Linux username was <strong>clyde</strong>, those lines should now read:</div>
<pre>VNCSERVERS="2:clyde"
VNCSERVERARGS[2]="-geometry 1024x768 -nolisten tcp"</pre>
<div>This tells the VNC server to set up VNC display port #2 (the default for remote access) to for clyde to connect with a screen resolution of 800&#215;600.</div>
<h3>Step 3: Configure the VNC Desktop Environment and Password</h3>
<p>For the next step, you should be logged in to your Fedora box as the user whose desktop you&#8217;ll want to access. If you&#8217;re already logged in as root, and your username is <strong>clyde</strong>, type:</p>
<pre>su - clyde</pre>
<p>The hyphen is important, as it will load the local path for clyde, which we&#8217;ll need for the next step. Now type:</p>
<pre>vncserver</pre>
<p>This will run the vncserver program, and will set up default versions of the necessary desktop environment files for whichever user ran the program (in this case, clyde).</p>
<p>The first time you run this, you&#8217;ll be prompted for a password. This will be your VNC password, which you&#8217;ll use to connect to your remote desktop. This can be different than your Linux account password, if you choose. If you ever want to change your VNC password, just type <strong>vncpasswd</strong> while logged on as the user whose password you want to change.</p>
<p>The newly created files will be in  the <strong>.vnc</strong> directory under the user&#8217;s home directory (for our example, <strong>/home/clyde/.vnc</strong>). Using your favorite text editor, edit the <strong>/home/<em>username</em>/.vnc/xstartup</strong> file.</p>
<p>Go to the bottom of the file, comment out the <strong>twm &amp;</strong> line, and then add a line that tells VNC to start your desktop of choice. If you want a GNOME desktop, the last two lines should read:</p>
<pre># twm &amp;
startx &amp;</pre>
<p>If you prefer a KDE desktop, they should read:</p>
<pre># twm &amp;
startkde &amp;</pre>
<h3>Step 4: Start the VNC Server Service</h3>
<p>To start and stop services, you&#8217;ll need to be logged in as root. Make sure any previous instance of vncserver service is stopped by typing:</p>
<pre>service vncserver stop</pre>
<p>It&#8217;s OK if you get a <strong>FAILED</strong> message in reply. That just means that the server wasn&#8217;t running.</p>
<p>Start the service with all the settings you&#8217;ve entered with:</p>
<pre>service vncserver start</pre>
<p>You should get a success message that says something like:</p>
<pre>Starting VNC server: 2:clyde
New 'server.hostname:2 (clyde)' desktop is server.hostname:2</pre>
<pre>Starting applications specified in /home/clyde/.vnc/xstartup
Log file is /home/clyde/.vnc/server.hostname:2.log</pre>
<h3>Step 5: Configure Firewall Settings</h3>
<p>If you have the Linux Firewall turned off on your Fedora 12 box, you can skip this step.</p>
<p>If you&#8217;re using the built-in firewall on your Fedora 12 box, you&#8217;ll need to tell it to allow incoming connections on the port you set up in Step 2 above. The number(s) you used in the <strong>VNCSERVERS= </strong>line(s) of the <strong>/etc/sysconfig/vncservers</strong> file determine which port numbers VNC will listen on. Our example used <strong>VNCSERVERS=&#8221;2:clyde&#8221;</strong>, which means you&#8217;d need to open port 590<strong>2</strong> in your firewall. If you set up other users and/or other ports, then you&#8217;ll need to open those as well: <strong>1</strong>=port 590<strong>1</strong>, <strong>2</strong>= port 590<strong>2</strong>, <strong>3</strong>=port 590<strong>3</strong>, etc.</p>
<p>To add the appropriate port(s) to your firewall, edit the <strong>/etc/sysconfig/iptables </strong>file and add the following line:</p>
<pre> -A INPUT -m state --state NEW -m tcp -p tcp --dport 5902 -j ACCEPT</pre>
<p>If you&#8217;re using additional ports for VNC, add a separate line for each.</p>
<p>The following line should already appear somewhere in your <strong>/etc/sysconfig/iptables file</strong>, but if it isn&#8217;t there for some reason, now is a good time to add it so you can connect to your VNC server securely in a later step:</p>
<pre>-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT</pre>
<p>Once you&#8217;ve added the appropriate line(s), restart your firewall with:</p>
<pre>service iptables restart</pre>
<h3>Step 6: Configure Router Port Forwarding</h3>
<p>If your network lives behind a router (and most home-based broadband users&#8217; networks do), and you only want to access your Fedora 12 desktop from inside the same local network, then you don&#8217;t need to mess with port forwarding on your router and can skip to the next step.</p>
<p>If the <strong>only </strong>way you plan on connecting to your Fedora 12 desktop over the Internet is via a secure SSH tunnel (which is what I recommend), then you&#8217;ll need to verify that you&#8217;ve properly forwarded port 22 (the default SSH port) on your router to the internal IP address of your Fedora 12 box. If you&#8217;re able to SSH into your Fedora 12 box from outside your router, then you&#8217;ve already got things forwarded properly. Check your router&#8217;s instructions (or the instructions for your router&#8217;s firmware if you&#8217;re using something like <a target="_blank" href="http://www.dd-wrt.com/" target="_blank">DD-WRT</a> or <a target="_blank" href="http://www.polarcloud.com/tomato/" target="_blank">Tomato</a>) on how to set up port forwarding.</p>
<p>If you would like to connect to your Fedora 12 desktop over the Internet <strong>without</strong> a secure SSH tunnel (and I would recommend doing this <strong>only for testing and troubleshooting purposes</strong> and only when first getting things set up), then you&#8217;ll need to forward the appropriate VNC port(s) from your router to your Fedora 12 box (we used port 5902 in our example). Again, this is recomended only for testing purposes, as it is not a secure connection.</p>
<h3>Step 7: Install a VNC Client on Windows</h3>
<p>Because it&#8217;s lightweight, stable, supports the secure connection we&#8217;ll be setting up in a minute, and completely <strong>FREE</strong>, I recommend <strong>TightVNC</strong> client, which can be downloaded <a target="_blank" href="http://www.tightvnc.com/" target="_blank">here</a>. But there are many other good VNC clients available out there, including <a target="_blank" href="http://www.realvnc.com/" target="_blank">RealVNC</a>, and an interesting one called <a target="_blank" href="http://www.codeplex.com/Terminals" target="_blank">Terminals</a>, which allows you to set up multiple tabs in one application with both Windows RDC and Linux VNC connections, kind of like tabs in your Web browser.</p>
<p>So download and install the VNC client of your choice.</p>
<h3>Step 8: Connect to your VNC Server</h3>
<p>Open your VNC client and connect to the appropriate IP address of your Fedora 12 box and the port that you chose in /etc/sysconfig/vncservers.</p>
<p>If you&#8217;re connecting from inside your network and the IP address of your Fedora 12 box is 192.168.1.100, then to connect to port #2 as in our example, you&#8217;d connect to <strong>192.168.1.100:5902</strong>.</p>
<p>If you&#8217;re connecting from outside your nework and want to connect to port #2 as in our example, then use your WAN IP and VNC port instead, as in <strong>222.33.444.55:5902</strong>.</p>
<p>You&#8217;ll be prompted for the VNC password you set up in an earlier step, and the desktop you configured in <strong>/home/<em>username</em>/.vnc/xstartup</strong> should display.</p>
<p>If you are unable to connect, go back and carefully re-check each step. It&#8217;s probably a very simple typo or a small thing you forgot.</p>
<h3>Step 9: Connect to your VNC Server with SSH Tunneling</h3>
<p>Now that you know your VNC server is running properly, it&#8217;s time to secure things. This isn&#8217;t necessary when connecting to your Fedora 12 box via VNC inside a trusted network. But if you want to connect over the Internet, you really should take this extra step, which will only take a couple of minutes to configure.</p>
<p>First, you&#8217;ll need a Windows SSH client. I use <a target="_blank" href="http://www.vandyke.com/products/securecrt/" target="_blank">SecureCRT </a>(which is a commercial app with a free trial period), but you can also do it easily with a very popular freeware Windows SSH client called <a target="_blank" rel="nofollow" href="http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html" target="_blank">PuTTY</a>.</p>
<p>The idea behind SSH tunneling is to establish a secure SSH connection between your Windows box and the remote Fedora 12 box, and then &#8220;tunnel&#8221; the VNC connection through your SSH connection. Don&#8217;t worry&#8230; it&#8217;s much easier than it sounds.</p>
<p>In SecureCRT: create a new connection to the IP address or hostname of your remote Fedora 12 box (or the external IP address of the router if you&#8217;re connecting from outside the local network). Under the <strong>Connection</strong> category, set the protocol to <strong>SSH2</strong>. In the <strong>SSH2</strong> sub-category, use port 22, and be sure to use the username on the Fedora 12 box that you configured in <strong>/etc/sysconfig/vncservers</strong> (in our example, it was clyde). In the <strong>Port Fowarding</strong> sub-category, hit <strong>Add&#8230;</strong>, enter a descriptive name for the forwarded connection (such as <strong>VNC</strong>), then put the port number that corresponds to the number you set up in <strong>/etc/sysconfig/vncservers</strong> for that username in both port fields (in our example, both would be 5902). None of the checkboxes need to be selected. Save your new connection, then click <strong>Connect</strong>. A terminal window should appear, and you&#8217;ll be prompted for your username and password. Use your Fedora account username and password (which may be different than the VNC password you set up).</p>
<p>In PuTTY: enter the IP address or hostname of your remote Fedora 12 box (or the external IP address of the router if you&#8217;re connecting from outside the local network). Click the <strong>+</strong> next to the <strong>SSH</strong> sub-category, then click <strong>Tunnels</strong>. Enter the port number that corresponds to the number you set up in <strong>/etc/sysconfig/vncservers</strong> in the <strong>Source port</strong> field (in our example, it would be 5902), then enter <strong>localhost:5902</strong> (or a different port if applicable) in the <strong>Destination </strong>field, then click on <strong>Add</strong>. Scroll up and click on the <strong>Session </strong>category. Type in a name for the session in the <strong>Saved Sessions </strong>field then press <strong>Save</strong>. Click <strong>Open </strong>to establish the connection. A terminal window should appear, and you&#8217;ll be prompted for your username and password. Use your Fedora account username and password (which may be different than the VNC password you set up).</p>
<p>You&#8217;ve essentially told your SSH client to &#8220;listen&#8221; for local connections to port 5902 on localhost (your Windows box), and then tunnel those connections over to port 5902 on the remote host (your Fedora 12 box) using your secure SSH connection.</p>
<p>Once your SSH connection is established (whether by SecureCRT, PuTTY, or some other client), open your VNC client viewer and connect to <strong>localhost:5902</strong>. The VNC client should establish the connection, prompt for the VNC password (which may not be the same as your Fedora account password), and then display the remote desktop.</p>
<h3>Step 10: Securing Things and Tidying Up</h3>
<p>To finish securing your VNC server, there are a few final steps you should take.</p>
<p>First, exit your VNC client (you can just close it), then exit your SSH tunneling session by typing <strong>exit </strong>from the command prompt. Re-connect to your Fedora 12 box with a standard (non-tunneling) SSH connection and become root. Edit the <strong>/etc/sysconfig/vncservers</strong> file and add the <strong>-localhost</strong> option to the <strong>VNCSERVERARGS</strong> line, so that it reads:</p>
<pre>VNCSERVERARGS[2]="-geometry 1024x768 -nolisten tcp -localhost"</pre>
<p>This option tells the VNC server not to accept remote connections from VNC clients without a secure tunnel.</p>
<p>Restart the VNC server with this new option by typing:</p>
<pre>service vncserver restart</pre>
<p>Next, if you forwarded port 5902 on your router (or any other ports for your VNC server) for testing purposes in Step 6 above, now would be a good time to undo that forwarding. You don&#8217;t need those ports forwarded anymore now that you&#8217;ve got SSH tunneling working. You do, however, still need the VNC ports open on your Fedora box&#8217;s firewall, so keep any <strong>/etc/sysconfig/iptables </strong>changes you made while setting up VNC.</p>
<h3>Optional Step: Starting Multiple VNC Sessions</h3>
<p>If you&#8217;d like to start multiple instances of the VNC server on your Fedora box, you can simply edit your <strong>/etc/sysconfig/vncservers</strong> file. Multiple instances are helpful if you want to allow multiple users to connect to the Fedora box via VNC. You can also set up multiple profiles for the same user, which is useful if you want to allow the same user to access the Fedora box from multiple  remote systems that may have different screen resolutions.</p>
<p>If you&#8217;d like to set up an additional user (we&#8217;ll use <strong>joe</strong> in this example), your<strong> /etc/sysconfig/vncservers</strong> file should include:</p>
<pre>VNCSERVERS="2:clyde 3:joe"</pre>
<pre>VNCSERVERARGS[2]="-geometry 1024x768 -nolisten tcp -localhost"
VNCSERVERARGS[3]="-geometry 800x600 -nolisten tcp -localhost"</pre>
<p>Notice that the <strong>VNCSERVERS= </strong>line has both users listed on the same line. This is important so that when the vncserver service starts, it will start for all users listed. Add a separate <strong>VNCSERVERARGS= </strong>line for each new user, along with whatever arguments you want. Note also that by using the #3, your VNC server will now also be listening on port 5903 for that user, so set up your firewall, tunnel, and/or VNC client appropriately to listen and/or forward all the ports you want to use.</p>
<p>If you&#8217;d like to set up multiple profiles for the same user, your<strong> /etc/sysconfig/vncservers</strong> file should include:</p>
<pre>VNCSERVERS="2:clyde 3:clyde"</pre>
<pre>VNCSERVERARGS[2]="-geometry 1024x768 -nolisten tcp -localhost"
VNCSERVERARGS[3]="-geometry 800x600 -nolisten tcp -localhost"</pre>
<p>Now when clyde connects to the VNCSERVER on port 2 5902, he&#8217;ll get 1024&#215;768 desktop. If he connects on port 5903, he&#8217;ll get a <strong>separate</strong> login instance on a <strong>separate</strong> desktop at 800&#215;600. It&#8217;s possible to be connected to both ports at the same time, and have two different desktops running.</p>
<p>Be sure to do a <strong>service vncserver restart</strong> after making any changes to <strong>/etc/sysconfic/vncservers</strong>. You should see output from <strong>all</strong> instances being started, such as:</p>
<pre>Starting VNC server: 2:clyde
New 'server.hostname:2 (clyde)' desktop is server.hostname:2</pre>
<pre>Starting applications specified in /home/clyde/.vnc/xstartup
Log file is /home/clyde/.vnc/server.hostname:2.log</pre>
<pre>3:clyde
New 'server.hostname:3 (clyde)' desktop is server.hostname:3</pre>
<pre>Starting applications specified in /home/clyde/.vnc/xstartup
Log file is /home/clyde/.vnc/server.hostname:3.log</pre>
<p><strong>Congratulations!</strong></p>
<p>You&#8217;ve successfully set up your remote Fedora box to accept VNC connections securely. Enjoy your new Windows to Fedora 12 VNC connection!</p>
<p>(To give credit where credit is due, <a target="_blank" href="http://www.techotopia.com/index.php/Remote_Access_to_the_Fedora_Linux_Desktop" target="_blank">this article</a> was very helpful when I was trying to set up VNC on my system for the first time)</p>
<p><strong>UPDATE</strong>: If you&#8217;re trying to set up VNC on an RHEL 5.5 or a CentOS 5.5 box, I&#8217;ve made a new <a href="http://stevejenkins.com/blog/2010/08/set-up-vnc-on-rhel-5-5-centos-5-5/" target="_blank">blog post</a> that walks you through a couple additional steps.</p>
<p>Related posts:<ol>
<li><a href='http://stevejenkins.com/blog/2010/11/how-to-set-up-vnc-from-windows-to-fedora-14-over-the-internet/' rel='bookmark' title='How to Set Up VNC from Windows to Fedora 14 Over the Internet'>How to Set Up VNC from Windows to Fedora 14 Over the Internet</a></li>
<li><a href='http://stevejenkins.com/blog/2009/12/dual-boot-windows-7-and-fedora-linux-with-dell-utility-and-recovery-partitions/' rel='bookmark' title='Dual Boot Windows 7 and Fedora 12 Linux with Dell Utility and Recovery Partitions'>Dual Boot Windows 7 and Fedora 12 Linux with Dell Utility and Recovery Partitions</a></li>
<li><a href='http://stevejenkins.com/blog/2010/08/set-up-vnc-on-rhel-5-5-centos-5-5/' rel='bookmark' title='Set up VNC on RHEL 5.5 / CentOS 5.5'>Set up VNC on RHEL 5.5 / CentOS 5.5</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://stevejenkins.com/blog/2010/03/set-up-vnc-from-windows-to-fedora-12-over-the-internet/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Dual Boot Windows 7 and Fedora 12 Linux with Dell Utility and Recovery Partitions</title>
		<link>http://stevejenkins.com/blog/2009/12/dual-boot-windows-7-and-fedora-linux-with-dell-utility-and-recovery-partitions/</link>
		<comments>http://stevejenkins.com/blog/2009/12/dual-boot-windows-7-and-fedora-linux-with-dell-utility-and-recovery-partitions/#comments</comments>
		<pubDate>Fri, 11 Dec 2009 21:29:36 +0000</pubDate>
		<dc:creator>Steve Jenkins</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Reference]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[Dell]]></category>
		<category><![CDATA[dual boot]]></category>
		<category><![CDATA[FC 12]]></category>
		<category><![CDATA[Fedora]]></category>
		<category><![CDATA[Fedora 12]]></category>
		<category><![CDATA[Fedora Core 12]]></category>
		<category><![CDATA[Win7]]></category>
		<category><![CDATA[Windows 7]]></category>

		<guid isPermaLink="false">http://stevejenkins.com/blog/?p=140</guid>
		<description><![CDATA[After successfully setting up a dual boot of Windows 7 (64-bit) and Fedora 12 on my new Dell Studio laptop, I wanted to record some of the tricks that were necessary to get it done. The laptop is a Dell Studio 1737 (why didn&#8217;t they call it 1337?) which came pre-installed with Windows Vista Home [...]
Related posts:<ol>
<li><a href='http://stevejenkins.com/blog/2010/10/how-to-configure-or-reset-a-drac-ii-easily-with-a-dos-boot-disk/' rel='bookmark' title='How to Configure or Reset a DRAC II Easily with a DOS Boot Disk'>How to Configure or Reset a DRAC II Easily with a DOS Boot Disk</a></li>
<li><a href='http://stevejenkins.com/blog/2010/01/enabling-desktop-effects-on-fedora-12-with-ati-radeon-hd-3650/' rel='bookmark' title='Enabling Desktop Effects on Fedora 12 with ATI Radeon HD 3650'>Enabling Desktop Effects on Fedora 12 with ATI Radeon HD 3650</a></li>
<li><a href='http://stevejenkins.com/blog/2010/03/set-up-vnc-from-windows-to-fedora-12-over-the-internet/' rel='bookmark' title='Set up VNC from Windows to Fedora 12 Over the Internet'>Set up VNC from Windows to Fedora 12 Over the Internet</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>After successfully setting up a dual boot of Windows 7 (64-bit) and Fedora 12 on my new Dell Studio laptop, I wanted to record some of the tricks that were necessary to get it done.</p>
<p>The laptop is a Dell Studio 1737 (why didn&#8217;t they call it 1337?) which came pre-installed with Windows Vista Home Premium. The drive is 320 GB, which Dell had pre-partitioned into three partitions:</p>
<ol>
<li>Dell Utility Partition (82 MB FAT 16-bit)</li>
<li>Dell Recovery (16 GB NTFS)</li>
<li>OS (304 GB NTFS)</li>
</ol>
<p>First, I did a full install of Windows 7 64-bit from DVD. I kept the Dell Utility and Recovery partitions intact, and installed Win7 on the OS partition.</p>
<p>After the installation was complete, I used the built-in Disk Management tool in Windows 7 to shrink the OS partition, so I could make some space for the Fedora Linux install. To do this, hit <strong>Start</strong>, right-click <strong>Computer</strong>, and select <strong>Manage</strong>. The Disk Management tool is in the Storage category. I selected the OS partition, right-clicked, and then selected <strong>Shrink Disk Volume</strong>. It took a few minutes for the system to run a query to see how much space was available for shrinking. The more fragmented your drive, the less space you have available to shrink your partition.</p>
<p>After the query, the system asked me to enter the amount of space to shrink in MB. This is the same as asking you how big you want the new unallocated space to be, which is the same as asking how much space you want to make available for your Linux installation. I chose a nice round number like 100000 (approx 100 GB), and hit <strong>Shrink</strong>.</p>
<p>It wasn&#8217;t a super-fast operation, but it took much less time than I thought it would. After the shrink, I had 105 GB of unallocated space. That&#8217;s more than enough for a comfortable Fedora 12 install, but I&#8217;m a fan of overkill. One thing that surprised me is that Win7 didn&#8217;t prompt me to reboot after the shrink!</p>
<p>Next, I popped in my Fedora 12 Live CD and rebooted (I needed to hit F12 at the BIOS post screen to tell the system to boot from the CD). Once the Fedora desktop was up, I logged in as the Live User, connected to the wireless network, and selected the <strong>Install to Disk</strong> option on the desktop. I told the installer where I wanted Linux installed (the unpartitioned space) and also checked the button that allowed me to review the partition layout. Everything was fine by default.</p>
<p>I installed the Bootloader on /dev/sda, which is the default. Keep in mind that this will overwrite the Windows bootloader, but I didn&#8217;t care. I&#8217;d rather have GRUB handle the booting, thank you. After the install was complete, I rebooted to see if everything worked.</p>
<p>I assumed that the Fedora install would recognize the Windows 7 install and automatically add it to the GRUB boot menu. I was half right. When the GRUB screen appeared and I hit the space bar to see my boot options, I had one line with FC12 and a second line that just said &#8220;Other.&#8221; Assuming that to be Windows 7, I selected it and hit ENTER. Then I got a black screen telling me that no boot manager was present, and that I needed to hit CTRL+ALT+DEL. Clearly, I&#8217;d done something wrong.</p>
<p>Not one to panic, I rebooted and selected Fedora as my operating system. I inspected the /boot/grub/menu.lst file, and saw the following:</p>
<p><code>title Fedora (2.6.31.5-127.fc12.i686)<br />
root (hd0,4)<br />
kernel /vmlinuz-2.6.31.5-127.fc12.i686 ro root=/dev/mapper/vg_studio-lv_root noiswmd LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=us rhgb quiet<br />
initrd /initramfs-2.6.31.5-127.fc12.i686.img<br />
title Other<br />
rootnoverify (hd0,0)<br />
chainloader +1</code><br />
Hmmm&#8230; I realized that GRUB might be trying to boot the Utility Partition instead of the Windows 7 OS one. To verify this, I ran the <strong>fdisk -l</strong> command as root and saw the following:</p>
<p><code>Device Boot Start End Blocks Id System<br />
/dev/sda1 1 10 80293+ de Dell Utility<br />
/dev/sda2 11 1969 15728640 7 HPFS/NTFS<br />
/dev/sda3 1969 26165 194360320 7 HPFS/NTFS<br />
/dev/sda4 26166 38913 102398310 5 Extended<br />
/dev/sda5 * 26166 26191 204800 83 Linux<br />
/dev/sda6 26191 38913 102193151+ 8e Linux LVM<br />
</code><br />
Yep! It was trying to boot Windows from /dev/sda1, which is referred to as hd(0,0) in the menu.lst file. Since zero is the first number in Linux systems, that technially means &#8220;first hard drive, first partition.&#8221; I wanted the first hard drive, but the third partition, so I edited the /boot/grub/menu.lst file so that the last three lines read:</p>
<p><code>title Microsoft Windows 7 (64-bit)<br />
rootnoverify (hd0,2)<br />
chainloader +1<br />
</code></p>
<p>This makes the title that appears on the boot screen more informative, and tells GRUB to boot from the third partition on the first hard disk.</p>
<p>One more reboot, to test, and everything worked fine! I&#8217;ve now got a Windows 7 / Fedora 12 dual-booting laptop with the Dell Utility and Recovery partitions intact!</p>
<p>Related posts:<ol>
<li><a href='http://stevejenkins.com/blog/2010/10/how-to-configure-or-reset-a-drac-ii-easily-with-a-dos-boot-disk/' rel='bookmark' title='How to Configure or Reset a DRAC II Easily with a DOS Boot Disk'>How to Configure or Reset a DRAC II Easily with a DOS Boot Disk</a></li>
<li><a href='http://stevejenkins.com/blog/2010/01/enabling-desktop-effects-on-fedora-12-with-ati-radeon-hd-3650/' rel='bookmark' title='Enabling Desktop Effects on Fedora 12 with ATI Radeon HD 3650'>Enabling Desktop Effects on Fedora 12 with ATI Radeon HD 3650</a></li>
<li><a href='http://stevejenkins.com/blog/2010/03/set-up-vnc-from-windows-to-fedora-12-over-the-internet/' rel='bookmark' title='Set up VNC from Windows to Fedora 12 Over the Internet'>Set up VNC from Windows to Fedora 12 Over the Internet</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://stevejenkins.com/blog/2009/12/dual-boot-windows-7-and-fedora-linux-with-dell-utility-and-recovery-partitions/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using apc
Page Caching using apc
Database Caching 1/53 queries in 0.022 seconds using apc
Object Caching 1207/1281 objects using apc

Served from: stevejenkins.com @ 2012-02-04 23:12:05 -->
