The “HttpAuth” command allows us to manage users with permission to access pages protected by the HTTP authentication method, in addition to controlling the activation of this additional security layer in the tools access pages such as PhpMyAdmin and wp-admin or wp-login. Basically it is to protect some sections of your site requesting a user and password to be able to access its content.
If you want to know a little more about this method of authentication, I recommend you read the Wikipedia article about Basic Access Authentication.
sudo httpauth <option>
sudo httpauth -add sudo httpauth -wp-admin-off
To create a user and password for access to sections protected with HTTP Authentication, use this command.
sudo httpauth -add
# Tip - For unattended scripts. sudo httpauth -add=[user,password]
To delete a user use the following command.
sudo httpauth -delete
# Tip - For unattended scripts. sudo httpauth -delete=user
List of users
Displays a list of all users created with access to HTTP Authentication.
sudo httpauth -list
Enable Authentication in WordPress Login
By default in the initial installation this security layer is activated, if for some reason you have disabled it and want to reactivate it, use the following command.
sudo httpauth -wp-admin-on
The reason for having this double authentication for access to the management sections of WordPress, although we know that HTTP Authentication is not the most reliable method of security, it is due to the large number of automated attacks that receive this type of pages and also very simple to implement and use by end users.
If you have a WordPress site that already has some time online and check your access logs in the server, I am sure you will find a considerable number of failed attempts to access this section. Because they are automated “bots” they randomly crawl almost the entire web, when they encounter this extra layer of security they lose interest and continue on their way.
It is worth mentioning that this type of security will not protect you from more sophisticated attacks or someone with a genuine interest and knowledge to perform this type of malicious attacks. Security is a very serious issue and if you consider that your server and website store sensitive data or information, it is advisable to go with a security expert.
Disable Authentication in WordPress Login
We know that sometimes this extra layer of security can be annoying for some users, if you need to disable the HTTP Authentication in WordPress login pages, you can use the following command.
sudo httpauth -wp-admin-off
Remember that you can always re-enable this function.
Any doubts about the use of Webinoly do not hesitate to consult or ask through the support forum.