Skip to content
TekTinkers

TekTinkers

Learning and imagination unlock limitless possibilities in technology

  • TinkersLab
    • TinkersDocs
    • Garage LAN
    • HomeLab
  • Resources
    • Events
  • Minecraft
    • Minecraft Technologies
    • Server Tools ‘n Stuff
    • TinkersCraft
  • About
    • Education
    • Experience-Awards
    • Special Thanks
    • Volunteer-Charity
  • Toggle search form

Password Protect your WordPress Webpage

Posted on June 17, 2025June 17, 2025 By TekTinkers
Setup Basic Authentication

Create a .htpasswd file

  • htpasswd -c /path/to/.htpasswd username

Add the following lines to the .htaccess file

  • AuthType Basic
    AuthName “Restricted Area”
    AuthUserFile /path/to/.htpasswd
    Require valid-user

Ensure the AuthUserFile path matches where you stored the .htpasswd file

If Authentication Isn’t Working

Modify the httpd.conf file to allow .htaccess authentication

  • AllowOverride AuthConfig

Restart Apache to apply

  • sudo service apache2 restart
Change Username
  • htpasswd /path/to/.htpasswd new_username
Change Password
  • htpasswd /path/to/.htpasswd username
Remove Username
  • htpasswd -D /path/to/.htpasswd username

you can also edit the file, each line is a user

  • sudo nano /path/to/.htpasswd
Linux, TinkersLab Tags:linux, password, protect, wordpress

Post navigation

Previous Post: Setup WordPress
Next Post: Set backups for a Minecraft server

Copyright © 2025 TekTinkers - Images by CoPilot, unedited for the lol's