LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 12-09-2021, 02:20 PM   #1
chatlow
LQ Newbie
 
Registered: Dec 2021
Posts: 2

Rep: Reputation: Disabled
htpasswd authname problem


Hi All

Have a small site running on my RaspPI at home - apache2/php. Have created .htpasswd file in /etc/apache2/ and set it to be used in my main ssl config in apache2/sites-available/

Looks a bit like this:

<Directory "/var/www/html/site">
AuthType Basic
AuthName "Please enter username and password on back of invite"
AuthUserFile /etc/apache2/.htpasswd
Require valid-user
Options Indexes FollowSymLinks MultiViews
# AllowOverride controls what directives may be placed in .htaccess files.
AllowOverride All
# Controls who can get stuff from this server file
Order allow,deny
Allow from all
</Directory>
<IfModule mpm_peruser_module>
ServerEnvironment apache apache
</IfModule>

It works, however the AuthName is not showing what I have asked it to. Instead the prompt appears on desktop saying Sign in and on my mobile: requires a user name and password.
Any idea why the AuthName value is not being respected?

Site is behind Cloudflare which is set to under attack mode and checks all user agents. Can't see this being an issue though.

Thanks
 
Old 12-09-2021, 10:02 PM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,375

Rep: Reputation: 2755Reputation: 2755Reputation: 2755Reputation: 2755Reputation: 2755Reputation: 2755Reputation: 2755Reputation: 2755Reputation: 2755Reputation: 2755Reputation: 2755
Well, according to this page https://httpd.apache.org/docs/2.4/mo...uthn_core.html
Quote:
The string provided for the AuthName is what will appear in the password dialog provided by most browsers.
Note the word 'most' in that text; maybe try a few different ones?

Also, can you get to it without going through Cloudflare (or anything else) ie check if the Authname string is being transmitted at all?
Maybe use 'Show Page source' option in your browser and/or 'Web Developer tools' or similar?
firefox has bunch of stuff built-in; see Tools menu.
 
Old 12-10-2021, 03:00 AM   #3
chatlow
LQ Newbie
 
Registered: Dec 2021
Posts: 2

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by chrism01 View Post
Well, according to this page https://httpd.apache.org/docs/2.4/mo...uthn_core.html

Note the word 'most' in that text; maybe try a few different ones?

Also, can you get to it without going through Cloudflare (or anything else) ie check if the Authname string is being transmitted at all?
Maybe use 'Show Page source' option in your browser and/or 'Web Developer tools' or similar?
firefox has bunch of stuff built-in; see Tools menu.
thanks and yeah I can see the AuthName string when inspecting through Chrome tools. Tried with CF in attack mode and without. Would try removing CF altogether but as the string is there already I don't see it being CF, stripping it.

I'm yet to try with Firefox but Chrome, Brave and Edge dont display the custom AuthName
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Apache2 .htpasswd and 000-default.conf problem Davno Linux - Server 10 08-13-2018 08:11 PM
squid proxy authentication htpasswd command problem sonykarthik71 Linux - Server 2 12-02-2008 05:25 AM
.htaccess .htpasswd plisken Linux - General 5 05-21-2006 01:44 PM
Cannot see .htaccess and .htpasswd files John_Saunders Linux - Newbie 2 07-21-2002 09:14 AM
htpasswd steve_c Linux - General 10 04-16-2002 10:15 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 01:42 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration