• Skip to main content
  • Skip to primary sidebar
  • Skip to footer

Webinoly

Optimized WebServer

  • Installation
    • Quick setup
    • Documentation
      • Httpauth
      • Log
      • Site
      • Stack
      • Webinoly
    • API Reference
    • Changelog
  • Contribute
  • Support
    • Support Forum
    • Github
    • FAQs
  • Español
Home » Documentation » HttpAuth

HTTP Authentication

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.

Syntax:

sudo httpauth <option>

Options:

  • -add
  • -delete
  • -list
  • -path
  • -whitelist
  • -wp-admin

Example:

sudo httpauth -add
sudo httpauth -wp-admin=off

Create user

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]

You can also create a user with limited permissions to access only one specific domain.

sudo httpauth domain.com -add

After you have created one or more users for a specific domain ONLY these users will be allowed to access this domain, “general” users will be blocked.

Delete user

To delete a user use the following command.

sudo httpauth -delete
# Tip - For unattended scripts.
sudo httpauth -delete=user

# Remove user from a specific domain.
sudo httpauth domain.com -delete

Lists from anything

Displays a list of all users created with access to HTTP Authentication.

sudo httpauth -list

You can always use the -raw option to remove colors and format.

# Remove format from list.
sudo httpauth -list -raw

# To list users from an specific domain.
sudo httpauth  domain.com -list

# To list all the protected paths, areas or folders.
sudo httpauth domain.com -list=protected

# To list all the whitelisted IP's.
sudo httpauth -whitelist -list

HTTP Authentication in WordPress Login

By default in the initial installation this security layer is enabled for wp-admin folder.

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 just go 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” that randomly crawl almost the entire web, when they find 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 contains sensitive data or information, it is advisable to go with a security expert.

We know that sometimes this extra layer of security can be annoying for some users, if you need to enable/disable (on/off) the HTTP Authentication in WordPress login pages, you can use the following command and every site created after that will take this setting.

sudo httpauth -wp-admin=off

To enable/disable (on/off) this feature in an existing site:

sudo httpauth domain.com -wp-admin=off

Protect a custom folder or file

You can put under HTTP Authentication any folder or file.

sudo httpauth example.com -path=/folder

Use -path=/ to protect a complete site or domain, you can also use the -exact option to define an exact match of URI and location.

To remove a folder or file from the protected list just use the -purge option.

# Remove folder
sudo httpauth dominio.com -path=/folder -purge

# Remove everything
sudo httpauth dominio.com -path=all -purge

“Reverse Proxy” sites only have support for complete site protection.

Whitelist IP

To add an IP to the secure list and don’t be asked for your credentials every time HTTP Authentication is required.

sudo httpauth -whitelist

Or you can also pass the IP directly: sudo httpauth -whitelist=10.126.196.2

If you want to remove a previously added IP.

sudo httpauth -whitelist -purge

If you have any suggestions, ideas, or comments, or if you (gasp!) found a bug, join us in the support forum.

Primary Sidebar

Community

Visit our Community and Support Forum.

Ask any question about Webinoly or your web server. We or someone in the community will always try to answer your questions as soon as possible.

Also, stay updated with the latest news and updates. Sign up and you will receive a notification email when an update is available.

Likewise, we welcome your suggestions and comments.

Documentation

  • API Reference
    • Internal API and Events
  • Installation
  • Documentation
    • Create and manage your website
    • HTTP Authentication
    • Packages installed
    • Real time Logs
    • Webinoly Settings
  • Frequently Asked Questions

Sponsored

Looking for an Sponsor for Webinoly.
How to sponsor?

Special Thanks!

Recurring donors for at least three months in a row.

  • Carlos Zumaran
  • Yungke Li
  • Tonny Chiu
  • Maxwell White

Footer

Documentation

Your Optimized LEMP WebServer in just one step. Please, read the installation and quick setup guide and in less than 5 minutes your server will be ready.

List of Commands:

HttpAuth · Log · Site · Stack · Webinoly

Paypal Donations - Buy me a beer

Your regular donations is what keep this project moving forward. If you like Webinoly, buy me a coffee or a beer to show support.

Bitcoin Donations

Contact

  • Facebook
  • GitHub
  • Twitter

If you have a question about Webinoly, please use our Support Forum.

Likewise, we welcome your suggestions and comments.

© Copyright 2017-2019 by QROkes
Powered by: WordPress · Genesis Framework · Webinoly
Terms of Use | Privacy Policy | Legal warning