Sunday, September 16, 2012

Password protecting a directory with htaccess and htpasswd

Password Protecting a web directory with htaccess

Password protecting a web directory can help make a directory private and only accessible to one or several persons that have the username(s) and password(s).

How to password protect a directory?


  1. Go to the directory you want protected.
  2. Check if you have a .htaccess file.
  3. If a htaccess file is available, you have to edit it, otherwise create a new .htaccess file.
  4. Add the following to the htaccess file:
AuthUserFile /home/linuxuser/.htpasswd
AuthType Basic
AuthName "Tech and Dev Example"
Require valid-user
AuthUserFile: this is the path of the .htpasswd file where the username and password will be stored. The file can be located anywhere, but ideally, it's better if it's placed in a non public directory where users can't access it from the web.

AuthType: should be Basic

AuthName: The title of the window that will be authenticating the user. For example if you're password protecting your private files, you might want to change this to "My Private Files".


This is the file where the username and password are stored.
This file is usually called htpasswd (by convention if you want), however you can rename this file to anything you want. Many applications use their appname followed by htpasswd, for example .awstats-htpasswd
It's always a better idea to keep this file outside of the public folder (www or public_html...)

Assuming you want the username to be username and the password to be password, write the following command in SSH:
#htpasswd -nb username password
Then inside the htpasswd file write the output value from the SSH (the password might be different since everytime a different salt value is used):

You can add as many usernames and passwords as you like, for example:

How is the password getting encrypted?

To understand more on how the password is generated and encrypted, you can check my previous post: Understanding the encryption process in htpasswd file.

To generate a username/password, you can check our online Encryption Tools.

Username: username
Password: password
Username: username2
Password: password2

Any questions or suggestions? Please leave a comment below!

Friday, September 7, 2012

Join our Folding@Home "Tech and Dev" Team

What is Folding@home?


Folding@home is a distributed computing project, that very simply stated, studies protein folding and misfolding.

You can help scientists studying Alzheimer's, Huntington's, and many cancers by simply running a piece of software on your computer or game console.

Distributed Computing is a method of computer processing in which different parts of a program, or different portions of data, are processing simultaneously on two or more computers that are communicating with each other over a network or through the Internet.

Unlike other distributed computing projects, Folding@home is run by an academic institution (specifically the Pande Group, at Stanford University's - Chemistry Department), which is a nonprofit institution dedicated to science research and education. 

Moreover, the data is available for others to use. In particular, the results from Folding@home will be made available on several levels. Most importantly, analysis of the simulations will be submitted to scientific journals for publication, and these journal articles will be posted on the folding@home web page after publication.

The Folding@home software runs behind the scenes using otherwise unused computing time. Mostly likely you will hardly even notice it.

Folding Homepage

Downloading Folding@home

Folding@home can run on computers and game consoles (Playstation, Xbox...).

Folding@home can be downloaded from the Folding Homepage.

Joining Tech and Dev Team

Joining Tech and Dev team is simple, when you are prompt to choose a username and team, just pick any username you want and add the Team id 221575

You can check the team stats below:
Tech and Dev Folding Team

Happy Folding!