Htpasswd
Using htpasswd and htaccess in public_html
1. You need create file with usernames and passwords
## ‘-c ‘ use only ones to create password database
user(at)shellmix ~> htpasswd -c /homex2/user/mypass my_trust_user
New password:
Re-type new password:
Adding password for user my_trust_user
## adding another user
user(at)shellmix ~> htpasswd /homex2/user/mypass grandfather
2. Now go to public_html and choose folder which you want protect and create folder called .htaccess
user(at)shellmix ~/public_html> ee .htaccess
## .htaccess
Authname "Access Control Systems"
authtype basic
authuserfile /homex2/user/mypass
require user grandfather my_trust_user
3. Password cryptographic methods
# Crypt method
htpasswd -d /homex2/user/mypass trust_user
# MD5
htpasswd -m /homex2/user/mypass trust_user
# SHA encryption
htpasswd -s /homex2/user/mypass trust_user
Done ! : )


Tutorials 