🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #58735

Re: local news server....

#58735
From: Russ Allbery
Date: Mon, 06 May 2002 05:54
56 lines
3009 bytes
Aline Krus <geenie2010@hanmail.net> writes:

> I already modify readers.conf file..

>         auth: "ckpasswd -d usr/local/news/db/newspasswd"

> But...I don't know how I create "newspasswd" file....

> Is it script file??
> .....very difficult for me....

Here's the relevant excerpt from the current ckpasswd documentation:

  -d database
      Read passwords from a database (ndbm or dbm format depending on what
      your system has) rather than by using getpwnam(3).  ckpasswd expects
      database.dir and database.pag to exist and to be a database keyed by
      username with the encrypted passwords as the values.

      While INN doesn't come with a program intended specifically to create
      such databases, on most systems it's fairly easy to write a Perl
      script to do so.  Something like:

          #!/usr/bin/perl
          use NDBM_File;
          use Fcntl;
          tie (%db, 'NDBM_File', '/path/to/database', O_RDWR | O_CREAT, 0640)
              or die "Cannot open /path/to/database: $!\n";
          $| = 1;
          print "Username: ";
          my $user = <STDIN>;
          chomp $user;
          print "Password: ";
          my $passwd = <STDIN>;
          chomp $passwd;
          my @alphabet = ('.', '/', 0..9, 'A'..'Z', 'a'..'z');
          my $salt = join '', @alphabet[rand 64, rand 64];
          $db{$user} = crypt ($passwd, $salt);
          untie %db;

      Note that this will echo back the password when typed; there are
      obvious improvements that could be made to this, but it should be a
      reasonable start.

      This option will not be available on systems without dbm or ndbm
      libraries.

You may be able to just copy that script, change the path, and use it,
although I didn't test it extensively.

-- 
Russ Allbery (rra@stanford.edu)             <http://www.eyrie.org/~eagle/>

          Please post questions rather than mailing me directly.
     <http://www.eyrie.org/~eagle/faqs/questions.html> explains why.
Technical Details
Message-ID: <ylpu096cud.fsf@windlord.stanford.edu>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!nntp.stanford.edu!not-for-mail
References: <ab55i7$nkj$1@news.kreonet.re.kr>

Show Full Headers
Complete Article Headers
Message-ID: <ylpu096cud.fsf@windlord.stanford.edu>
Subject: Re: local news server....
Date: Sun, 05 May 2002 22:54:02 -0700
From: Russ Allbery <rra@stanford.edu>
References: <ab55i7$nkj$1@news.kreonet.re.kr>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!nntp.stanford.edu!not-for-mail
Newsgroups: news.software.nntp
Organization: The Eyrie
Lines: 55
NNTP-Posting-Host: windlord.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Trace: news.Stanford.EDU 1020664442 6014 171.64.13.23 (6 May 2002 05:54:02 GMT)
X-Complaints-To: news@news.stanford.edu
User-Agent: Gnus/5.090005 (Oort Gnus v0.05) XEmacs/21.4 (Common Lisp,
 sparc-sun-solaris2.6)
Cancel-Lock: sha1:vc2Xcbrfwzx2zbFi1XLh01dENVw=