htpasswd
Create a password file
1 |
htpasswd -c /path/to/passwd/file admin |
To limit access, add following to Apache virtual host entry.
1 2 3 4 5 6 |
<Directory "/var/www/html"> AuthType Basic AuthName "Restricted Content" AuthUserFile /path/to/passwd/file Require valid-user </Directory> |
Create a User – non interactive mode
1 |
htpasswd -b -c /path/to/passwd/file USERNAME PASSWORD |
Changing Password for a user
1 |
htpasswd -c /path/to/passwd/file USERNAME |