An .htpasswd
file can be used to control access to specific directories that
visitors to a web server can access when the web server is an Apache web
server. Entries in the file can be added, modified, or deleted using
the htpasswd utility, which may be in the /bin
directory
on a Linux sysem.
To update a password for a user listed in an .htpasswd file, a command
in the form htpasswd htpasswdFileLocation user
where htpasswdFileLocation is the location and name for the
.htpassword file on the system and user is a specific user listed
in that file. The htpasswd utility will prompt for a new password and
then prompt you to retype it to ensure there has not been a typo when
the new password was provided. E.g.:
# htpasswd /home/jdoe/music/.htpasswd mary New password: Re-type new password: Updating password for user mary #
If you wish to delete an entry for a user in the .htpasswd file, you can
use a command in the form htpasswd -D htpasswdFileLocation
user
. The -D
indicates the entry for the user
should be deleted. The response will indicate the password for the user
was deleted, which is true, but that indicates the entire entry for that
user was removd from the file. E.g.:
# htpasswd -D /home/jdoe/music/.htpasswd manny Deleting password for user manny #
Related
-
Apache AllowOverride AuthConfig
Directive
Date: May 13, 2008