<?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>Racker Hacker &#187; ssh</title>
	<atom:link href="http://rackerhacker.com/tag/ssh/feed/" rel="self" type="application/rss+xml" />
	<link>http://rackerhacker.com</link>
	<description>Words of wisdom from a server administrator</description>
	<lastBuildDate>Wed, 16 May 2012 12:55:04 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>The Kerberos-hater&#039;s guide to installing Kerberos</title>
		<link>http://rackerhacker.com/2012/02/05/the-kerberos-haters-guide-to-installing-kerberos/</link>
		<comments>http://rackerhacker.com/2012/02/05/the-kerberos-haters-guide-to-installing-kerberos/#comments</comments>
		<pubDate>Sun, 05 Feb 2012 21:03:52 +0000</pubDate>
		<dc:creator>Major Hayden</dc:creator>
				<category><![CDATA[Blog Posts]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[fedora]]></category>
		<category><![CDATA[kerberos]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[nis]]></category>
		<category><![CDATA[rackspace]]></category>
		<category><![CDATA[red hat]]></category>
		<category><![CDATA[rhca]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[sysadmin]]></category>

		<guid isPermaLink="false">http://rackerhacker.com/?p=2949</guid>
		<description><![CDATA[As promised in my earlier post entitled Kerberos for haters, I've assembled the simplest possible guide to get Kerberos up an running on two CentOS 5 servers. Also, I don't really hate Kerberos. It's a bit of an inside joke with my coworkers who are studying for some of the RHCA exams at Rackspace. The [...]<p><a href="http://rackerhacker.com/2012/02/05/the-kerberos-haters-guide-to-installing-kerberos/">The Kerberos-hater's guide to installing Kerberos</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></description>
			<content:encoded><![CDATA[<p><a href="http://rackerhacker.com/wp-content/uploads/2012/02/haters_gonna_hate_elephhant.jpg"><img src="http://rackerhacker.com/wp-content/uploads/2012/02/haters_gonna_hate_elephhant-238x300.jpg" alt="Haters gonna hate - elephant" title="Haters gonna hate - elephant" width="171" height="216" class="alignright size-medium wp-image-2953" /></a>As promised in my earlier post entitled <a href="/2012/02/02/kerberos-for-haters/">Kerberos for haters</a>, I've assembled the simplest possible guide to get Kerberos up an running on two CentOS 5 servers.</p>
<p>Also, I don't really <em>hate</em> Kerberos.  It's a bit of an inside joke with my coworkers who are studying for some of the <a href="http://www.redhat.com/training/certifications/rhca/">RHCA</a> exams at Rackspace.  The additional security provided by Kerberos is quite good but the setup involves a lot of small steps.  If you miss one of the steps or if you get something done out of order, you may have to scrap the whole setup and start over unless you can make sense of the errors in the log files.  A lot of my dislikes for Kerberos comes from the number of steps required in the setup process and the difficulty in tracking down issues when they crop up.</p>
<p>To complete this guide, you'll need the following:</p>
<ul>
<li>two CentOS, Red Hat Enterprise Linux or Scientific Linux 5 servers or VM's</li>
<li>some patience</li>
</ul>
<p>Here's how I plan to name my servers:</p>
<ul>
<li><strong>kdc.example.com</strong> - the Kerberos KDC server at 192.168.250.2</li>
<li><strong>client.example.com</strong> - the Kerberos client at 192.168.250.3</li>
</ul>
<p><strong>CRITICAL STEP:</strong> Before getting started, ensure that both systems have their hostnames properly set and both systems have the hostnames and IP addresses of both systems in <code>/etc/hosts</code>.  Your server and client must be able to know the IP and hostname of the other system as well as themselves.</p>
<p>First off, we will need <a href="http://en.wikipedia.org/wiki/Network_Information_Service">NIS</a> working to serve up the user information for our client.  Install the NIS server components on the KDC server:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">[root@kdc ~]# yum install ypserv</pre></div></div>

<p>Set the NIS domain and set a static port for <code>ypserv</code> to make it easier to firewall off.  Edit <code>/etc/sysconfig/network</code> on the KDC server:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">NISDOMAINNAME=EXAMPLE.COM
YPSERV_ARGS=&quot;-p 808&quot;</pre></div></div>

<p>Manually set the NIS domain on the KDC server and add it to <code>/etc/yp.conf</code>:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">[root@kdc ~]# nisdomain EXAMPLE.COM
[root@kdc ~]# echo &quot;domain EXAMPLE.COM server kdc.example.com&quot; &gt;&gt; /etc/yp.conf</pre></div></div>

<p>Adjust <code>/var/yp/securenets</code> on the KDC server for additional security:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">[root@kdc ~]# echo &quot;255.0.0.0 127.0.0.0&quot; &gt;&gt; /var/yp/securenets
[root@kdc ~]# echo &quot;255.255.255.0 192.168.250.0&quot; &gt;&gt; /var/yp/securenets</pre></div></div>

<p>Start the NIS server and generate the NIS maps:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">[root@kdc ~]# /etc/init.d/ypserv start; chkconfig ypserv on
[root@kdc ~]# make -C /var/yp</pre></div></div>

<p>I usually like to prepare my iptables rules ahead of time so I ensure that it doesn't derail me later on.  Paste this into the KDC's terminal:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">iptables -N SERVICES
iptables -I INPUT -j SERVICES
iptables -A SERVICES -p tcp --dport 111 -j ACCEPT -m comment --comment &quot;rpc&quot;
iptables -A SERVICES -p udp --dport 111 -j ACCEPT -m comment --comment &quot;rpc&quot;
iptables -A SERVICES -p tcp --dport 808 -j ACCEPT -m comment --comment &quot;nis&quot;
iptables -A SERVICES -p udp --dport 808 -j ACCEPT -m comment --comment &quot;nis&quot;
iptables -A SERVICES -p tcp --dport 88 -j ACCEPT -m comment --comment &quot;kerberos&quot;
iptables -A SERVICES -p udp --dport 88 -j ACCEPT -m comment --comment &quot;kerberos&quot;
iptables -A SERVICES -p udp --dport 464 -j ACCEPT -m comment --comment &quot;kerberos&quot;
iptables -A SERVICES -p tcp --dport 749 -j ACCEPT -m comment --comment &quot;kerberos&quot;
/etc/init.d/iptables save</pre></div></div>

<p>We need our time in sync for Kerberos to work properly.  Install NTP on both nodes, start it, and ensure it comes up at boot time:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">[root@kdc ~]# yum -y install ntp &amp;&amp; chkconfig ntpd on &amp;&amp; /etc/init.d/ntpd start
[root@client ~]# yum -y install ntp &amp;&amp; chkconfig ntpd on &amp;&amp; /etc/init.d/ntpd start</pre></div></div>

<p>Now we're ready to set up Kerberos.  Start by installing some packages on the KDC:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">[root@kdc ~]# yum install krb5-server krb5-workstation</pre></div></div>

<p>We will need to make some edits to <code>/etc/krb5.conf</code> on the KDC to set up our KDC realm.  Ensure that the <code>default_realm</code> is set:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">default_realm = EXAMPLE.COM</pre></div></div>

<p>The <code>[realms]</code> section should look like this:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">[realms]
EXAMPLE.COM = {
	kdc = 192.168.250.2:88
	admin_server = 192.168.250.2:749
}</pre></div></div>

<p>The <code>[domain_realm]</code> section should look like this:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">[domain_realm]
kdc.example.com = EXAMPLE.COM
client.example.com = EXAMPLE.COM</pre></div></div>

<p>Add <code>validate = true</code> within the <code>pam { }</code> block of the <code>[appdefaults]</code> section:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">[appdefaults]
 pam = {
   validate = true</pre></div></div>

<p>Adjust <code>/var/kerberos/krb5kdc/kdc.conf</code> on the KDC:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">[realms]
EXAMPLE.COM = {
	master_key_type = des-hmac-sha1
	default_principal_flags = +preauth
}</pre></div></div>

<p>There's one last configuration file to edit on the KDC!  Ensure that <code>/var/kerberos/krb5kdc/kadm5.acl</code> looks like this:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">*/admin@EXAMPLE.COM	    *</pre></div></div>

<p>We're now ready to make a KDC database to hold our sensitive Kerberos data.  Create the database and set a good password which you can remember.  This command also stashes your password on the KDC so you don't have to enter it each time you start the KDC:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">kdb5_util create -r EXAMPLE.COM -s</pre></div></div>

<p>On the KDC, create a principal for the admin user as well as user1 (which we'll create shortly).  Also, export the admin details to the kadmind key tab.  You'll get some extra output after each one of these commands but I've snipped it to reduce the length of the post.</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">[root@kdc ~]# kadmin.local
kadmin.local:  addprinc root/admin
kadmin.local:  addprinc user1
kadmin.local:  ktadd -k /var/kerberos/krb5kdc/kadm5.keytab kadmin/admin
kadmin.local:  ktadd -k /var/kerberos/krb5kdc/kadm5.keytab kadmin/changepw
kadmin.local:  exit</pre></div></div>

<p>Let's start the Kerberos KDC and kadmin daemons:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">[root@kdc ~]# /etc/init.d/krb5kdc start; /etc/init.d/kadmin start
[root@kdc ~]# chkconfig krb5kdc on; chkconfig kadmin on</pre></div></div>

<p>Now that the administration work is done, let's create a principal for our KDC server and stick it in it's keytab:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">[root@kdc ~]# kadmin.local
kadmin.local:  addprinc -randkey host/kdc.example.com
kadmin.local:  ktadd host/kdc.example.com</pre></div></div>

<p>Transfer your <code>/etc/krb5.conf</code> from the KDC server to the client.  Hop onto the client server, install the Kerberos client package and add some host principals:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">[root@client ~]# yum install krb5-workstation
[root@client ~]# kadmin.local
kadmin.local:  addpinc --randkey host/client.example.com
kadmin.local:  ktadd host/kdc.example.com</pre></div></div>

<p>There aren't any daemons on the client side, so the configuration is pretty much wrapped up there for Kerberos.  However, we now need to tell both servers to use Kerberos for auth and your client servers needs to use NIS to get user data.</p>
<ul>
<li>On the KDC:
<ul>
<li>run <code>authconfig-tui</code></li>
<li>choose <b>Use Kerberos</b> from the second column</li>
<li>press <b>Next</b></li>
<li>don't edit the configuration (authconfig got the data from <code>/etc/krb.conf</code>)</li>
<li>press <b>OK</b></li>
</ul>
</li>
<li>On the client:
<ul>
<li>run <code>authconfig-tui</code></li>
<li>choose <b>Use NIS</b> and <b>Use Kerberos</b></li>
<li>press <b>Next</b></li>
<li>enter your NIS domain (EXAMPLE.COM) and NIS server (kdc.example.com or 192.168.250.2)</li>
<li>press <b>Next</b></li>
<li>don't edit the Kerberos configuration (authconfig got the data from <code>/etc/krb.conf</code>)</li>
<li>press <b>OK</b></li>
</ul>
</li>
</ul>
<p><b>Got NIS problems?</b>  If the NIS connection stalls on the client, ensure that you have the iptables rules present on the KDC that we added near the beginning of this guide.  Also, if you forgot to add <b>both</b> hosts to <b>both</b> servers' <code>/etc/hosts</code>, go do that now.</p>
<p>Let's make our test user on the KDC.  <b>Don't add this user to the client</b> -- we'll get the user information via NIS and authenticate via Kerberos shortly.  We'll also rebuild our NIS maps after adding the user:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">[root@kdc ~]# useradd user1
[root@kdc ~]# passwd user1
[root@kdc ~]# make -C /var/yp/</pre></div></div>

<p>On the client, see if you can get the password hash for the user1 account via NIS:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">[root@client ~]# ypcat -d EXAMPLE.COM -h kdc.example.com passwd | grep user1
user1:$1$sUlSTlCv$riK5El3z8N4y.mi5Fe3Q60:500:500::/home/user1:/bin/bash</pre></div></div>

<p>You can see why NIS isn't a good way to authenticate users.  Someone could easily pull the hash for any account and brute force the hash on their own server.  Go back to the KDC and lock out the user account:</p>
<pre>
[root@kdc ~]# usermod -p '!!' user1
</pre>
<p>Go back to the client and try to pull the password hash now:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">[root@client ~]# ypcat -d EXAMPLE.COM -h kdc.example.com passwd | grep user1
user1:!!:500:500::/home/user1:/bin/bash</pre></div></div>

<p>On the plus side, the user's password hash is now gone.  On the negative side, you've just prevented this user from logging in locally or via NIS. Don't worry, the user can log in via Kerberos now.  Let's prepare a home directory on the client for the user:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">[root@client ~]# mkdir /home/user1
[root@client ~]# cp -av /etc/skel/.bash* /home/user1/
[root@client ~]# chown -R user1:user1 /home/user1/</pre></div></div>

<p>Note: In a real-world scenario, you'd probably want to export this user's home directory via NFS so they didn't get a different home directory on every server.</p>
<p>While you're still on the client, try to log into the client via the user.  Use the password that you used when you created the user1 principal on the KDC.</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">[root@client ~]# ssh user1@localhost
user1@localhost's password:
[user1@client ~]$ whoami
user1</pre></div></div>

<p>List your Kerberos tickets and you should see one for your user principal:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">[user1@client ~]$ klist
Ticket cache: FILE:/tmp/krb5cc_500_fCKPnZ
Default principal: user1@EXAMPLE.COM
&nbsp;
Valid starting     Expires            Service principal
02/05/12 14:18:53  02/06/12 00:18:53  krbtgt/EXAMPLE.COM@EXAMPLE.COM
	renew until 02/05/12 14:18:53</pre></div></div>

<p>Your KDC should have a couple of lines in its <code>/var/log/krb5kdc.log</code> showing the authentication:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">Feb 05 14:18:53 kdc.example.com krb5kdc[4694](info): AS_REQ (12 etypes {18 17 16 23 1 3 2 11 10 15 12 13}) 192.168.250.3: ISSUE: authtime 1328473133, etypes {rep=16 tkt=16 ses=16}, user1@EXAMPLE.COM for krbtgt/EXAMPLE.COM@EXAMPLE.COM
Feb 05 14:18:53 kdc.example.com krb5kdc[4694](info): TGS_REQ (7 etypes {18 17 16 23 1 3 2}) 192.168.250.3: ISSUE: authtime 1328473133, etypes {rep=16 tkt=18 ses=18}, user1@EXAMPLE.COM for host/client.example.com@EXAMPLE.COM</pre></div></div>

<p>The first line shows that the client asked for a Authentication Server Request (AS_REQ) and the second line shows that the client then asked for a Ticket Granting Server Request (TGS_REQ).  In layman's terms, the client first asked for a ticket-granting ticket (TGT) so it could authenticate to other services.  When it actually tried to log in via <code>ssh</code> it asked for a ticket (and received it).</p>
<p><b>YOU JUST CONFIGURED KERBEROS!</b></p>
<p>From here, the sky's the limit.  Another popular implementation of Kerberos is encrypted NFSv4.  You can even go crazy and use <a href="http://wiki.centos.org/HowTos/HttpKerberosAuth">Kerberos with apache</a>.</p>
<p>Let me know if you have any questions about this post or if you spot any errors.  With this many steps, there's bound to be a typo or two in this guide.  Keep in mind that there are some obvious spots for network-level and service-level security improvements.  This guide was intended to give you the basics and it doesn't cover all of the security implications involved with a Kerberos implementation.</p>
<p><a href="http://rackerhacker.com/2012/02/05/the-kerberos-haters-guide-to-installing-kerberos/">The Kerberos-hater's guide to installing Kerberos</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></content:encoded>
			<wfw:commentRss>http://rackerhacker.com/2012/02/05/the-kerberos-haters-guide-to-installing-kerberos/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Kerberos for haters</title>
		<link>http://rackerhacker.com/2012/02/02/kerberos-for-haters/</link>
		<comments>http://rackerhacker.com/2012/02/02/kerberos-for-haters/#comments</comments>
		<pubDate>Fri, 03 Feb 2012 04:29:32 +0000</pubDate>
		<dc:creator>Major Hayden</dc:creator>
				<category><![CDATA[Blog Posts]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[fedora]]></category>
		<category><![CDATA[kerberos]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[red hat]]></category>
		<category><![CDATA[rhca]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://rackerhacker.com/?p=2906</guid>
		<description><![CDATA[I'll be the first one to admit that Kerberos drives me a little insane. It's a requirement for two of the exams in Red Hat's RHCA certification track and I've been forced to learn it. It provides some pretty nice security features for large server environments. You get central single sign ons, encrypted authentication, and [...]<p><a href="http://rackerhacker.com/2012/02/02/kerberos-for-haters/">Kerberos for haters</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></description>
			<content:encoded><![CDATA[<p>I'll be the first one to admit that Kerberos drives me a little insane.  It's a requirement for two of the exams in <a href="http://www.redhat.com/training/certifications/rhca/">Red Hat's RHCA certification track</a> and I've been forced to learn it.  It provides some pretty nice security features for large server environments.  You get central single sign ons, encrypted authentication, and bidirectional validation.  However, getting it configured can be a real pain due to some rather archaic commands and shells.</p>
<p>Here's Kerberos in a nutshell within a two-server environment:  One server is a Kerberos key distribution center (KDC) and the other is a Kerberos client.  The KDC has the list of users and their passwords.  Consider a situation where a user tries to ssh into the Kerberos client:</p>
<ul>
<li>sshd calls to pam to authenticate the user</li>
<li>pam calls to the KDC for a ticket granting ticket (TGT) to see if the user can authenticate</li>
<li>the KDC replies to the client with a TGT encrypted with the user's password</li>
<li>pam (on the client) tries to decrypt the TGT with the password that the user provided via ssh</li>
<li>if pam can decrypt the TGT, it knows the user is providing the right password</li>
</ul>
<p>Now that the client has a a TGT for that user, it can ask for tickets to access other network services.  What if the user who just logged in wants to access another Kerberized service in the environment?</p>
<ul>
<li>client calls the KDC and asks for a ticket to grant access to the other service</li>
<li>KDC replies with two copies of the ticket:
<ul>
<li>one copy is encrypted with the user's current TGT</li>
<li>a second copy is encrypted with the password of the network service the user wants to access</li>
</ul>
</li>
<li>the client can decrypt the ticket which was encrypted with the current TGT since it has the TGT already</li>
<li>client makes an authenticator by taking the decrypted ticket and encrypting it with a timestamp</li>
<li>client passes the authenticator and the second copy of the ticket it received from the KDC</li>
<li>the other network service decrypts the second copy of the ticket and verifies the password</li>
<li>the other network service uses the decrypted ticket to decrypt the authenticator it received from the client</li>
<li>if the timestamp looks good, the other network service allows the user access</li>
</ul>
<p>Okay, that's confusing.  Let's take it one step further.  Enabling pre-authentication requires that clients send a request containing a timestamp encrypted with the user's password prior to asking for a TGT.  Without this requirement, an attacker can ask for a TGT one time and then brute force the TGT offline.  Pre-authentication forces the client to send a timestamped request encrypted with the user's password back to the KDC before they can ask for a TGT.  This means the attacker is forced to try different passwords when encrypting the timestamp in the hopes that they'll get a TGT to work with eventually.  One would hope that you have something configured on the KDC to set off an alarm for multiple failed pre-authentication attempts.</p>
<p>Oh, but we can totally kick it up another notch.  What if an attacker is able to give a bad password to a client but they're also able to impersonate the KDC?  They could reply to the TGT request (as the KDC) with a TGT encrypted with whichever password they choose and get access to the client system.  Enabling mutual authentication stops this attack since it forces the client to ask the KDC for the client's own host principal password (this password is set when the client is configured to talk to the KDC).  The attacker shouldn't have any clue what that password is and the attack will be thwarted.</p>
<p>By this point, you're either saying "Oh man, I don't ever want to do this." or "How do I set up Kerberos?".  Stay tuned if you're in the second group.  I'll have a dead simple (or as close to dead simple as one can get with Kerberos) how-to on the blog shortly.</p>
<p>In the meantime, here are a few links for extra Kerberos bedtime reading:</p>
<ul>
<li><a href="http://en.wikipedia.org/wiki/Kerberos_(protocol)">Kerberos on Wikipedia</a></li>
<li><a href="http://www.kerberos.org/software/whykerberos.pdf">MIT's "Why Kerberos"</a> [PDF]</li>
<li><a href="http://learn-networking.com/network-security/how-kerberos-authentication-works">How Kerberos Authentication Works</a></li>
</ul>
<p><a href="http://rackerhacker.com/2012/02/02/kerberos-for-haters/">Kerberos for haters</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></content:encoded>
			<wfw:commentRss>http://rackerhacker.com/2012/02/02/kerberos-for-haters/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Receive e-mail reports for SELinux AVC denials</title>
		<link>http://rackerhacker.com/2011/09/15/receive-e-mail-reports-for-selinux-avc-denials/</link>
		<comments>http://rackerhacker.com/2011/09/15/receive-e-mail-reports-for-selinux-avc-denials/#comments</comments>
		<pubDate>Fri, 16 Sep 2011 04:17:04 +0000</pubDate>
		<dc:creator>Major Hayden</dc:creator>
				<category><![CDATA[Blog Posts]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[fedora]]></category>
		<category><![CDATA[messagebus]]></category>
		<category><![CDATA[red hat]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[selinux]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[systemd]]></category>
		<category><![CDATA[yum]]></category>

		<guid isPermaLink="false">http://rackerhacker.com/?p=2537</guid>
		<description><![CDATA[SELinux isn't a technology that's easy to tackle for newcomers. However, there's been a lot of work to smooth out the rough edges while still keeping a tight grip on what applications and users are allowed to do on a Linux system. One of the biggest efforts has been around setroubleshoot. The purpose behind setroubleshoot [...]<p><a href="http://rackerhacker.com/2011/09/15/receive-e-mail-reports-for-selinux-avc-denials/">Receive e-mail reports for SELinux AVC denials</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></description>
			<content:encoded><![CDATA[<p>SELinux isn't a technology that's easy to tackle for newcomers.  However, there's been a lot of work to smooth out the rough edges while still keeping a tight grip on what applications and users are allowed to do on a Linux system.  One of the biggest efforts has been around <a href="https://fedorahosted.org/setroubleshoot/wiki/SETroubleShoot%20Overview">setroubleshoot</a>.</p>
<p>The purpose behind setroubleshoot is to let users know when access has been denied, help them resolve it if necessary, and to reduce overall frustration while working through tight security restrictions in the default SELinux policies.  The GUI frontend for setroubleshoot is great for users who run Linux desktops or those who run servers with a display attached.  Don't worry, you can configure setroubleshoot on remote servers to send alerts elsewhere when a GUI alert isn't an option.</p>
<p>Install a few packages to get started:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">yum install setroubleshoot{-server,-plugins,-doc}</pre></div></div>

<p>Open <code>/etc/setroubleshoot/setroubleshoot.conf</code> in your favorite text editor and adjust the <code>[email]</code> section to fit your server:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">recipients_filepath = /var/lib/setroubleshoot/email_alert_recipients
smtp_port = 25
smtp_host = localhost
from_address = selinux@myserver.com
subject = [MyServer] SELinux AVC Alert</pre></div></div>

<p>You could probably see it coming, but you need to put the e-mail addresses for your recipients into <code>/var/lib/setroubleshoot/email_alert_recipients</code>:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">echo &quot;selinux@mycompany.com&quot; &gt;&gt; /var/lib/setroubleshoot/email_alert_recipients</pre></div></div>

<p>You'll notice that setroubleshoot doesn't have an init script and it doesn't exist in systemd in Fedora 15.  It runs through the <a href="http://en.wikipedia.org/wiki/D-Bus">dbus-daemon</a> and a quick bounce of the messagebus via its init script brings in the necessary components to run setroubleshoot:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">service messagebus restart</pre></div></div>

<p>A really easy (and safe) test is to ask sshd to bind to a non-standard port.  Simply define an additional port on in your <code>/etc/ssh/sshd_config</code> like this:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">Port 22
Port 222</pre></div></div>

<p>When you restart sshd, it will bind to port 22 with success, but it won't be allowed to bind to port 222 (since that's blocked by SELinux as a non-standard port for the <code>ssh_port_t</code> port type).  <strong>DON'T WORRY!</strong> Your sshd server will still be listening on port 22.  If you wait a moment, you'll get an e-mail (perhaps two) that not only notify you of the denial, but they make suggestions for how to fix it:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">SELinux is preventing /usr/sbin/sshd from name_bind access on the tcp_socket port 222.
&nbsp;
*****  Plugin bind_ports (99.5 confidence) suggests  *************************
&nbsp;
If you want to allow /usr/sbin/sshd to bind to network port 222
Then you need to modify the port type.
Do
# semanage port -a -t PORT_TYPE -p tcp 222
   where PORT_TYPE is one of the following: ...</pre></div></div>

<p>For this particular example, the quick fix would be to run:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">semanage port -a -t ssh_port_t -p tcp 222</pre></div></div>

<hr />
<em><br />
Much of this post's information was gathered from the detailed documentation on <a href="http://fedoraproject.org/wiki/Docs/Drafts/SELinux/SETroubleShoot/UserFAQ">Fedora's setroubleshoot User's FAQ</a> as well as <a href="http://danwalsh.livejournal.com/20931.html">Dan Walsh's setroubleshoot blog post</a>.<br />
</em></p>
<p><a href="http://rackerhacker.com/2011/09/15/receive-e-mail-reports-for-selinux-avc-denials/">Receive e-mail reports for SELinux AVC denials</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></content:encoded>
			<wfw:commentRss>http://rackerhacker.com/2011/09/15/receive-e-mail-reports-for-selinux-avc-denials/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Securing your ssh server</title>
		<link>http://rackerhacker.com/2010/10/12/securing-your-ssh-server/</link>
		<comments>http://rackerhacker.com/2010/10/12/securing-your-ssh-server/#comments</comments>
		<pubDate>Tue, 12 Oct 2010 22:39:15 +0000</pubDate>
		<dc:creator>Major Hayden</dc:creator>
				<category><![CDATA[Blog Posts]]></category>
		<category><![CDATA[advice]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[firewall]]></category>
		<category><![CDATA[iptables]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[sysadmin]]></category>

		<guid isPermaLink="false">http://rackerhacker.com/?p=1164</guid>
		<description><![CDATA[One of the most common questions that I see in my favorite IRC channel is: "How can I secure sshd on my server?" There's no single right answer, but most systems administrators combine multiple techniques to provide as much security as possible with the least inconvenience to the end user. Here are my favorite techniques [...]<p><a href="http://rackerhacker.com/2010/10/12/securing-your-ssh-server/">Securing your ssh server</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></description>
			<content:encoded><![CDATA[<p>One of the most common questions that I see in <a href="irc://irc.freenode.net/slicehost">my favorite IRC channel</a> is: "How can I secure sshd on my server?"  There's no single right answer, but most systems administrators combine multiple techniques to provide as much security as possible with the least inconvenience to the end user.</p>
<p>Here are my favorite techniques listed from most effective to least effective:</p>
<p><strong>SSH key pairs</strong><br />
By disabling password-based authentication and requiring ssh key pairs, you reduce the chances of compromise via a brute force attack.  This can also help you protect against weak account passwords since a valid private key is required to gain access to the server.  However, a weak account password is still a big problem if you allow your users to use sudo.</p>
<p>If you're new to using ssh keys, there are <a href="http://sial.org/howto/openssh/publickey-auth/">many</a> <a href="http://www.debian-administration.org/articles/530">great</a> <a href="http://www.linuxquestions.org/linux/answers/Networking/Public_key_authentication_with_ssh">guides</a> that can walk you through the process.</p>
<p><strong>Firewall</strong><br />
Limiting the source IP addresses that can access your server on port 22 is simple and effective.  However, if you travel on vacation often or your home IP address changes frequently, this may not be a convenient way to limit access.  Acquiring a server with trusted access through your firewall would make this method easier to use, but you'd need to <a href="http://en.wikipedia.org/wiki/Recursion">consider the security of that server as well</a>.</p>
<p>The iptables rules would look something like this:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">iptables -A INPUT -j ACCEPT -p tcp --dport 22 -s 10.0.0.20
iptables -A INPUT -j ACCEPT -p tcp --dport 22 -s 10.0.0.25
iptables -A INPUT -j DROP -p tcp --dport 22</pre></div></div>

<p><strong>Use a non-standard port</strong><br />
I'm not a big fan of <a href="http://en.wikipedia.org/wiki/Security_through_obscurity">security through obscurity</a> and it doesn't work well for ssh.  If someone is simply scanning a subnet to find ssh daemons, you might not be seen the first time.  However, if someone is targeting you specifically, changing the ssh port doesn't help at all.  They'll find your ssh banner quickly and begin their attack.</p>
<p>If you prefer this method, simply adjust the <code>Port</code> configuration parameter in your sshd_config file.</p>
<p><strong>Limit users and groups</strong><br />
If you have only certain users and groups who need ssh access to your server, setting user or group limits can help increase security.  Consider a server which needs ssh access for developers and a manager.  Adding this to to your sshd_config would allow only those users and groups to access your ssh daemon:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">AllowGroups developers
AllowUsers jsmith pjohnson asamuels</pre></div></div>

<p>Keep in mind that any users or groups not included in the sshd_config won't be able to access your ssh server.</p>
<p><strong>TCP wrappers</strong><br />
While <a href="http://en.wikipedia.org/wiki/TCP_Wrapper">TCP wrappers</a> are tried and true, I consider them to be a bit old-fashioned.  I've found that many new systems administrators may not think of TCP wrappers when they diagnose server issues and this could possibly cause delays when adjustments need to be made later.</p>
<p>If you're ready to use TCP wrappers to limit ssh connections, check out <a href="http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/5/html/Deployment_Guide/s1-tcpwrappers-access.html">Red Hat's extensive documentation</a>.</p>
<p><strong>fail2ban and denyhosts</strong><br />
For those systems administrators who want to take a bit more active stance on blocking brute force attacks, there's always <a href="http://en.wikipedia.org/wiki/Fail2ban">fail2ban</a> or <a href="http://en.wikipedia.org/wiki/DenyHosts">denyhosts</a>.  Both fail2ban and denyhosts monitor your authentication logs for repeated failures, but denyhosts can only work with your ssh daemon.  You can use fail2ban with other applications like web servers and FTP servers.</p>
<p>The only downside of using these applications is that if a valid user accidentally tries to authenticate unsuccessfully multiple times, they may be locked out for a period of time.  This could be a big problem if you're in the middle of a server emergency.</p>
<p>A quick search on Google will give you instructions on <a href="http://www.fail2ban.org/wiki/index.php/HOWTOs">fail2ban configuration</a> as well as <a href="http://denyhosts.sourceforge.net/faq.html#2_0">denyhosts configuration</a>.</p>
<p><strong>Port knocking</strong><br />
Although <a href="http://en.wikipedia.org/wiki/Port_knocking">port knocking</a> is another tried and true method to prevent unauthorized access, it can be annoying to use unless you have users who are willing to jump through additional hoops.  Port knocking involves a "knock" on an arbitrary port that then allows the ssh daemon to be exposed to the user who sent the original knock.</p>
<p><a href="http://www.linuxjournal.com/article/6811">Linux Journal</a> has a great article explaining how port knocking works and it provides some sample configurations as well.</p>
<p><strong>Conclusion</strong><br />
The best way to secure your ssh daemon is to apply more than one of these methods to your servers.  Weighing security versus convenience of access isn't an easy task and it will be different for every environment.  Regardless of the method or methods you choose, ensure that the rest of your team is comfortable with the changes and capable of adapting to them efficiently.</p>
<p><a href="http://rackerhacker.com/2010/10/12/securing-your-ssh-server/">Securing your ssh server</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></content:encoded>
			<wfw:commentRss>http://rackerhacker.com/2010/10/12/securing-your-ssh-server/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
		<item>
		<title>Crash course in dsh</title>
		<link>http://rackerhacker.com/2010/01/20/crash-course-in-dsh/</link>
		<comments>http://rackerhacker.com/2010/01/20/crash-course-in-dsh/#comments</comments>
		<pubDate>Wed, 20 Jan 2010 14:47:56 +0000</pubDate>
		<dc:creator>Major Hayden</dc:creator>
				<category><![CDATA[Blog Posts]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[dsh]]></category>
		<category><![CDATA[puppet]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[sysadmin]]></category>

		<guid isPermaLink="false">http://rackerhacker.com/?p=1133</guid>
		<description><![CDATA[Thanks to a recommendation from Michael and Florian, I've been using dsh with a lot of success for quite some time. In short, dsh is a small application which will allow you to run commands across many servers via ssh very quickly. You may be wondering: "Why not just use ssh in a for loop?" [...]<p><a href="http://rackerhacker.com/2010/01/20/crash-course-in-dsh/">Crash course in dsh</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></description>
			<content:encoded><![CDATA[<p>Thanks to a recommendation from <a href="http://twitter.com/mshuler">Michael</a> and <a href="http://twitter.com/pandemicsyn">Florian</a>, I've been using <a href="http://www.netfort.gr.jp/~dancer/software/dsh.html.en">dsh</a> with a lot of success for quite some time.  In short, dsh is a small application which will allow you to run commands across many servers via ssh very quickly.</p>
<p>You may be wondering: "Why not just use ssh in a for loop?"  Sure, you could do something like this in bash:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">for</span> i <span style="color: #000000; font-weight: bold;">in</span><span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">cat</span> ~<span style="color: #000000; font-weight: bold;">/</span>myhosts.txt<span style="color: #000000; font-weight: bold;">`</span>; <span style="color: #000000; font-weight: bold;">do</span> <span style="color: #c20cb9; font-weight: bold;">ssh</span> <span style="color: #007800;">$i</span> <span style="color: #ff0000;">'uptime'</span>; <span style="color: #000000; font-weight: bold;">done</span></pre></div></div>

<p>But dsh allows you to do this:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">dsh -g myhosts 'uptime'</pre></div></div>

<p>In addition, dsh allows you to run the commands concurrently (-c) or one after the other (-w).  You can tell it to prepend each line with the machine's name (-M) or it can omit the machine name from the output (-H).  If you need to pass extra options, such as which ssh key to use, or an alternative port, you can do that as well (-o).  All of these command line options can be tossed into a configuration file if you have a default set of options you prefer.</p>
<p>Another thing that makes dsh more powerful is the groups feature.  Let's say you have three groups of servers - some are in California, others in Texas, and still others in New York.  You could make three files for the groups:</p>
<ul>
<li>~/.dsh/group/california</li>
<li>~/.dsh/group/texas</li>
<li>~/.dsh/group/newyork</li>
</ul>
<p>Inside each file, you just need to list the hosts one after the other.  Here's the <code>~/.dsh/group/texas</code> group file:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">db1.tx.mydomain.com
db2.tx.mydomain.com
web1.tx.mydomain.com
web2.tx.mydomain.com
#web3.tx.mydomain.com</pre></div></div>

<p>As you can see, dsh handles comments in the hosts file.  In the above example, the web3 server will be skipped since it's prepended with a comment.  Let's say you want to check the uptime on all of the Texas servers as fast as possible:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">dsh -c -g texas 'uptime'</pre></div></div>

<p>That will run the <code>uptime</code> command on all of the servers in the Texas group concurrently.  If you need to run it on two groups at once, just pass another group (eg. <code>-g texas -g california</code>) as an argument.  You can also run the commands against all of your groups (-a).</p>
<p>The dsh command can really help you if you need to gather information or run simple commands on many remote servers.  If you find yourself using it often for systems management, you may want to consider something like <a href="http://reductivelabs.com/products/puppet/">puppet</a>.</p>
<p><a href="http://rackerhacker.com/2010/01/20/crash-course-in-dsh/">Crash course in dsh</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></content:encoded>
			<wfw:commentRss>http://rackerhacker.com/2010/01/20/crash-course-in-dsh/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Fix MacFusion on Snow Leopard</title>
		<link>http://rackerhacker.com/2009/08/28/fix-macfusion-on-snow-leopard/</link>
		<comments>http://rackerhacker.com/2009/08/28/fix-macfusion-on-snow-leopard/#comments</comments>
		<pubDate>Fri, 28 Aug 2009 16:21:23 +0000</pubDate>
		<dc:creator>Major Hayden</dc:creator>
				<category><![CDATA[Blog Posts]]></category>
		<category><![CDATA[ftp]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[macfusion]]></category>
		<category><![CDATA[snow leopard]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://rackerhacker.com/?p=994</guid>
		<description><![CDATA[Running OS X 10.6.3? William Fennie found a fix on Google Groups. First off, credit for this fix on OS X 10.6.2 goes to Geoff Watts from his two tweets. If you're using Snow Leopard, you'll find that the current version of MacFusion refuses to complete a connection to a remote server. You can fix [...]<p><a href="http://rackerhacker.com/2009/08/28/fix-macfusion-on-snow-leopard/">Fix MacFusion on Snow Leopard</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></description>
			<content:encoded><![CDATA[<p><strong>Running OS X 10.6.3?</strong> William Fennie <a href="http://groups.google.com/group/macfuse/browse_thread/thread/3c611784177843f0/3f02a6efd38f4b30?show_docid=3f02a6efd38f4b30">found a fix on Google Groups</a>.</p>
<p>First off, credit for this fix on <strong>OS X 10.6.2</strong> goes to <a href="https://twitter.com/geoffwatts">Geoff Watts</a> from his <a href="http://twitter.com/geoffwatts/status/3605414263">two</a> <a href="http://twitter.com/geoffwatts/status/3605464669">tweets</a>.</p>
<p>If you're using Snow Leopard, you'll find that the current version of MacFusion refuses to complete a connection to a remote server.  You can fix this in two steps:</p>
<p>First, quit MacFusion.</p>
<p>Second, open System Preferences and then open the MacFUSE pane.  Check the "Show Beta Versions" box and click "Check For Updates".  Go ahead and update MacFUSE.</p>
<p>Third, open up a terminal and do the following:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">rm /Applications/Macfusion.app/Contents/PlugIns/sshfs.mfplugin/Contents/Resources/sshnodelay.so</pre></div></div>

<p>Your MacFusion installation should now be working on Snow Leopard.  I've tested SSH and FTP connectivity so far, and they both appear to be working.  Thanks again to Geoff for the fix!</p>
<p><a href="http://rackerhacker.com/2009/08/28/fix-macfusion-on-snow-leopard/">Fix MacFusion on Snow Leopard</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></content:encoded>
			<wfw:commentRss>http://rackerhacker.com/2009/08/28/fix-macfusion-on-snow-leopard/feed/</wfw:commentRss>
		<slash:comments>143</slash:comments>
		</item>
		<item>
		<title>Simple SOCKS proxy using SSH</title>
		<link>http://rackerhacker.com/2009/05/26/simple-socks-proxy-using-ssh/</link>
		<comments>http://rackerhacker.com/2009/05/26/simple-socks-proxy-using-ssh/#comments</comments>
		<pubDate>Tue, 26 May 2009 19:29:55 +0000</pubDate>
		<dc:creator>Major Hayden</dc:creator>
				<category><![CDATA[Blog Posts]]></category>
		<category><![CDATA[proxy]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://rackerhacker.com/?p=880</guid>
		<description><![CDATA[Sometimes we find ourselves in places where we don't trust the network that we're using. I've found myself in quite a few situations where I know my data is being encrypted, but I want an additional layer of protection. Luckily, that protection is built into SSH if you'd like to use it. Create a simple [...]<p><a href="http://rackerhacker.com/2009/05/26/simple-socks-proxy-using-ssh/">Simple SOCKS proxy using SSH</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></description>
			<content:encoded><![CDATA[<p>Sometimes we find ourselves in places where we don't trust the network that we're using.  I've found myself in quite a few situations where I know my data is being encrypted, but I want an additional layer of protection.  Luckily, that protection is built into SSH if you'd like to use it.</p>
<p>Create a simple SOCKS proxy with SSH by using the <code>-D</code> flag:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">ssh -D 2400 username@some.host.com</pre></div></div>

<p>That command will open up a SOCKS proxy on your workstation on port 2400.  If you configure your application to use the local SOCKS proxy, any traffic using the proxy will be sent through an encrypted SSH connection to your remote server and out to the internet. Inbound traffic through the proxy is encrypted through the same connection.</p>
<p>You can pair that with autossh to keep your proxy connected at all times:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">autossh -f -M 20000 -D 2400 username@some.host.com -N</pre></div></div>

<p><a href="http://rackerhacker.com/2009/05/26/simple-socks-proxy-using-ssh/">Simple SOCKS proxy using SSH</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></content:encoded>
			<wfw:commentRss>http://rackerhacker.com/2009/05/26/simple-socks-proxy-using-ssh/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

