<?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>techNerdia - Web Development Tips &#187; security</title> <atom:link href="http://technerdia.com/tag/security/feed" rel="self" type="application/rss+xml" /><link>http://technerdia.com</link> <description>Web Development Tips, Tricks and Ideas</description> <lastBuildDate>Mon, 07 May 2012 16:46:34 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <item><title>WP Function that protects your wp-login.php with PHP Auth [UPDATED]</title><link>http://technerdia.com/313_wp-login-protection.html</link> <comments>http://technerdia.com/313_wp-login-protection.html#comments</comments> <pubDate>Mon, 21 Mar 2011 14:15:29 +0000</pubDate> <dc:creator>tribalNerd</dc:creator> <category><![CDATA[Security]]></category> <category><![CDATA[Wordpress]]></category> <category><![CDATA[function]]></category> <category><![CDATA[htaccess]]></category> <category><![CDATA[php]]></category> <category><![CDATA[security]]></category> <category><![CDATA[wp]]></category> <guid
isPermaLink="false">http://technerdia.com/?p=313</guid> <description><![CDATA[A simple WP Function that password protects the wp-login.php file on Wordpress setups.<p><div
style="border-top:1px dotted #cccccc;clear:both;font-size:14px;font-weight:bold;margin:2px 10px;padding:0 10px;text-align:left;"><ul><li><b>New Wordpress Plugin</b> <a
href="http://technerdia.com/projects/adminbar/plugin.html" target="_blank">WP My Admin Bar</a> (It's Free, Download Today!)</li><li><b>Reading:</b> <a
href="http://technerdia.com/313_wp-login-protection.html">WP Function that protects your wp-login.php with PHP Auth [UPDATED]</a> <b>By:</b> <a
href="https://plus.google.com/105408082571454010152/" target="_blank">tribalNerd</a> <b>From:</b> <a
href="http://technerdia.com/" target="_blank">techNerdia - Web Development Tips</a></li><li><b><a
href="https://plus.google.com/u/0/108046225913965315594/posts" target="_blank">Follow techNerdia on Google+</a></li></ul></div><p
align="center">~ <b>Thank you for subscribing to techNerdia.com - Please Share This Post With Others</b> ~</p></p> ]]></description> <content:encoded><![CDATA[<p><img
src="http://technerdia.com/files/protect-wp-login.gif" alt="Protect Your WordPress Login Page" width="250" height="250" class="alignleft size-full wp-image-326" />The Function below adds a simple layer of security to your WordPress Websites. When anyone visits the wp-login.php page an authentication window will pop prompting the visitor to enter a Username and Password before they can access the wp-login.php file.</p><p>This is a simple protection solution for any WordPress site with Registrations turned off and for sites with very few or only one person that manages them.</p><p>Place the function below into your functions.php file for each WordPress Theme/site that you want to protect. Swap out the YOUR-USERNAME and YOUR-PASSWORD with your user/pass info, and it&#8217;s ready to go!</p><div
class="mycode"><pre name="code" class="php">
 if ( $_SERVER['PHP_SELF'] == "/wp-login.php" ) { add_action( 'init', 'login_init' ); /* Do Action */ }
function login_init() {
 $user = "YOUR-USERNAME";
 $pass = "YOUR-PASSWORD";
  get_option('get_header');
if( $_SERVER['PHP_AUTH_USER'] != $user &#038;&#038; $_SERVER['PHP_AUTH_PW'] != $pass ) {
    header("WWW-Authenticate: Basic realm=""");
    header("HTTP/1.0 401 Unauthorized");
exit;
  }
}
</pre></div><h2>Version 2</h2><p>If the above example works, but a correct username &amp; password doesn&#8217;t seem to be accepted, the issue might be that PHP can not access the PHP_AUTH_USER and PHP_AUTH_PW functions.</p><p>To correct this you&#8217;ll need use a RewriteRule.</p><h2>The RewriteRule</h2><p>Use ONE of the following RewriteRules in your Websites root .htaccess file. I do not fully understand this rule, but it appears that:</p><blockquote>The PHP_AUTH_USER and PHP_AUTH_PW functions and values of them, when entered into the auth box, is loaded into a variable called HTTP_AUTHORIZATION. The PHP afterward then gets the PHP_AUTH_USER and PHP_AUTH_PW values by accessing the HTTP_AUTHORIZATION variable.</blockquote><p>** Test your Website after adding the rewrite rule. Posts, Pages and Images will 404 if you have the incorrect one.</p><p><strong>Worked On WordPress Multisite</strong> &#8211; Put the Rule directly below <i>RewriteEngine On</i> line, within the .htaccess file of your Website.</p><div
class="mycode"><pre name="code" class="php">RewriteRule .? - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]</pre></div><p><strong>Other Possible RewriteRules</strong>: The first RewriteRule below is the most common use rule.</p><div
class="mycode"><pre name="code" class="html">RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]</pre></div><div
class="mycode"><pre name="code" class="html">RewriteEngine On
RewriteRule .* - [env=HTTP_AUTHORIZATION:%{HTTP:Authorization},last]</pre></div><div
class="mycode"><pre name="code" class="html">RewriteEngine On
RewriteRule .* - [env=HTTP_AUTHORIZATION:%{HTTP:Authorization}]</pre></div><p><strong>The Code</strong><br
/> Place the function below into your functions.php file for each WordPress Theme/site that you want to protect. Swap out the YOUR-USERNAME and YOUR-PASSWORD with your user/pass info.</p><div
class="mycode"><pre name="code" class="php">
if ( $_SERVER['PHP_SELF'] == "/wp-login.php" ) {
    add_action( 'init', 'login_init' );
}
function login_init() {
    $user = "YOUR-USERNAME";
    $pass = "YOUR-PASSWORD";
    get_option('get_header');
    list( $_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW'] ) = explode( ':', base64_decode( substr( $_SERVER['HTTP_AUTHORIZATION'], 6 ) ) );
    if ( $user == $_SERVER['PHP_AUTH_USER'] &#038;&#038; $pass == $_SERVER['PHP_AUTH_PW'] ) {
        header('WWW-Authenticate: Basic realm=""');
        header("HTTP/1.0 401 Unauthorized");
        echo '';
        exit;
    }
 }</pre></div><ul><li>You can use the same username and password for each site, however I recommend each site has at least a unique password.</li><li>Do Not use the same username and password that you use to access the WordPress Admin.</li><li>Don&#8217;t forget to sometimes change your username and passwords up.</li><li>Use Password <a
href="http://technerdia.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3RlY2huZXJkaWEuY29tLzI4NF9wYXNzd29yZC1tYW5hZ2VyLmh0bWw=">Management Software like KeePass</a> to manage your passwords.</li><li>Remember, this is simply an extra layer of security, it for sure is NOT a solid solution for protection &#8211; you should still select a very complex master username and password to access the Admin along with other WordPress Security Plugins.</li></ul><hr
/><h4>If you've enjoyed this article then please leave me some <a
href="http://technerdia.com/feedback.html" target="_blank">feedback</a>, thanks!</h4><br
/><p><div
style="border-top:1px dotted #cccccc;clear:both;font-size:14px;font-weight:bold;margin:2px 10px;padding:0 10px;text-align:left;"><ul><li><b>New WordPress Plugin</b> <a
href="http://technerdia.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3RlY2huZXJkaWEuY29tL3Byb2plY3RzL2FkbWluYmFyL3BsdWdpbi5odG1s" target=\"_blank\">WP My Admin Bar</a> (It's Free, Download Today!)</li><li><b>Reading:</b> <a
href="http://technerdia.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3RlY2huZXJkaWEuY29tLzMxM193cC1sb2dpbi1wcm90ZWN0aW9uLmh0bWw=">WP Function that protects your wp-login.php with PHP Auth [UPDATED]</a> <b>By:</b> <a
href="http://technerdia.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cHM6Ly9wbHVzLmdvb2dsZS5jb20vMTA1NDA4MDgyNTcxNDU0MDEwMTUyLw==" target=\"_blank\">tribalNerd</a> <b>From:</b> <a
href="http://technerdia.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3RlY2huZXJkaWEuY29tLw==" target=\"_blank\">techNerdia - Web Development Tips</a></li><li><b><a
href="http://technerdia.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cHM6Ly9wbHVzLmdvb2dsZS5jb20vdS8wLzEwODA0NjIyNTkxMzk2NTMxNTU5NC9wb3N0cw==" target=\"_blank\">Follow techNerdia on Google+</a></li></ul></div><p
align="center">~ <b>Thank you for subscribing to techNerdia.com - Please Share This Post With Others</b> ~</p></p> <img
src="http://technerdia.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=313" width="1" height="1" style="display: none;" />]]></content:encoded> <wfw:commentRss>http://technerdia.com/313_wp-login-protection.html/feed</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>The Best Password Manager for Windows &#8211; Mac &#8211; Linux / Ubuntu &#8211; Smart Phones and more&#8230;</title><link>http://technerdia.com/284_password-manager.html</link> <comments>http://technerdia.com/284_password-manager.html#comments</comments> <pubDate>Wed, 16 Mar 2011 22:37:52 +0000</pubDate> <dc:creator>tribalNerd</dc:creator> <category><![CDATA[Software Guides]]></category> <category><![CDATA[encryption]]></category> <category><![CDATA[manager]]></category> <category><![CDATA[passwords]]></category> <category><![CDATA[security]]></category> <guid
isPermaLink="false">http://technerdia.com/?p=284</guid> <description><![CDATA[When it comes to kick butt tools, this tool wins hands down<p><div
style="border-top:1px dotted #cccccc;clear:both;font-size:14px;font-weight:bold;margin:2px 10px;padding:0 10px;text-align:left;"><ul><li><b>New Wordpress Plugin</b> <a
href="http://technerdia.com/projects/adminbar/plugin.html" target="_blank">WP My Admin Bar</a> (It's Free, Download Today!)</li><li><b>Reading:</b> <a
href="http://technerdia.com/284_password-manager.html">The Best Password Manager for Windows &#8211; Mac &#8211; Linux / Ubuntu &#8211; Smart Phones and more&#8230;</a> <b>By:</b> <a
href="https://plus.google.com/105408082571454010152/" target="_blank">tribalNerd</a> <b>From:</b> <a
href="http://technerdia.com/" target="_blank">techNerdia - Web Development Tips</a></li><li><b><a
href="https://plus.google.com/u/0/108046225913965315594/posts" target="_blank">Follow techNerdia on Google+</a></li></ul></div><p
align="center">~ <b>Thank you for subscribing to techNerdia.com - Please Share This Post With Others</b> ~</p></p> ]]></description> <content:encoded><![CDATA[<p>When it comes to kick butt little tools, <a
href="http://technerdia.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2tlZXBhc3MuaW5mby8=" target=\"_blank\">KeePass</a> wins hands down!</p><blockquote><p>This tool has changed how I use my computer, my browsers and even how I plan for vacations.</p></blockquote><p><a
href="http://technerdia.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2tlZXBhc3MuaW5mby8=" target=\"_blank\"><img
src="http://technerdia.com/files/KeePass.gif" alt="KeePass" width="116" height="125" class="alignleft size-full wp-image-288" /></a><strong>What is KeePass?</strong> Simply, it&#8217;s a very secure password manager, that can group your passwords together for easy management. And it works on just about everything, Windows of all flavors, Smart Devices like the iPhone, Droids, BlackBerry&#8217;s, and so on&#8230; Linux/Unbuntu, Mac OS X, I&#8217;m probably missing a few. It&#8217;s light weight, simple to use, has a movable database&#8230; truly, it rocks.</p><p>Other than Google, every Password I have is no longer stored in my browser. I keep everything, from the web, ftp, shell, database and client secure details in my KeePass.</p><ul><li>I only have one password to remember, and that&#8217;s to KeePass.</li><li>I use KeePass to generate long random passwords for me.</li><li>No site, service or feature has the same password.</li></ul><h2>Downloading Keepass: <a
href="http://technerdia.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2tlZXBhc3MuaW5mby9kb3dubG9hZC5odG1s" target=\"_blank\">http://keepass.info/</a></h2><p>The options are the Classic Edition and Professional Edition. The Pro Edition requires MS .NET Framework&#8230;. I downloaded the <a
href="http://technerdia.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2tlZXBhc3MuaW5mby9kb3dubG9hZC5odG1s" target=\"_blank\">Classic Edition</a>. Choose either, or go with the Classic if you&#8217;re not sure which one to choose.</p><h2>Installing KeePass</h2><p>KeePass is portable, it doesn&#8217;t make registry changes and runs without special libraries. You can place it on a USB drive and even run it on a public machine all without installing anything.</p><h2>Setting up KeePass</h2><p>Once you run KeePass it will ask you to create a database and Composite Master Key, which I recommend doing for Security reasons. You have two things to remember here, your Master Password (so select a strong one) and the location to where you save the Database.kdb and pwsafe.key files.</p><ul><li>Be sure to backup your Database.kdb and pwsafe.key files once you&#8217;ve populated them with account details.</li><li>Your pwsafe.key file may be hidden on your Computer depending on your OS and setup. You may need to unhide important files before you can copy the key file for a backup.<li></ul><h2>Running KeePass</h2><p>Once you start KeePass, enter your Master Password and select your Key. The software can be a bit confusing at first, but a couple features cover most of your needs.</p><p>First is Groups, groups simply group your accounts/passwords together. I have groups for my clients (with sub-groups inside of it), affiliate programs, social networks, tools, forums, etc.</p><p><img
src="http://technerdia.com/files/KeePass-groups.gif" alt="KeePass Groups Example" width="296" height="72" class="aligncenter size-full wp-image-292" /></p><ul><li><strong>To create a group</strong>: Click the Edit link at the top, then select Add Group</li></ul><p><img
src="http://technerdia.com/files/KeePass-add-entry.gif" alt="KeePass Add Entry Example" width="112" height="28" class="alignright size-full wp-image-294" /> The next feature is Adding an Entry. On the main toolbar, it&#8217;s the 4th icon. If you mouse over it, it says Add Entry. Clicking Add Entry brings up a window to enter the details. Everything here is self explanatory other than maybe the Password Generator.</p><ul><li><strong>To add an entry</strong>: Click the 4th icon in the main menu (Add Entry) or access the Edit link at the top, then select Add Entry.</li></ul><p>Every new entry gets a fresh new password, click the icon to the right of the Password box to expose the password, for copying or pasting in a new password.</p><p><img
src="http://technerdia.com/files/KeePass-passwords.gif" alt="KeePass Password Manager" width="194" height="51" class="aligncenter size-full wp-image-295" /></p><p>If you want to generate a new password, click the Keys Icon to the right of the Repeat Password box. At the bottom of the window, click the Generate button to create a new password. It&#8217;s instantly copied over to the entries password field.</p><h2>Maintaining Entries</h2><p>Each entry can be dragged into groups. So if the entry is created in the wrong spot, simply select and drag it to the proper location.</p><p>To View or Edit an Entry, right click on the Entry and select Edit/View Entry. Use this same menu to delete or duplicate an entry.</p><h2>Creating Multiple Databases For Others To Access</h2><p>Does your Computer get used by your spouse, kids or staff? Then no worries&#8230; In the main menu, click the New Icon (first icon). Set a new Master Key then your Password. Now everyone can have a unique way to access PassKeep to store passwords.</p><p>My spouse uses her own Master Key File while my kids just have a Password enter with no Key File to select. It&#8217;s hard enough to get children to use this software, so cut out every step you can that may push them away from using it, every time!</p><ul><li>Backup your database and key file before doing this.</li></ul><h2>KeePass Settings</h2><p>To access the Settings open the Tools Menu at the top, then click on Options. Setting up the software is really more about how you want to use it&#8230;</p><ul><li><strong>Security</strong>: I have two fields unchecked, the 3rd (Lock wordpress) and the last (expire entries) &#8211; the others are all checked.</li><li><strong>Interface (GUI)</strong>: The two key settings here for me are the Minimize and [x] close selections. I have both selected. Instead of the software closing, it goes to my system tray, when I open it &#8211; I have to enter my Master Password, just like I would if the software was fully closed.</li><li>I didn&#8217;t modify any other settings past these&#8230;. I do suggest you read through the other tabs &amp; features to ensure the settings are set how you like.</li></ul><h2>Vacation Time</h2><p><a
href="http://technerdia.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3RlY2huZXJkaWEuY29tL2ZpbGVzL3ZhY2F0aW9uX21leGljb18yLmpwZw==" target=\"_blank\" title=\"Vacation in Mexico\"><img
src="http://technerdia.com/files/vacation_mexico_1.jpg" alt="Vacation in Mexico" width="193" height="250" class="alignleft size-full wp-image-298" /></a>I always take a note pad and pen with me when I travel. Every time before traveling, I would write down the most important login details, passwords, and even url&#8217;s. No worries, I used my own form of encryption to mask things.</p><p>Today though&#8230; I just grab a copy of KeePass, my Database and Key file and put them on a flash drive and I burn a CD to toss in with my suitcase as a backup. I also put the information in a zip file on my server, within a password protected directory.</p><p>No longer do I worry about losing my note pad, backup paper in my wallet or what actually happened the most, I forgot to write down a password to something important&#8230;. I&#8217;m very happy to say, those worries are now gone.</p> <br
/><h3>KeePass</h3><p>It&#8217;s here to stay&#8230; It&#8217;s used daily, it&#8217;s used by family members, it&#8217;s even used on vacations. You should be using <a
href="http://technerdia.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2tlZXBhc3MuaW5mby8=" target=\"_blank\">KeePass</a> as well.</p><p><strong>Proper security starts and ends with you!</strong></p><hr
/><h4>Have something to say? Something to add? Have a Question?</h4><p>Use the <a
href="http://technerdia.com/feedback.html" target="_blank">feedback</a> form to quickly send me your thoughts.</p><br
/><p><div
style="border-top:1px dotted #cccccc;clear:both;font-size:14px;font-weight:bold;margin:2px 10px;padding:0 10px;text-align:left;"><ul><li><b>New WordPress Plugin</b> <a
href="http://technerdia.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3RlY2huZXJkaWEuY29tL3Byb2plY3RzL2FkbWluYmFyL3BsdWdpbi5odG1s" target=\"_blank\">WP My Admin Bar</a> (It's Free, Download Today!)</li><li><b>Reading:</b> <a
href="http://technerdia.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3RlY2huZXJkaWEuY29tLzI4NF9wYXNzd29yZC1tYW5hZ2VyLmh0bWw=">The Best Password Manager for Windows &#8211; Mac &#8211; Linux / Ubuntu &#8211; Smart Phones and more&#8230;</a> <b>By:</b> <a
href="http://technerdia.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cHM6Ly9wbHVzLmdvb2dsZS5jb20vMTA1NDA4MDgyNTcxNDU0MDEwMTUyLw==" target=\"_blank\">tribalNerd</a> <b>From:</b> <a
href="http://technerdia.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3RlY2huZXJkaWEuY29tLw==" target=\"_blank\">techNerdia - Web Development Tips</a></li><li><b><a
href="http://technerdia.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cHM6Ly9wbHVzLmdvb2dsZS5jb20vdS8wLzEwODA0NjIyNTkxMzk2NTMxNTU5NC9wb3N0cw==" target=\"_blank\">Follow techNerdia on Google+</a></li></ul></div><p
align="center">~ <b>Thank you for subscribing to techNerdia.com - Please Share This Post With Others</b> ~</p></p> <img
src="http://technerdia.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=284" width="1" height="1" style="display: none;" />]]></content:encoded> <wfw:commentRss>http://technerdia.com/284_password-manager.html/feed</wfw:commentRss> <slash:comments>2</slash:comments> </item> </channel> </rss>
