🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #72362

Re: Authentication advice

#72362
From: John F. Morse
Date: Sun, 02 Oct 2005 04:56
84 lines
3873 bytes

Jeffrey M. Vinocur wrote:

>In article <2b9f5$4335ae05$4097152a$18719@EVERESTKC.NET>,
>John F. Morse <xanadu.bbs@invalid.net> wrote:
>
>And then your user-database file should be like this:
>
>    johnsmith:j803asdf29
>    suebrown:la390fas3
>    mikejohnson:p3a0jxzmli
>
>Where the second field is the encrypted password (in regular unix
>fashion).  The easiest way to mainting this file is to use the
>"htpasswd" tool which is probably already installed on your
>machine as part of Apache.  See `man htpasswd` for details.
>


Jeff,

I had the "username:password:misc" data file encrypted with the perl 
script you provided. Today, when I was checking the file using the 
example in ckpasswd(8), to wit:

----

To test to make sure that ckpasswd is working correctly, you can run it 
manually and then give it the username (prefixed with "ClientAuthname:") 
and password (prefixed with "ClientPassword:") on standard input. For 
example:

(echo 'ClientAuthname: test' ; echo 'ClientPassword: testing') | 
ckpasswd -f /path/to/passwd/file

will check a username of "test" and a password of "testing" against the 
username and passwords stored in /path/to/passwd/file.  On success, 
ckpasswd will print "User:test" and exit with status 0.  On failure, it 
will print some sort of error message and exit a non-zero status.

----

I received errors on two users. All the others passed.

I examined the file and found odd lines (errors) like this one:

sh: line 1: K8?: command not found
bschneider:esVfW2VF4fFGK:Bob Schneider

This was for a user with the following info:

bschneider:r7&K8$g51?:Bob Schneider

Not really -- the name and real password is munged, but without 
destroying the area where you can see the K8 follows an ampersand ("&"). 
The other user's password entry also contains the ampersand.

I tried using htpasswd to "manually" edit this users password and it 
also had a problem with the ampersand.

Man BASH indicates that the ampersand is a "metacharacter that, when 
unquoted, separates words."

Sounds like this may be the trouble.

Man BASH goes on to explain quoting, using the escape character (\), 
single quotes, and double quotes.

I tried the single and double quotes around the whole password 
"r7&K8$g51?" but that did no good.

Then I started wondering what if a user wanted to use a single or double 
quote, or the backslash, as part of their password?

Oddly, these two users are my only two Linux users. Talk about strong 
passwords -- they are so strong they cannot be encrypted! ;-)

Got any ideas or fixes?

TIA,

-- 
John
Technical Details
Message-ID: <7MJ%e.353849$5N3.165070@bgtnsc05-news.ops.worldnet.att.net>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.20140818.mbox.gz!number1.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!wn12feed!worldnet.att.net!bgtnsc05-news.ops.worldnet.att.net.POSTED!17a21c27!not-for-mail
References: <2b9f5$4335ae05$4097152a$18719@EVERESTKC.NET> <dh4dmf$d5u$1@puck.litech.org>

Show Full Headers
Complete Article Headers
Message-ID: <7MJ%e.353849$5N3.165070@bgtnsc05-news.ops.worldnet.att.net>
Subject: Re: Authentication advice
Date: Sun, 02 Oct 2005 04:56:35 GMT
From: "John F. Morse" <xanadu.bbs@invalid.net>
References: <2b9f5$4335ae05$4097152a$18719@EVERESTKC.NET> <dh4dmf$d5u$1@puck.litech.org>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.20140818.mbox.gz!number1.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!wn12feed!worldnet.att.net!bgtnsc05-news.ops.worldnet.att.net.POSTED!17a21c27!not-for-mail
Reply-To: xanadu.bbs@invalid.net
Organization: Xanadu BBS
User-Agent: Debian Thunderbird 1.0.2 (X11/20050331)
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: news.software.nntp
In-Reply-To: <dh4dmf$d5u$1@puck.litech.org>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 84
NNTP-Posting-Host: cd9a32c8e656657c1aa8e29462615d50
X-Complaints-To: abuse@worldnet.att.net
X-Trace: bgtnsc05-news.ops.worldnet.att.net 1128228995
NNTP-Posting-Date: Sun, 02 Oct 2005 04:56:35 GMT