24
Jan/090
Jan/090
Linux: .htaccess and .htpasswd files
You can use .htaccess to protect a directory on your Apache web server. Users trying to access a protected directory will be asked to enter a user and password. .htaccess defines the protected directory, and .htpassword stores your password hashes.
.htaccess normally looks like this:
AuthName "Title" AuthUserFile /path-to-your-htpasswd-file/.htpasswd AuthType Basic require valid-user
To create a .htpasswd file:
htpasswd -c /path.to.the.folder.you.want.to.protect/.htpasswd <username>
or
htpasswd -c <username>
and you will be prompted to enter a password for <username>
Of course, you can use a .htpasswd generator. Remember, Google is your friend
Related posts:
- Linux: htpasswd: command not found
- Linux: A simple and quick way of sharing a folder with Windows systems using Samba
- Linux: Download files using wget from protected url’s – resume broken downloads
- Linux: Mount remote Windows shares with smbfs
- Linux: vsftpd and symbolic links
Enjoy this article?
Comments (0)
Trackbacks (0) ( subscribe to comments on this post )
No comments yet.
Leave a comment
No trackbacks yet.