August 2017
Intermediate to advanced
278 pages
8h 53m
English
In order to provide basic authentication, we first need to create a password file. We can do this with the htpasswd utility, which is part of the Apache tools. It's important that we don't store this file in a publicly accessible directory, otherwise your usernames and passwords will be compromised.
Here's how to create the password file and add the siteadmin username to it:
htpasswd -c /var/www/private/.htpasswd siteadmin
The htpasswd utility will then prompt you for a password. While we could specify this via the command line, it would also mean that your password is logged in plain text within your bash history. Ensuring that the password is entered via stdin reduces the risks of compromise if your log files are exposed. ...
Read now
Unlock full access