🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.nntp
6 messages
6 total messages Started by Anonymous Sat, 12 Jul 2025 22:25
INN2 set up user authentication via ckpasswd
#92248
Author: Anonymous
Date: Sat, 12 Jul 2025 22:25
9 lines
1731 bytes
For latest version of INN2 in Debian stable.

I think using ckpasswd is the most viable option for authentication since it is simple to add and remove users and it is a flat text file without database bugs and vulnerabilities.

I need to prevent all non-authenticated users from posting to newsgroups and authenticate via ckpasswd.

How do I configure INN2 so that I can add users with ckpasswd and force INN2 to authenticate via ckpasswd?

If there is a better method I am all ears. Please don't suggest some 3rd party program that is not included in the Debian stable repos. Please don't suggest something that uses a database or some other attack surface generator. I'm not interested in complicated stuff like that.
Re: INN2 set up user authentication via ckpasswd
#92250
Author: Anonymous
Date: Sun, 13 Jul 2025 01:31
41 lines
2564 bytes
On Sat, 12 Jul 2025 17:25:36 -0500
Anonymous <anon@anon.anon> wrote:

> For latest version of INN2 in Debian stable.
> 
> I think using ckpasswd is the most viable option for authentication since it is simple to add and remove users and it is a flat text file without database bugs and vulnerabilities.
> 
> I need to prevent all non-authenticated users from posting to newsgroups and authenticate via ckpasswd.
> 
> How do I configure INN2 so that I can add users with ckpasswd and force INN2 to authenticate via ckpasswd?
> 
> If there is a better method I am all ears. Please don't suggest some 3rd party program that is not included in the Debian stable repos. Please don't suggest something that uses a database or some other attack surface generator. I'm not interested in complicated stuff like that.
> 

I added this to readers.conf:

auth: "/usr/lib/news/bin/auth/passwd/ckpasswd -f /etc/news/userdb"

I created a test user and got auth failure.

~ htpasswd -nbd test test > /etc/news/userdb

~ chown news:news /etc/news/userdb

~ stat /etc/news/userdb 
  File: /etc/news/userdb
  Size: 20        	Blocks: 8          IO Block: 4096   regular file
Device: 254,1	Inode: 257747      Links: 1
Access: (0644/-rw-r--r--)  Uid: (    9/    news)   Gid: (    9/    news)

~ cat /etc/passwd | grep news
news:x:9:9:news:/var/spool/news:/usr/sbin/nologin

In the telnet session:

authinfo user test
502 Authentication will fail
authinfo pass test
502 Authentication will fail

What am I missing?
Re: INN2 set up user authentication via ckpasswd
#92253
Author: Julien ÉLIE
Date: Mon, 14 Jul 2025 05:00
51 lines
2641 bytes
Hi,

> I added this to readers.conf:
> 
> auth: "/usr/lib/news/bin/auth/passwd/ckpasswd -f /etc/news/userdb"

What is the whole contents of your readers.conf file?
It needs at least something like:

auth "users" {
     auth: "ckpasswd -f /etc/news/userdb"
     default: "<unauthenticated>"
}

access "authenticatedpeople" {
     users: "*"
     newsgroups: "*"
}

access "restrictive" {
     users: "<unauthenticated>"
     newsgroups: "!*"
}

See https://www.eyrie.org/~eagle/software/inn/docs/readers.conf.html
The rights for authenticated people (and for unauthenticated people) 
have to be explained.


> I created a test user and got auth failure.

Here, if you successfully authenticate with the "test" user, his 
assigned identity is "test" in the "users" keyword of access blocks. 
When authentication fails, the identity is "<unauthenticated>" (the 
default value of the auth block).


> ~ htpasswd -nbd test test > /etc/news/userdb

More secure hashes are recommended, like ones obtained with:
     openssl passwd -5 test

   https://www.eyrie.org/~eagle/software/inn/docs/ckpasswd.html

-- 
Julien ÉLIE

« – Hou hou !
   – Ouille, ouille !
   – Ouf !
   – Où ouf ? » (Astérix)
Re: INN2 set up user authentication via ckpasswd
#92271
Author: Anonymous
Date: Tue, 15 Jul 2025 02:40
66 lines
3375 bytes
On Mon, 14 Jul 2025 07:00:16 +0200
Julien ÉLIE <iulius@nom-de-mon-site.com.invalid> wrote:

> Hi,
> 
> > I added this to readers.conf:
> > 
> > auth: "/usr/lib/news/bin/auth/passwd/ckpasswd -f /etc/news/userdb"  
> 
> What is the whole contents of your readers.conf file?
> It needs at least something like:
> 
> auth "users" {
>      auth: "ckpasswd -f /etc/news/userdb"
>      default: "<unauthenticated>"
> }
> 
> access "authenticatedpeople" {
>      users: "*"
>      newsgroups: "*"
> }
> 
> access "restrictive" {
>      users: "<unauthenticated>"
>      newsgroups: "!*"
> }

I pasted this into readers.conf, removing all other lines. I still get the message, "authentication will fail."

> 
> See https://www.eyrie.org/~eagle/software/inn/docs/readers.conf.html
> The rights for authenticated people (and for unauthenticated people) 
> have to be explained.

It's not that I need an explanation of the rights--I need an explanation of configuration that will actually work. An example of a working configuration that is working in real life on an active install would be helpful.


> > I created a test user and got auth failure.  
> 
> Here, if you successfully authenticate with the "test" user, his 
> assigned identity is "test" in the "users" keyword of access blocks. 
> When authentication fails, the identity is "<unauthenticated>" (the 
> default value of the auth block).
> 
> 
> > ~ htpasswd -nbd test test > /etc/news/userdb  
> 
> More secure hashes are recommended, like ones obtained with:
>      openssl passwd -5 test
> 
>    https://www.eyrie.org/~eagle/software/inn/docs/ckpasswd.html

My goals are simple:

Nobody can post without having a entry in the user list. Only I can create such an entry. No PAM, no shadows, just a list of usernames and password hashes is all I want, so that INN2 will check against this list and deny access to any not included in the list.

At this point, after looking at the documention, it appears there is not enough information to proceed. I have already spent an inordinate amount of time poking around and this is where I am stuck.
[solved] INN2 set up user authentication via ckpasswd
#92270
Author: Anonymous
Date: Tue, 15 Jul 2025 03:35
25 lines
2164 bytes
Authentication works with the below configuration in readers.conf. Authentication also works with the commented lines uncommented. I suppose INN is choosing the first one that applies? Anyway I consider this issue mostly solved. Any pointers on a cleaner config would be appreciated.

I needed to include the full path to ckpasswd as it is not in system path. I also needed to make sure I was entering into mode reader before authenticating.

Thank you, Julien, for the help and the copious documentation. I will follow your advice for a more secure password hashing scheme. The default one does look rather weak.

auth "foreignokay" {
auth: "/usr/lib/news/bin/auth/passwd/ckpasswd -f /etc/news/userdb"
default: "<unauthenticated>"
}

access "authenticatedpeople" {
users: "*"
newsgroups: "*"
}

# auth "users" {
# auth: "/usr/lib/news/bin/auth/passwd/ckpasswd -f /etc/news/userdb"
# default: "<unauthenticated>"
# }

access "restrictive" {
users: "<unauthenticated>"
newsgroups: "!*"
}
Re: [solved] INN2 set up user authentication via ckpasswd
#92303
Author: Julien ÉLIE
Date: Wed, 16 Jul 2025 05:09
49 lines
3116 bytes
Hi,

> Authentication works with the below configuration in readers.conf.
> I suppose INN is choosing the first one that applies ?

Glad to hear that!
Both authentication and access blocks are checked from the *last* one in 
the readers.conf file to the first one (bottom up).  As soon as one 
matches, the corresponding identity or access is assigned to the user.


> I needed to include the full path to ckpasswd as it is not in system path.

Strange.  There's normally no need in having the full path in system 
path as you seem to use the default one (/usr/lib/news/bin/auth/passwd) 
which is hard-coded in INN:

     tmp = concatpath(innconf->pathbin, INN_PATH_AUTHDIR);
     resdir = concatpath(tmp, INN_PATH_AUTHDIR_PASSWD);
     auth_external(&Client, command, resdir, username, password);


I suppose pathbin in inn.conf is "/usr/lib/news/bin".
Then the "auth" and "passwd" subdirectories are added to this path, and 
your ckpasswd program is started from there by default when no full path 
is given.


> I also needed to make sure I was entering into mode reader before authenticating.

Ah, that was it!
Indeed, you need being in reader mode.  Sorry I did not spot that as I 
did not know the whole NNTP session.  The greeting banner would have 
been of help.

FWIW, authentication in transit mode is parametered in incoming.conf 
(see the password parameter) and applies to your peers.


> I will follow your advice for a more secure password hashing scheme.
> The default one does look rather weak.

Yes.

-- 
Julien ÉLIE

« Ma femme prétend que je n'écoute jamais ce qu'elle dit… enfin… un truc
   comme ça. » (Chevy Chase)
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads