Is it possible to protect a folder with .htaccess by asking just a password?
I don't want a username.
Create the password file The htpasswd command can be used to either create a password file or add an entry to it. For this first time, we will use the -c flag to create the file and add the username jdoe: CentOS 7:sudo htpasswd -c /etc/httpd/. htpasswd jdoe.
Use encryption to password protect a folder or a file Navigate to the folder or file you want to encrypt. Right-click on the item, click Properties, then click Advanced. Check Encrypt contents to secure data. Click OK, then click Apply.
HTTP auth will always ask for a username and password, and not just a password. The server doesn't generate the form that pops up, your browser does. And that form will always have a username and password. You can't tell it to only ask for a password.
But what you can do is generate an htpasswd file with a blank username so when the login window opens, people only need to enter a password and can leave the username field blank.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With