🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #72373

Re: Authentication advice

#72373
From: John F. Morse
Date: Mon, 03 Oct 2005 13:08
135 lines
5690 bytes
Jeffrey M. Vinocur wrote:

>In article <7MJ%e.353849$5N3.165070@bgtnsc05-news.ops.worldnet.att.net>,
>John F. Morse <xanadu.bbs@invalid.net> wrote:
>  
>
>>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:
>>    
>>
>
>Hmm, that looks like an old version of the ckpasswd manpage, btw.
>Or maybe it goes with an old version of ckpasswd?  A while back
>Russ added support for `ckpasswd -u username -p password` as a
>handy way to test without having to do echo commands like that.
>But your problem report below is still relevant regardless.
>  
>


This shows "Last spun 2005-06-07 from POD modified 2005-06-06" which 
must be Russ' version ($Id: ckpasswd.pod 7215 2005-04-11 20:43:21Z rra $).

In fact, I got it from here:

http://www.eyrie.org/~eagle/software/inn/docs-2.4/ckpasswd.html

The man pages in Debian 3.1r0a are dated 2003-07-30 ($Id: ckpasswd.8,v 
1.2.2.2 2003/08/08 22:02:42 vinocur Exp $).

I ran it, but received "ckpasswd: pam_authenticate failed: 
Authentication failure" and can find no way to force it to use crypt 
instead of pam, if possible.

It does have the -u and -p options.


>>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
>>    
>>
>
>Whoa, you're absolutely right, my script didn't handle passwords
>with shell metacharacters in them.  It's easy to fix the script,
>just adjust the line that calls htpasswd to have single quotes:
>
>        my $out = `htpasswd2 -ndb '$user' '$pass'`;
>  
>


You are using a single quote (the apostrophe) for the $user and $pass 
variables, then using an acute accent diphthong (ligature) as a 
different "single quote"?

I'm an old graphic artist typesetter, so I'm not aware of the various 
"metacharacters" used in Perl, BASH, C++, etc.  ;-)

I see I've go some studying to do.


>>I tried the single and double quotes around the whole password 
>>"r7&K8$g51?" but that did no good.
>>    
>>
>
>Adjusting the script as above should take care of it.
>
>When you're using htpasswd and providing the password on the
>commandline (but not when you let htpasswd prompt you for the
>password), you'll want to put single quotes around passwords like
>that.  Same goes for using ckpasswd for testing as mentioned
>above.
>  
>


I'll try this -- with the apostrophe and the acute diphthong -- just to 
learn what works and what doesn't. (Much faster than searching for and 
through man pages.) ;-)


>But users wouldn't have to put them in their news clients -- the
>issue is whether or not the unix shell lays hands on the data,
>since that's what's misinterpreting them all.  So in the Perl
>script I wrote you, using the `` backticks leads to a shell
>interpreting the strings.
>  
>


Understood. My use of the quotes was around the password in the 
textfile, but they must be used in the shell expression to force it into 
obedience.


>The intricacies of shell quoting are painful and tedious to
>learn, unfortunately, and I'm sure you'll encounter them again.
>Get in the habit of using single quotes unless you have a
>specific need for double quotes, and you'll be much happier in
>the end.  (For example, if your user had put a $ in the password,
>and you used double quotes, it still wouldn't work properly
>because the shell would be interpreting the $ as a variable
>reference, even inside double quotes -- but not single quotes.)
>  
>


The other Linux user with the ampersand also had the dollar sign in the 
password! I read about this in man bash, but figured the ampersand 
blockade was the first to fix.


>>Then I started wondering what if a user wanted to use a single or double 
>>quote, or the backslash, as part of their password?
>>    
>>
>
>They could, but it would require a much more careful job in that
>script.  The underlying INN software would manage it correctly in
>the end, but it probably wouldn't be worth the trouble.
>


Perhaps I should inform (new) users to avoid using the ampersand and 
dollar sign in their password selection? Any other possible 
trouble-makers come to mind?

-- 
John
Technical Details
Message-ID: <v3a0f.104385$qY1.71720@bgtnsc04-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!wn13feed!worldnet.att.net!bgtnsc04-news.ops.worldnet.att.net.POSTED!17a21c27!not-for-mail
References: <2b9f5$4335ae05$4097152a$18719@EVERESTKC.NET> <dh4dmf$d5u$1@puck.litech.org> <7MJ%e.353849$5N3.165070@bgtnsc05-news.ops.worldnet.att.net> <dhpbmh$va2$3@puck.litech.org>

Show Full Headers
Complete Article Headers
Message-ID: <v3a0f.104385$qY1.71720@bgtnsc04-news.ops.worldnet.att.net>
Subject: Re: Authentication advice
Date: Mon, 03 Oct 2005 13:08:43 GMT
From: "John F. Morse" <xanadu.bbs@invalid.net>
References: <2b9f5$4335ae05$4097152a$18719@EVERESTKC.NET> <dh4dmf$d5u$1@puck.litech.org> <7MJ%e.353849$5N3.165070@bgtnsc05-news.ops.worldnet.att.net> <dhpbmh$va2$3@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!wn13feed!worldnet.att.net!bgtnsc04-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: <dhpbmh$va2$3@puck.litech.org>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 135
NNTP-Posting-Host: bd337791fbec5a9ad709ca3bb766cf07
X-Complaints-To: abuse@worldnet.att.net
X-Trace: bgtnsc04-news.ops.worldnet.att.net 1128344923
NNTP-Posting-Date: Mon, 03 Oct 2005 13:08:43 GMT