Questions tagged [.htpasswd]

.htpasswd is a flat-file used to store usernames and password for basic authentication of Apache HTTP Server.

.htpasswd is a flat-file used to store usernames and passwords for basic authentication on Apache HTTP Servers. The name of the file is given in the .htaccess configuration, and can be anything, but ".htpasswd" is the canonical name. The file name starts with a dot, because most Unix-like operating systems consider any file that begins with dot to be hidden.

This file is often maintained with the shell command htpasswd which can add, delete, and update users, and will properly encode the passwords for use (so they are easily checked, but cannot be reversed back to the original password).

The file consists of rows. Each row corresponds to a username and hashed password pair, separated with the colon. For example:

user:password

The hashed password is typically "UNIX crypt" style, encrypted in either MD5 or SHA1 as common alternatives.

Additional users can be added by using the htpasswd shell command or by appending new lines to the file. For example:

user1:password1
user2:password2

Resources available on the Apache HTTP server can be restricted to users listed in the files created by htpasswd.

See also

526 questions
0
votes
0 answers

nuxt ssr .htaccess .htpasswd

I have a nuxt ssr website that is on dev mode. I want to protect it with .htaccess and .htpasswd I've tried to place the file in root folder, but it doesn't prompt the http form .htaccess is as follow AuthName "Restricted" AuthType…
Dario Rusignuolo
  • 2,090
  • 6
  • 38
  • 68
0
votes
1 answer

htpasswd problem: AuthType takes one argument, an HTTP authorization type (e.g., "Basic")

I've never come across this error before and a search on Google doesn't turn up much. I'm getting 500 Internal Server Error. Running Ubuntu 18.04. Apache log: AuthType takes one argument, an HTTP authorization type (e.g.,…
Gaillimh
  • 5
  • 1
  • 2
0
votes
1 answer

Allow either users OR ips to access using apache

I have users in .htpasswd and allowed IPs in .htaccess I want to allow either user/password (for IPs not in .htaccss) OR IPs to access (without auth). I edited the dir section in httpd with these lines But its asking for user/password for the…
Nsh
  • 29
  • 6
0
votes
1 answer

Is it possible to use .htaccess|.htpasswd on Shiny Server?

My workplace has a commercial shiny server. While the shinyapps deploy fine, I have attempted to inject .htaccess|.htpasswd without success. For example, I have created the necessary files and placed them in the directories: Directory where…
OctoCatKnows
  • 399
  • 3
  • 17
0
votes
2 answers

Password protect admin panel using htpassword not working

I have created a simple CSM website using core PHP. I have placed my fronted code in root directory i.e. public_html and admin code inside admin directory i.e. public_html/admin. I want to password protect my admin part with htpassword. Below is my…
0
votes
1 answer

How to mass add squid users (htpasswd)

I normally add a new user in squid with this command touch /etc/squid/squid_access; htpasswd /etc/squid/squid_access "NEWuser" then it prompts me to input the password for "newuser" and conirm it again. How can I automate this so that I add a range…
humpferey
  • 3
  • 2
0
votes
0 answers

Elasticsearch + searchkit basicauth - getting 401 Unauthorized when contacting ES

I am trying to secure my ES instance for use with searchkit. I have nginx-proxied my ES instance to proxy port 9200 requests on port 8080 and enabled a basic authentication on top of that. My server is correctly reachable from browser…
gennaris
  • 1,467
  • 1
  • 11
  • 17
0
votes
1 answer

Apache rewrite to use a different index.php for admin.example.com

My Apache is rusty but I've been struggling just trying to create an admin on a shared hosting server for a client. This is an old code igniter site and the PHP can specify where to go based on the URL. In .htaccess, I'm trying to rewrite…
henryC
  • 65
  • 11
0
votes
1 answer

Filling out a 3rd party htacces

I'd like to write a nodejs script that checks every few minutes a 3rd-party website. The only problem is that I have to enter my username and password through a .htpasswd/.htacces prompt. How can I do this with nodejs?
NoaH
  • 27
  • 7
0
votes
2 answers

Password lock site except for certain routes running nginx

We have a server we don't want Google to index or anyone else to get access to unless they have a password. How can I directory lock the entire server except for very specific routes used by external scanning services? For instance, example.com/test…
eComEvo
  • 11,669
  • 26
  • 89
  • 145
0
votes
0 answers

Not finding file php when it clearly exists (htaccess protection)

So I've created a directory that I have protected with htaccess. The issue is that I want every user in an SQL table with the 'admin' usertype to be able to use their custom login info. I've set up everything so that the usernames and encrypted…
Sam
  • 295
  • 4
  • 17
0
votes
1 answer

.htaccess/.htpasswd failing to protect .html files only - works on all other files

I'm trying to set up basic .htaccess/.htpasswd protection on a site as I've done a million times before. My .htaccess file looks like this: AuthType Basic AuthName "My Protected Area" AuthUserFile /home/runcloud/webapps/dev/.htpasswd Require…
JcG
  • 1,108
  • 7
  • 11
0
votes
1 answer

Openshift Origin htpasswd auth not working - unable to login to web console

I have a successful install of Openshift Origin 3.9. I have 2 masters, 2 etcd, 2 infra, 2 nodes. I am unable to login using the web console, login using CLI works fine (oc login -u system:admin). I have already ran "oc adm policy…
zdrux
  • 21
  • 1
  • 4
0
votes
1 answer

Protect sub-directory Wordpress with htpassword return page not found

I followed this instruction to protect subdirectory. https://support.hostgator.com/articles/wordpress-preventing-you-from-password-protecting-a-directory # BEGIN WordPress RewriteEngine On RewriteBase / RewriteCond…
Hai Tien
  • 2,929
  • 7
  • 36
  • 55
0
votes
0 answers

htpassword for nginx server on different ports

I am trying to restrict users visiting a site via username and password. Doing it in apache is very simple. I am trying to do it in nginx for different ports, not just 80, but some other ports that the application hosted in the server will use.…
Subrata
  • 2,216
  • 3
  • 24
  • 38