<?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>Good/Bad/Tech &#187; Security</title>
	<atom:link href="http://goodbadtech.com/category/security/feed/" rel="self" type="application/rss+xml" />
	<link>http://goodbadtech.com</link>
	<description>Just another WordPress site</description>
	<lastBuildDate>Fri, 15 Jul 2011 18:33:18 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>Certificate drop down menu empty when trying to select SSL certificate to enable SQL Server 2008 client encryption</title>
		<link>http://goodbadtech.com/2011/07/15/sql-encryption/#utm_source=feed&#038;utm_medium=feed&#038;utm_campaign=feed</link>
		<comments>http://goodbadtech.com/2011/07/15/sql-encryption/#comments</comments>
		<pubDate>Fri, 15 Jul 2011 18:28:18 +0000</pubDate>
		<dc:creator>gbt</dc:creator>
				<category><![CDATA[Databases]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Encryption]]></category>
		<category><![CDATA[microsoft]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL Server 2008]]></category>
		<category><![CDATA[SSL]]></category>

		<guid isPermaLink="false">http://goodbadtech.com/?p=237</guid>
		<description><![CDATA[I recently was trying to enable SSL encryption on my SQL  2008 R2 server to allow a remote client web site application to connect securely.  I started searching the web for blogs, forums, and technet articles that would explain how to do this since I&#8217;ve never done it.  This blog post will not cover how [...]]]></description>
			<content:encoded><![CDATA[<p>I recently was trying to enable SSL encryption on my SQL  2008 R2 server to allow a remote client web site application to connect securely.  I started searching the web for blogs, forums, and technet articles that would explain how to do this since I&#8217;ve never done it.  This blog post will not cover how to set up this configuration in general, Microsoft (<a href="http://technet.microsoft.com/en-us/library/ms191192.aspx" target="_blank">http://technet.microsoft.com/en-us/library/ms191192.aspx</a>) and others have good documentation on this.  The scenario I was having was that even after I had created a certificate, the drop down menu within the SQL Server Configuration Manager for the protocols properties was empty.  I believed I had a couple things working against me that maybe are affecting you as well if you&#8217;re reading this.</p>
<ol>
<li>My SQL server was in a domain that had the Certification Authority role installed, but only partially configured, and the web services portion of the role was not installed.  This limited my ability to create the proper certificate in the first place.</li>
<li>I am not using a SQL cluster, and many of the blog posts and forum threads I read were focused on resolving the empty drop down menu in a cluster environment.</li>
</ol>
<p>For me, this is what worked:</p>
<h3>1. Create the certificate request on the SQL server</h3>
<ul>
<li>Open the MMC console and add the Certificates snap-in for the Local Computer (read the MS technet article above on this for more background)</li>
<li>Right-click the Personal folder and select All Tasks -&gt; Advanced Operations -&gt; Create Custom Request, then click next on the first screen of the enrollment wizard</li>
<li>Select &#8220;Proceed without enrollment policy&#8221; under the custom request section and click Next</li>
<li>Select &#8220;No Template&#8221; Legacy Key under the template drop down, leave other values as default and click Next</li>
<li>On the next screen, click the little down arrow Details button to expand an additional properties window, then click Properties<br />
<a href="http://goodbadtech.com/wp-content/uploads/2011/07/SQLSSL_1.jpg#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed"><img class="alignnone size-medium wp-image-238" title="SQLSSL_1" src="http://goodbadtech.com/wp-content/uploads/2011/07/SQLSSL_1-300x209.jpg" alt="" width="300" height="209" /></a> <a href="http://goodbadtech.com/wp-content/uploads/2011/07/SQLSSL_2.jpg#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed"><img class="alignnone size-medium wp-image-239" title="SQLSSL_2" src="http://goodbadtech.com/wp-content/uploads/2011/07/SQLSSL_2-300x207.jpg" alt="" width="300" height="207" /></a></li>
<li>Type in the friendly name as the fully qualified host name, for me, this seemed to even require including proper capitalization because my server name was SRVSQL01.domain.loc, so that is that I used.  I left description blank<br />
<a href="http://goodbadtech.com/wp-content/uploads/2011/07/SQLSSL_3.jpg#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed"><img class="alignnone size-medium wp-image-240" title="SQLSSL_3" src="http://goodbadtech.com/wp-content/uploads/2011/07/SQLSSL_3-300x266.jpg" alt="" width="300" height="266" /></a></li>
<li>On the Subject Tab, I added the values in the screenshot below.<br />
<a href="http://goodbadtech.com/wp-content/uploads/2011/07/SQLSSL_4.jpg#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed"><img class="alignnone size-medium wp-image-241" title="SQLSSL_4" src="http://goodbadtech.com/wp-content/uploads/2011/07/SQLSSL_4-300x269.jpg" alt="" width="300" height="269" /></a></li>
<li>On the Extensions Tab, I added &#8220;Key encipherment&#8221;  under the Key Usage setting box, and &#8220;Server Authentication&#8221; and &#8220;Client Authentication&#8221; under the Extended Key Usage (application policies) settings box.<br />
<a href="http://goodbadtech.com/wp-content/uploads/2011/07/SQLSSL_5.jpg#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed"><img class="alignnone size-medium wp-image-242" title="SQLSSL_5" src="http://goodbadtech.com/wp-content/uploads/2011/07/SQLSSL_5-300x247.jpg" alt="" width="300" height="247" /></a> <a href="http://goodbadtech.com/wp-content/uploads/2011/07/SQLSSL_6.jpg#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed"><img class="alignnone size-medium wp-image-243" title="SQLSSL_6" src="http://goodbadtech.com/wp-content/uploads/2011/07/SQLSSL_6-300x245.jpg" alt="" width="300" height="245" /></a></li>
<li>On the private key tab, under key type, I changed the value from Exchange to Signature.<br />
<a href="http://goodbadtech.com/wp-content/uploads/2011/07/SQLSSL_7.jpg#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed"><img class="alignnone size-medium wp-image-244" title="SQLSSL_7" src="http://goodbadtech.com/wp-content/uploads/2011/07/SQLSSL_7-300x248.jpg" alt="" width="300" height="248" /></a></li>
<li>Finally, click OK, then click Next back in the Enrollment Wizard window.</li>
<li>Enter a file name and click Finish.<br />
<a href="http://goodbadtech.com/wp-content/uploads/2011/07/SQLSSL_8.jpg#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed"><img class="alignnone size-medium wp-image-245" title="SQLSSL_8" src="http://goodbadtech.com/wp-content/uploads/2011/07/SQLSSL_8-300x211.jpg" alt="" width="300" height="211" /></a></li>
</ul>
<h3>2. Process the CSR on your Certificate Server</h3>
<p>I won&#8217;t go into detail here, but you need to copy the file you created to your Certificate Authority server, process and approve the request, then export the binary key file of the certificate.  Then copy that exported binary file back to your SQL server.</p>
<h3>3. Import the certificate into the local certificate store</h3>
<p>Back in your MMC console and Certificates snap-in, you can now right-click on the Personal folder again and select Import.  Complete the import wizard using your recently created binary export of the cerficate and the new cert should now show up in the certificates folder under Personal in the Certificates snap-in.</p>
<p>One last step here, and<strong> its and important one</strong>, on the certificate itself, right-click on the cert name, and select All Tasks -&gt; &#8220;Manage Private Keys&#8230;&#8221;, then give the user the SQLSERVER service runs as Read permission in the security tab.</p>
<h3>4. Tell SQL Server which certificate to use</h3>
<p>Now, when you follow Microsoft&#8217;s instructions and you open the properties of the protocols instance for your SQL Server and view the Certificates tab, you should see the new certificate in the drop down menu! Select the certificate here, click OK, then restart the SQL service.  Clients can now use the encrypted connection and you won&#8217;t see errors like, &#8220;SSL Provider, error: 0 &#8211; The certificate&#8217;s CN name does not match the passed value&#8221;</p>
<p>I hope this saves some of you some time, I spent the better part of 3 days working on this.  I went through the whole process many times, and for me, I believe the biggest change I made was changing the Exchange key type to Signature.  I don&#8217;t know for sure if this is true, but that&#8217;s what I&#8217;m thinking.  In the comments below, let me know if the process works for you or if you have any questions I&#8217;ll be glad to help where I can.</p>
]]></content:encoded>
			<wfw:commentRss>http://goodbadtech.com/2011/07/15/sql-encryption/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Private web browsing using SSH tunnel and SOCKS v5 proxy (Mac or Windows)</title>
		<link>http://goodbadtech.com/2010/01/05/private-web-browsing-using-ssh-tunnel-and-socks5-proxy/#utm_source=feed&#038;utm_medium=feed&#038;utm_campaign=feed</link>
		<comments>http://goodbadtech.com/2010/01/05/private-web-browsing-using-ssh-tunnel-and-socks5-proxy/#comments</comments>
		<pubDate>Tue, 05 Jan 2010 14:43:54 +0000</pubDate>
		<dc:creator>goodbadtech</dc:creator>
				<category><![CDATA[Infrastructure]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Virtualization]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[DNS]]></category>
		<category><![CDATA[Domain Names]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[SSH]]></category>
		<category><![CDATA[VMWare]]></category>

		<guid isPermaLink="false">http://goodbadtech.com/?p=195</guid>
		<description><![CDATA[It&#8217;s not that I&#8217;m doing anything I shouldn&#8217;t be doing, but sometimes I just feel more comfortable knowing my employer or the local coffee shop can&#8217;t see what web sites I&#8217;m going to on my laptop.  Also, I really love sending traffic through SSH tunnels. If you&#8217;re a user that has a desktop computer always [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s not that I&#8217;m doing anything I shouldn&#8217;t be doing, but sometimes I just feel more comfortable knowing my employer or the local coffee shop can&#8217;t see what web sites I&#8217;m going to on my laptop.  Also, I really love sending traffic through SSH tunnels.</p>
<p>If you&#8217;re a user that has a desktop computer always on at home (Mac or Windows) and you carry a laptop around, this post can help set yourself up with some private web browsing.<span id="more-195"></span></p>
<p>I&#8217;m going to cover all the different Mac &amp; Windows options here, because I know not everyone uses the same set of computers.  I hope the post doesn&#8217;t get too cluttered&#8230;</p>
<h2 style="font-size: 24px;">Home Computer Setup</h2>
<hr />To get your home computer setup you&#8217;ll need a few things.</p>
<ol>
<li>A Dynamic DNS account configured using your high speed internet account.</li>
<li>An SSH server running (this is the tricky part)</li>
<li>A properly configured home firewall</li>
</ol>
<h3>1. Dynamic DNS</h3>
<p>There are <a href="http://www.google.com/search?q=Dynamic+DNS" target="_blank">lots</a> of Dynamic DNS services out there, but my favorite is <a href="http://www.dyndns.com/" target="_blank">DynDNS.com</a>.  I&#8217;ve had an account with them for over 10 years and I don&#8217;t think they&#8217;ve ever been offline.  I use their paid <a href="http://www.dyndns.com/services/dns/custom/" target="_blank">Custom DNS</a> service because it gives me a lot of flexibility and control.</p>
<p>I&#8217;m going to leave the setup process for Dynamic DNS on your home account out of this post.  Your firewall may already have integrated support and there are lots of other pages out there to set this up.  Here are a few:</p>
<ul>
<li><a href="http://www.dyndns.com/services/dns/dyndns/howto.html" target="_blank">http://www.dyndns.com/services/dns/dyndns/howto.html</a></li>
<li><a href="http://minitutorials.com/apache/dyndns11.shtml" target="_blank">http://minitutorials.com/apache/dyndns11.shtml</a></li>
<li><a href="http://geekswithblogs.net/saifkhan/archive/2008/12/29/setup-dyndns-dynamic-dns-on-a-linksys-wrt54g-router-again.aspx" target="_blank">http://geekswithblogs.net/saifkhan/archive/2008/12/29/setup-dyndns-dynamic-dns-on-a-linksys-wrt54g-router-again.aspx</a></li>
</ul>
<p>For reference, I set my custom DNS name to, home.mydomain.com.  This is the hostname I&#8217;ll use when configuring the remote SSH tunnel.</p>
<h3>2a. An SSH Server using Mac OS X</h3>
<p>With Mac OS X as your home computer, you&#8217;re in luck, this is easy to setup.  First, I recommend creating a user account used only for SSH connections.  Open System Preferences &#8211; Accounts, click the + icon to create a new account, and name it whatever you want, something cryptic maybe, I&#8217;ll call my new user, <span style="text-decoration: underline;">goodbadtechremote2009</span>, and I recommend picking a very strong password, 8+ characters, letters, numbers, symbols, etc.</p>
<p>Next, enable remote access by opening System Preferences -&gt; Sharing.  Then click the checkbox next to &#8220;Remote Login&#8221;.  In the &#8220;Allow Access&#8221; section, change the selection to &#8220;Only these users&#8221;, and add the user you just created.</p>
<p>Last, configure your Mac to use a <a href="http://answers.vt.edu/kb/entry/1867/" target="_blank">static IP address</a>.  This can be done under System Preferences -&gt; Network.  Make note of the address you use, I&#8217;ll refer to it later as SSHIP.  Take a look at this link for additional help: <a href="http://answers.vt.edu/kb/entry/1867/" target="_blank">http://answers.vt.edu/kb/entry/1867/</a></p>
<p>That&#8217;s it on the Mac side, you&#8217;re ready to go.</p>
<h3>2b. An SSH Server using Microsoft Windows</h3>
<p>Running Windows, it&#8217;s definitely more of a challenge to get an SSH server online.  I know some people have used <a href="http://www.cygwin.com/" target="_blank">Cygwin</a>, but I think using the free <a href="http://www.vmware.com/products/server/" target="_blank">VMWare Server</a> product is a better way to go. It makes the whole process much faster, is more reliable and VMWare is just cool.</p>
<ol>
<li>So, step one, download and install <a href="http://www.vmware.com/products/server/" target="_blank">VMWare Server</a>.  VMWare provides a lot of <a href="http://pubs.vmware.com/server1/admin/wwhelp/wwhimpl/common/html/wwhelp.htm?context=admin&amp;file=install_win_vmware_server.html" target="_blank">great documentation</a> regarding how to get the product downloaded and installs, but typically you just need to download and run the installer with all the default options.</li>
<li>Reference <a href="http://goodbadtech.com/2009/05/12/using-vmware-to-install-ruby-on-a-centos5-guest/#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed" target="_blank">my post regarding installing CentOS 5</a> as a VMWare guest.  Complete the steps in the section, CentOS 5.  Make sure you choose <strong>Bridged </strong>for the type of network connection. There are also many other places that detail installing Linux operating systems in VMWare, feel free to use a different resource if you have one you prefer.</li>
<li>Login to your new Linux operating system as root
<ol>
<li>Add a new user for SSH connections and set a very strong password, let&#8217;s call the user goodbadtechremote2009<br />
<code>/usr/sbin/adduser goodbadtechremote2009</code></li>
<li>I recommend you edit /etc/ssh/sshd_config to lock access down.  Here is a sample config that I like to use.
<pre class="brush: text">Port                            22
Protocol                        2
ListenAddress                   0.0.0.0
AllowUsers                      goodbadtechremote2009
SyslogFacility                  AUTH
LogLevel                        INFO
PermitRootLogin                 no
StrictModes                     yes
RSAAuthentication               yes
PubkeyAuthentication            yes
PasswordAuthentication          yes
PermitEmptyPasswords            no
KerberosAuthentication          no
X11Forwarding                   no
PrintMotd                       yes
PrintLastLog                    yes
KeepAlive                       yes
UseLogin                        no
UsePrivilegeSeparation          no
Subsystem                       sftp            /usr/libexec/openssh/sftp-server
Banner                          /etc/issue
UseDNS                          no</pre>
</li>
<li>I also like to edit the /etc/issue file to include a simple &#8220;keep away&#8221; statement.
<pre class="brush: text">                            NOTICE TO USERS

This computer system is the private property, whether individual,
corporate or government.  It is for authorized use only. Users
(authorized or unauthorized) have no explicit or implicit
expectation of privacy.

Any or all uses of this system and all files on this system may be
intercepted, monitored, recorded, copied, audited, inspected, and
disclosed to your employer, to authorized site, government, and law
enforcement personnel, as well as authorized officials of government
agencies, both domestic and foreign.

By using this system, the user consents to such interception, monitoring,
recording, copying, auditing, inspection, and disclosure at the
discretion of such personnel or officials.  Unauthorized or improper use
of this system may result in civil and criminal penalties and
administrative or disciplinary action, as appropriate. By continuing to
use this system you indicate your awareness of and consent to these terms
and conditions of use. LOG OFF IMMEDIATELY if you do not agree to the
conditions stated in this warning.</pre>
</li>
<li>Configure a static IP address
<ol>
<li>run /sbin/ifconfig and note your current IP address and Network.</li>
<li>In CentOS, edit /etc/sysconfig/network-scripts/ifcfg-eth0, so it looks something like the text below.  Make sure to replace the IP address and Gateway with a valid address in your network.  I&#8217;ll later referece the IP address you set here as SSHIP
<pre class="brush: text">TYPE=Ethernet
DEVICE=eth0
BOOTPROTO=
IPADDR=192.168.0.10
GATEWAY=192.168.0.1
NETMASK=255.255.255.0
USERCTL=yes
IPV6INIT=no
PEERDNS=yes
ONBOOT=yes</pre>
</li>
</ol>
</li>
<li>Restart the SSH server
<pre class="brush: text">/etc/init.d/sshd restart</pre>
</li>
<li>Restart your networking
<pre class="brush: text">/etc/init.d/network restart</pre>
</li>
<li>That&#8217;s it, your Linux setup in Windows should be ready to go.</li>
</ol>
</li>
</ol>
<h3>3. Your home firewall</h3>
<p><em>Disclaimer: Open remote access to an SSH server in your home network at your own risk.   I can&#8217;t cover all the details of this setup process here and there are several security concerns to consider.   Also, your internet provider may NOT allow home servers running over the Internet. </em></p>
<p>In order to access your own computer over the Internet, you&#8217;ll need to allow remote access through your home firewall/router (you are using a firewall on your high speed connection right?).</p>
<p>I use a <a href="&lt;a href=&quot;http://www.amazon.com/gp/product/B000FDOWQK?ie=UTF8&amp;tag=phot011-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=B000FDOWQK&quot;&gt;#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed" target="_blank">LinkSys WRT300N</a> wireless router.  Most of the LinkSys, Belkin, NetGear, etc routers operate pretty much the same.  For me, I logged into the router, went into the Applications &amp; Gaming section and setup single port forwarding.</p>
<p>A little trick I use is to set the external port to 443 instead of 22 (which is the default for SSH connections) because some networks control outbound traffic and port 443 is more likely to be allowed outbound then port 22 is.  Also, if anyone were to glance at the actual traffic it would look like the HTTPS encrypted traffic they&#8217;d expect to see.</p>
<p>Make sure to set the internal port to 22, set the protocol to TCP, and enter the SSHIP address you recorded in earlier and save your settings.</p>
<p>You&#8217;re ready to setup your laptop to open the SSH tunnel.</p>
<h2 style="font-size: 24px;">Laptop Setup</h2>
<hr />On to your laptop configuration.  We&#8217;ll do Windows first this time.</p>
<h3>Windows SSH Tunnels</h3>
<ul>
<li>Download <a href="http://the.earth.li/~sgtatham/putty/latest/x86/putty.exe">putty.exe</a> and save it to your hard drive.  I usually place the executable in my Program Files directory.</li>
<li>Run PuTTY</li>
<li>We need to create a saved session for easily opening an SSH connection with all the right settings in the future
<ul>
<li>Expand the Connection section and click Data and enter goodbadtechremote2009 in teh Auto-Login username field.</li>
<li>Expand Connection-&gt;SSH and click on Tunnels</li>
<li>In the Source Port field type 1080</li>
<li>Leave the Destination field empty</li>
<li>Change the Local radio button to Dynamic</li>
<li>Click on the Session category</li>
<li>Type in the hostname you configured when setting up Dynamic DNS, home.mydomain.com, in my example</li>
<li>Make sure the connection type is SSH</li>
<li>The default port will be 22, change this to 443 if you set your home firewall up the way I did in this example.</li>
<li>In the Saved Sessions text box, type in a name for the session.  I like to use the remote hostname I&#8217;m connecting to, home.mydomain.com.</li>
<li>Click Save</li>
</ul>
</li>
<li>Test the new PuTTY session by clicking open.  If all goes right you&#8217;ll get a terminal session window that opens and it will prompt you for a password.  On your first connection attempt you may be asked to verify that you are connecting to a valid host, you can type yes to authorize the connection.</li>
<li>Shortcut tip:  Create a shortcut on your desktop to the putty.exe application.  Edit the properties of the shortcut and add some information to the target line.  Mine looks like this:
<pre class="brush: text">"C:\Program Files\SSH Client\putty.exe" -load "home.mydomain.com"</pre>
</li>
</ul>
<h3>Windows Web Browser changes</h3>
<p>This is the last step, configuring the browser.  There are a number of different ways to set this up.  I&#8217;m going to keep it simple here.  I use Internet Explorer 8 for my primary web browsing, and I downloaded and installed Firefox to use when I want use my private browsing SSH tunnel.   So here is the process for this approach:</p>
<ul>
<li>Download and install Firefox if it&#8217;s not installed already. <a href="http://www.mozilla.com/en-US/firefox/personal.html" target="_blank">http://www.mozilla.com/en-US/firefox/personal.html</a></li>
<li>Open Firefox and click on Tools -&gt; Options</li>
<li>Click the Advanced Icon at the top of the Options Window</li>
<li>Click the Network Tab</li>
<li>Click the Settings button</li>
<li>Select &#8220;Manual Proxy Configuration&#8221;</li>
<li>Under SOCKS Host, type in, 127.0.0.1</li>
<li>Set the port for SOCKS Host to 1080</li>
<li>Select the SOCKS v5 radio button</li>
<li>Click OK</li>
<li>Click OK again to close the Options window</li>
</ul>
<p>If your SSH connection is still open, you should be able to visit web pages just like you normally would, go ahead and try to visit <a href="http://goodbadtech.com#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed" target="_blank">GoodBadTech.com</a> and see if it works.</p>
<p>Now this is the real test, close your SSH tunnel by closing your PuTTY session window.  Try to go to http://goodbadtech.com again.  This time the connection should fail.  If it does, your private web browsing configuration is READY TO GO!</p>
<p>In the future, to use private browsing, open the PuTTY shortcut you configured on your desktop, then open Firefox and no body at your office or in the coffee shop or where ever will be able to detect or restrict what web sites your visiting.</p>
<h3>Mac OS SSH Tunnels</h3>
<p>This is a pretty quick process, here goes&#8230;</p>
<ol>
<li>Open your Applications folder -&gt; Utilities -&gt; Terminal</li>
<li>Type<br />
pico ~/.bash_profile</li>
<li>scroll down to the very bottom of the file</li>
<li>Add this line<br />
alias homessh=&#8221;/usr/bin/sshtunnel -D 1080 -f -C -q N  -p 443 goodbadtechremote2009@home.mydomain.com&#8221;</li>
<li>Type Ctrl+x to exit the Pico editor, type Y, to indicate you want to save the changes</li>
<li>Now at your command prompt type, <code>homessh</code>, this should connect to your home SSH server and prompt you for your password. Type in your password and your tunnel will be ready to go.  \</li>
</ol>
<h3>Mac OS Web Browser changes</h3>
<p>On my MacBook Pro, I find it works best to use the location functionality. <em>Note: This will only effect the Safari browser.  Firefox will ignore these location settings.</em></p>
<ol>
<li>I go into the Apple Menu, Select Location, then select &#8220;Network Preferences&#8221;</li>
<li>In the Location drop-down menu select &#8220;Edit Locations&#8230;&#8221;</li>
<li>Click the + icon at the bottom of the Locations menu that pops up and name your new location, &#8220;Home SSH Proxy&#8221;, click Done.</li>
<li>Back in the Network system preference, select the new &#8220;Home SSH Proxy&#8221; location<br />
<a href="http://goodbadtech.com/wp-content/uploads/2010/01/network_locations.png#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed"><img class="alignnone size-medium wp-image-223" title="network_locations" src="http://goodbadtech.com/wp-content/uploads/2010/01/network_locations-300x262.png" alt="" width="300" height="262" /></a></li>
<li>Click on the Ethernet icon</li>
<li>Click on the Advanced button</li>
<li>Click on the proxies tab</li>
<li>Click the check box next to Web Proxy (HTTP)</li>
<li>In the Web Proxy Server enter, 127.0.0.1, into the first text field and enter, 1080, into the second field.</li>
<li>Now click the check box next to Secure Web Proxy (HTTPS)</li>
<li>In the Secure Web Proxy Server enter, 127.0.0.1, into the first text field and enter, 1080, into the second field.<br />
<a href="http://goodbadtech.com/wp-content/uploads/2010/01/network_proxies.png#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed"><img class="alignnone size-medium wp-image-224" title="network_proxies" src="http://goodbadtech.com/wp-content/uploads/2010/01/network_proxies-300x234.png" alt="" width="300" height="234" /></a></li>
<li>Click OK</li>
<li>Repeat steps 6-12 for your AirPort connection</li>
</ol>
<p>That should be everything.  Just as in the Windows setup, if your SSH connection is still open and your location is set to Home SSH Tunnel, you should be able to visit web pages just like you normally would, go ahead and try to visit <a href="http://goodbadtech.com#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed" target="_blank">GoodBadTech.com</a> and see if it works.</p>
<p>Now this is the real test, close your SSH tunnel by typing exit in your terminal window.  Try to go to http://goodbadtech.com again.  This time the connection should fail.  If it does, your private web browsing configuration is READY TO GO!</p>
<p>In the future, to use private browsing, open a terminal window and type homessh, enter your ssh password, then switch your location to &#8220;Home SSH Tunnel&#8221;.  Make sure to switch back to your normal network location when you&#8217;re done.</p>
<hr />Everything in this post may seem elaborate and confusing, and I admit, it kind of is.  But once everything is setup, it&#8217;s very easy to open a connection and start your private web browsing.  Going through this whole setup process will also help your general network understanding a lot, so it&#8217;s a good exercise for anyone looking to increase their networking skills.</p>
<p><span style="text-decoration: underline;">Additional Reading</span></p>
<ul>
<li><a href="http://sial.org/howto/openssh/publickey-auth/" target="_blank">Read the Public Key Setup section on Public Key Authentication</a></li>
</ul>
<p>As always, feel free to post any questions in the comments below.</p>
]]></content:encoded>
			<wfw:commentRss>http://goodbadtech.com/2010/01/05/private-web-browsing-using-ssh-tunnel-and-socks5-proxy/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>iPhone Email Error: Exchange account verification failed</title>
		<link>http://goodbadtech.com/2009/11/06/iphone-account-verification-failed/#utm_source=feed&#038;utm_medium=feed&#038;utm_campaign=feed</link>
		<comments>http://goodbadtech.com/2009/11/06/iphone-account-verification-failed/#comments</comments>
		<pubDate>Fri, 06 Nov 2009 20:42:17 +0000</pubDate>
		<dc:creator>goodbadtech</dc:creator>
				<category><![CDATA[Infrastructure]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[ActiveSync]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Microsoft Exchange]]></category>
		<category><![CDATA[Microsoft Windows]]></category>

		<guid isPermaLink="false">http://goodbadtech.com/?p=200</guid>
		<description><![CDATA[Have you ever tried to configure an iPhone to use an Exchange email account and gotten the dreaded, &#8220;Exchange account verification failed&#8221; error? Well, this recently happened for me on a Microsoft Windows 2003 SP2 server running Exchange 2007 SP1.  Here is how I resolved the error. Note: This post assumes you have a valid [...]]]></description>
			<content:encoded><![CDATA[<p>Have you ever tried to configure an iPhone to use an Exchange email account and gotten the dreaded, &#8220;Exchange account verification failed&#8221; error? Well, this recently happened for me on a Microsoft Windows 2003 SP2 server running Exchange 2007 SP1.  Here is how I resolved the error.<span id="more-200"></span><em></em></p>
<p><em>Note: This post assumes you have a valid multi-domain SSL certificate installed.  I won&#8217;t go into that process here, but if I get a few questions I can certainly do a post on that as well.</em></p>
<p>The first thing I needed to do was run some tests on the local IIS server that provides my Exchange services.  In my case, Exchange and IIS were running on the same server, so I logged in to the server, opened Internet Explorer and typed in:</p>
<p>https://&lt;Servername&gt;/Microsoft-Server-Activesync</p>
<p>You should be prompted for credentials using basic authentication, then you should see an &#8220;HTTP 501 Not Implemented/HTTP 505 Version Not Supported Error&#8221;</p>
<p><a href="http://goodbadtech.com/wp-content/uploads/2009/11/501.JPG#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed"><img class="alignnone size-medium wp-image-201" title="501" src="http://goodbadtech.com/wp-content/uploads/2009/11/501-300x101.jpg" alt="501" width="300" height="101" /></a></p>
<p>If you see this, ActiveSync itself, which the iPhone relies on for communication with Exchange, should be working correctly.  I did not see this error.  I saw an HTTP 401 file not found error. Now, with Exchange 2007, I generally try not to do a lot of troubleshooting, it&#8217;s just easier to start over and reinstall ActiveSync support.</p>
<ol>
<li>On the Exchange server, open the Exchange Management Shell, and run (this command may take a minute to output:
<pre class="brush: powershell">Get-ActiveSyncVirtualDirectory | fl</pre>
</li>
<li>Search through the text output and look for the line that starts with, <strong>Identity</strong>, copy/paste the corresponding value into notepad.  It may be something like,  SERVERNAME\Microsoft-Server-ActiveSync (Default Web Site)</li>
<li>In Exchange Management Shell, run the command
<pre class="brush: powershell">Remove-ActiveSyncVirtualDirectory</pre>
<ol>
<li>When prompted, paste in the Identity value you copied in step 2.</li>
<li>Verify that you want to remove ActiveSync</li>
</ol>
</li>
<li>Refresh your IIS Admin window to make sure the Microsoft-Server-ActiveSync virtual directory is no longer there.</li>
<li>In Exchange Management Shell, run the command
<pre class="brush: powershell">New-ActiveSyncVirtualDirectory</pre>
</li>
<li>Refresh your IIS Admin window to make sure the Microsoft-Server-ActiveSync virtual directory is back.</li>
<li>Close any open Internet Explorer windows and then access https://&lt;Servername&gt;/Microsoft-Server-Activesync again.</li>
<li>Hopefully you see the &#8220;HTTP 501 Not Implemented/HTTP 505 Version Not Supported&#8221; error now.  If you do, your iPhone should be ready to go.  This error means the correct files are there, but that your web request doesn&#8217;t include the data that ActiveSync is looking for.</li>
</ol>
<p>If you didn&#8217;t get the 501/505 error, then it&#8217;s back to the drawing board.  Post a comment below and I&#8217;ll see if I can help out.</p>
<p>Also, check out the link below, it&#8217;s a very slick troubleshooting tool from <a href="http://www.microsoft.com" target="_blank">Microsoft</a> that can be used to troubleshoot Exchange 2003/2007 servers for remote connectivity services like Autodiscover, ActiveSync, RPC over HTTP, and many other tests for Exchanged based services.  Its very easy to use and provides detailed test results regarding what works and what doesn&#8217;t.</p>
<p><a href="https://www.testexchangeconnectivity.com/" target="_blank">https://www.testexchangeconnectivity.com/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://goodbadtech.com/2009/11/06/iphone-account-verification-failed/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>What is my computer doing? pids, IP addresses, tcp, netstat, and lsof</title>
		<link>http://goodbadtech.com/2009/06/22/what-is-my-computer-doing/#utm_source=feed&#038;utm_medium=feed&#038;utm_campaign=feed</link>
		<comments>http://goodbadtech.com/2009/06/22/what-is-my-computer-doing/#comments</comments>
		<pubDate>Mon, 22 Jun 2009 15:00:58 +0000</pubDate>
		<dc:creator>goodbadtech</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[command line]]></category>

		<guid isPermaLink="false">http://goodbadtech.com/?p=152</guid>
		<description><![CDATA[Today I was reviewing the active TCP connections on my Mac Book Pro to before testing some software I was working on.  I was sitting in the office and wanting to monitor traffic to the server at my house.  Checking netstat, I saw a connection I didn&#8217;t expect to see and I had a hard [...]]]></description>
			<content:encoded><![CDATA[<p>Today I was reviewing the active TCP connections on my Mac Book Pro to before testing some software I was working on.  I was sitting in the office and wanting to monitor traffic to the server at my house.  Checking netstat, I saw a connection I didn&#8217;t expect to see and I had a hard time clearly identifying what exactly it was.  As I was tracking it down, I figured the process might be of interest to others out there&#8230;<span id="more-152"></span></p>
<p><strong>So the question is: Who is my computer connected to and what&#8217;s it sending them?</strong></p>
<p>First I needed to know the IP address of my home internet connection.  The home web server is on a Comcast cable modem with DHCP that doesn&#8217;t change its IP address very often, but does every once in a while.  To get started I logged in to the home computer via my <a href="https://secure.logmein.com" target="_blank">LogMeIn</a> connection, opened up the web browser, and hit up <a href="http://www.whatsmyip.org" target="_blank">http://www.whatsmyip.org</a> to verify my IP address, looks like it&#8217;s 12.345.678.9 (no, that&#8217;s not actually my IP address, but I don&#8217;t want to post my real public IP for everyone to see)</p>
<p><em>Note: I actually use <a href="http://www.dyndns.com/" target="_blank">DynDNS</a> to keep track of my home IP address, the whatsmyip.org method is just a little faster if you don&#8217;t already have <a href="http://en.wikipedia.org/wiki/Dynamic_DNS" target="_blank">Dynamic DNS</a> running somewhere.</em></p>
<p>With my remote IP address in hand, I was ready to check out what connections were active.</p>
<p>Open up your Terminal application (Applications -&gt; Utilitys -&gt; Terminal.app) and run,</p>
<p><code>netstat -napt</code></p>
<p>Here is what returned:</p>
<p><code>[goodbadtech@tim:~]$ netstat -napt<br />
netstat: t: unknown or uninstrumented protocol</code></p>
<p>Oh right, that&#8217;s the Linux <a href="http://en.wikipedia.org/wiki/Netstat" target="_blank">netstat</a> syntax, it lists all active TCP connections, their process ID, and turns off DNS translations so just the IP address shows up</p>
<p>To get the same output in Mac OS I had to change the syntax a bit:</p>
<p><code>netstat -na -p tcp</code></p>
<p>The results this time where much better.  I needed to narrow the results down, 46 TCP connections where too many to scan through.</p>
<p><code>netstat -na -p tcp | grep 12.345.678.9</code></p>
<p>Running this command which only outputs connections that contain the IP address I specified, I expected to see an empty result, because I wasn&#8217;t aware of any active connections to my home network.  However, this is what I saw:</p>
<p><code>tcp4       0      0  10.1.1.110.50994       12.345.678.9.4242        ESTABLISHED</code></p>
<p>The destination port was a little suspicious to me, 4242.  I had no idea what the connection was.  I also noticed something else, no process ID was listed.  I forgot about that too.  I&#8217;m so used to the Linux version of netstat including PID information, I forget that Mac OS doesn&#8217;t include PID.</p>
<p>So how to I find the PID of a TCP connection on a Mac?  Here we turn to <a href="http://www.manpagez.com/man/8/lsof" target="_blank">lsof</a>.  Note, lsof requires root permission, so we&#8217;ll be running the commend with <a href="http://en.wikipedia.org/wiki/Sudo" target="_blank">sudo</a></p>
<p><code>sudo lsof -i -Pn</code></p>
<p>-i limits the results to files with Internet connections active<br />
-Pn turns off reverse port and IP address translation which just speeds the results up a bit</p>
<p>Now we&#8217;re getting somewhere, expect the list of files returned is still large, 145, and I don&#8217;t like to look through so many lines, so let&#8217;s get grep involved again to help filter the results</p>
<p><code>sudo lsof -i -Pn | grep 12.345.678.9</code></p>
<p>And the one line I was looking for was displayed</p>
<p><code>java       6756           root   70u  IPv4  0x8c3ce64      0t0    TCP 10.1.1.110:50994-&gt;12.345.678.9:4242 (ESTABLISHED)</code></p>
<p>Okay, process ID 6756, good, that&#8217;s the info I was looking for.  However, I saw the process name was java.  Great, that could be anything.  Why in the world was a java process started by root connected to my home computer network?  We go back to lsof to find the answer.  (That sentence makes me think I&#8217;ve been watching too much History channel lately)</p>
<p><code>sudo lsof -p 6756</code></p>
<p>-p the lower case p limits results to open files in use by process ID 6756.</p>
<p>With a 122 lines returned I saw there was plenty of activity, fortunately, I quickly saw exactly what was going on.</p>
<p><code>java    6756 root   51u     REG       14,2        44   5116740 /Library/Caches/CrashPlan/cpft366842740763787782x</code></p>
<p>There were many lines output similar to this one, so I don&#8217;t need to include the whole output here, the point is, the line segment /Library/Caches/CrashPlan, tells me that CrashPlan had created the connection.  Okay, I&#8217;m cool with that.  I hope you found this useful.  Send me a message on Twitter <a href="http://twitter.com/goodbadtech" target="_blank">@goodbadtech</a> if you have any questions.  Back to my original software testing&#8230;</p>
<p><em>Notes:</em></p>
<p><em>A quick editorial on <a href="http://www.crashplan.com" target="_blank">CrashPlan</a>, its very slick backup software, especially for those of you that have multiple computers in different locations.  The basic concept is, you backup for your office and your office backs up to your house.  Make sure you at least check out the link.</em></p>
<p><em>netstat and lsof are great utilities to get familiar with.  If your computer is running slow or you want to check connections on your web server, they should come to mind right away.  One of my favorites on a Linux web server will list all established connections to your web server (assuming you&#8217;re running Apache)</em></p>
<p><code><em>netstat -atp | grep httpd | grep ESTABLISHED</em></code></p>
<p><em>This will count all the established connections to your web server and output the value</em></p>
<p><code><em>netstat -atp | grep httpd | grep ESTABLISHED | wc -l</em></code></p>
<p><em>Here is a great post of netstat commands to try out if you&#8217;re looking for some additional reading.</em></p>
<p><em><a href="http://www.mydigitallife.info/2007/12/13/how-to-find-and-check-number-of-connections-to-a-server/" target="_blank">http://www.mydigitallife.info/2007/12/13/how-to-find-and-check-number-of-connections-to-a-server</a><br />
</em></p>
<p><em><br />
</em></p>
]]></content:encoded>
			<wfw:commentRss>http://goodbadtech.com/2009/06/22/what-is-my-computer-doing/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>SSL Certs &amp; OWA on Windows mobile devices</title>
		<link>http://goodbadtech.com/2009/05/14/ssl-certs-owa-on-windows-mobile-devices/#utm_source=feed&#038;utm_medium=feed&#038;utm_campaign=feed</link>
		<comments>http://goodbadtech.com/2009/05/14/ssl-certs-owa-on-windows-mobile-devices/#comments</comments>
		<pubDate>Thu, 14 May 2009 15:28:22 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Mobile]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[GoDaddy]]></category>
		<category><![CDATA[OWA]]></category>
		<category><![CDATA[SSL]]></category>
		<category><![CDATA[Windows Mobile]]></category>

		<guid isPermaLink="false">http://goodbadtech.com/?p=41</guid>
		<description><![CDATA[This is something I come across every now and then.  If someone has an SSL cert on their OWA/Outlook Anywhere server that issued by someone like GoDaddy, they may not be able to access their account from an older phone.]]></description>
			<content:encoded><![CDATA[<p>This is something I come across every now and then.  If someone has an SSL cert on their OWA/Outlook Anywhere server that issued by someone like <a href="http://godaddy.com" target="_blank">GoDaddy</a>, they may not be able to access their account from an older phone.  The notes below are pretty much pulled from GoDaddy&#8217;s document on how to setup the phone correclty.  There are similar instructions for other certificate authorities as well, if you&#8217;re having problems feel free to send me a message <a href="http://twitter.com/goodbadtech" target="_blank">@goodbadtech</a> and I&#8217;ll see if I can help out.<span id="more-41"></span></p>
<p>GoDaddy &#8217;s Valicert root  certificate is installed on all mobile devices that run Windows Mobile 5.0 AKU 2  or a later incarnation of the operating system. However, devices that run older  versions of Windows Mobile 5.0 do not have the Go Daddy root installed.</p>
<p>To check if the Go Daddy root is installed on your device, please visit  the root store on your device:</p>
<ul>
<li>Open the &#8220;Settings&#8221; menu.</li>
<li>Select &#8220;System.&#8221;</li>
<li>Select &#8220;Certificates.&#8221;</li>
<li>Verify that the &#8220;http://www.valicert.com&#8221; is listed in the root store.</li>
<li>If the root is included, your device is running Windows Mobile 5 AKU 2 or  later. No further action is required.</li>
<li>If the root is <em>not</em> included, follow the instructions below to  import and install it.</li>
</ul>
<p style="margin-top: 0px; margin-bottom: 0px;">To install the root certificate  on your Windows Mobile 5 device:</p>
<ul>
<li>Download the root certificate to your PC in DER format with a .cer file  extension (i.e., valicert_class2_root.cer&#8221;). The root can be downloaded from the  Go Daddy <a href="https://certs.godaddy.com/Repository.go#root_der">repository</a>.</li>
<li>Copy the downloaded root certificate to your device using ActiveSync.</li>
<li>On your mobile device, locate the imported file using File Explorer and  click on it.</li>
<li>The device will display the following prompt: &#8220;You are about to install  valicert_class2_root.cer certificate issued by http://www.valicert.com/. Do you  want to continue?&#8221; (If you saved the root under a different name, that file name  will show up in the prompt.)</li>
<li>Accept the prompt to install the root certificate on your device.</li>
</ul>
<p><a href="https://certs.godaddy.com/InstallationInstructions_alt.go">https://certs.godaddy.com/InstallationInstructions_alt.go</a></p>
]]></content:encoded>
			<wfw:commentRss>http://goodbadtech.com/2009/05/14/ssl-certs-owa-on-windows-mobile-devices/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

