🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.nntp
9 messages
9 total messages Started by Jason Evans Sat, 10 Oct 2020 14:10
readers.conf authentication
#88492
Author: Jason Evans
Date: Sat, 10 Oct 2020 14:10
38 lines
1851 bytes
Hi all,

I recently set up my first news server. I'm no longer having any problems 
with configuring peers and everything seems to be working, but I can't get 
external authentication working. Right now, I am accessing the server via 
ssh and using alpine locally.

I would like to authenticate against /etc/shadow. I plan on only having a 
handful of trusted external users, so I'm not too concerned with the 
security issues with this. Here is my configuration in 
/etc/news/readers.conf for external users:

     auth worldwide {
         hosts: "*"
         auth: "ckpasswd -s"
         default: <unauthenticated>
     }


     access authenticated {                # people with passwords
         users: "*"
         read: "*"
         post: "*"
     }

     access special {                      # people with extra access
         users: "tux"
         newsgroups: "*"
     }

I have also set the guid for the shadow group to ckpassd and I have 
created /etc/pam.d/nnrpd with what I think is the correct information 
based on documentation and man pages.

Any input would be appreciated.

--
JE
Re: readers.conf authentication
#88495
Author: Julien ÉLIE
Date: Sat, 10 Oct 2020 15:34
60 lines
2754 bytes
Hi Jason,

> Here is my configuration in 
> /etc/news/readers.conf for external users:
> 
>      auth worldwide {
>          hosts: "*"
>          auth: "ckpasswd -s"
>          default: <unauthenticated>
>      }
> 
> 
>      access authenticated {                # people with passwords
>          users: "*"
>          read: "*"
>          post: "*"
>      }
> 
>      access special {                      # people with extra access
>          users: "tux"
>          newsgroups: "*"
>      }

Note that you should add something for unauthenticated users, at the 
very bottom of the readers.conf file:

     access fail {
         users: "<unauthenticated>,<unauthenticated>@*"
         newsgroups: "!*"
     }



> I have also set the guid for the shadow group to ckpassd and I have 
> created /etc/pam.d/nnrpd with what I think is the correct information 
> based on documentation and man pages.

Did you reload/restart INN to take into account new configuration?

Anything in your news.err or news.notice log files?


Does access correctly work with

      auth test {
          hosts: "*"
          default: <ok>
      }
      access test {
          users: "<ok>"
          newsgroups: "local.test"  # or any other newsgroup you have
      }

To see whether you have access to this newsgroup only.

-- 
Julien ÉLIE

« Je suis adroit de la main gauche et je suis gauche de la main
   droite. » (Raymond Devos)
Re: readers.conf authentication
#88494
Author: Russ Allbery
Date: Sat, 10 Oct 2020 17:18
28 lines
2012 bytes
Jason Evans <jsevans@theuse.net> writes:

> I recently set up my first news server. I'm no longer having any
> problems with configuring peers and everything seems to be working, but
> I can't get external authentication working. Right now, I am accessing
> the server via ssh and using alpine locally.

> I would like to authenticate against /etc/shadow. I plan on only having
> a handful of trusted external users, so I'm not too concerned with the
> security issues with this.

I'm not sure if this is the problem, but given that you've already set up
PAM authentication, you want just ckpasswd, not ckpasswd -s.  Requesting
authentication against /etc/shadow with -s disables support for PAM
authentication.  (This isn't entirely clear from the documentation.)

PAM will take care of changing privileges so that it can check the
password against /etc/shadow, so you don't have to mess around with
permissions, which are easy to get wrong.

These days, the -s option is probably only useful for systems that don't
have PAM.

-- 
Russ Allbery (eagle@eyrie.org)             <https://www.eyrie.org/~eagle/>

          Please post questions rather than mailing me directly.
     <https://www.eyrie.org/~eagle/faqs/questions.html> explains why.
Re: readers.conf authentication
#88496
Author: Grant Taylor
Date: Sat, 10 Oct 2020 17:28
41 lines
1751 bytes
On 10/10/20 8:10 AM, Jason Evans wrote:
> Hi all,

Hi,

> Any input would be appreciated.

The only thing that I can mention -- in my current under caffeinated 
state -- is that -- I think -- you need both auth and access sections 
for each group of users.

auth GroupA {
    ...
}
access GroupA {
    ...
}

auth GrouB {
    ...
}
access GroupB {
    ...
}

auth ... {
    ...
}
access ... {
    ...
}

My understanding is that auth validates that the user is whom they are 
claiming to be and that access then specifies what that validated user 
is allowed to do.  They come in pairs like mittens and shoes.



-- 
Grant. . . .
unix || die
Re: readers.conf authentication
#88497
Author: The Doctor
Date: Sat, 10 Oct 2020 22:16
74 lines
2980 bytes
In article <rlsk9o$k3j$1@news.trigofacile.com>,
Julien à LIE  <iulius@nom-de-mon-site.com.invalid> wrote:
>Hi Jason,
>
>> Here is my configuration in 
>> /etc/news/readers.conf for external users:
>> 
>>      auth worldwide {
>>          hosts: "*"
>>          auth: "ckpasswd -s"
>>          default: <unauthenticated>
>>      }
>> 
>> 
>>      access authenticated {                # people
>with passwords
>>          users: "*"
>>          read: "*"
>>          post: "*"
>>      }
>> 
>>      access special {                      #
>people with extra access
>>          users: "tux"
>>          newsgroups: "*"
>>      }
>
>Note that you should add something for unauthenticated users, at the 
>very bottom of the readers.conf file:
>
>     access fail {
>         users: "<unauthenticated>,<unauthenticated>@*"
>         newsgroups: "!*"
>     }
>
>
>
>> I have also set the guid for the shadow group to ckpassd and I have 
>> created /etc/pam.d/nnrpd with what I think is the correct information 
>> based on documentation and man pages.
>
>Did you reload/restart INN to take into account new configuration?
>
>Anything in your news.err or news.notice log files?
>
>
>Does access correctly work with
>
>      auth test {
>          hosts: "*"
>          default: <ok>
>      }
>      access test {
>          users: "<ok>"
>          newsgroups: "local.test"  # or any other newsgroup you have
>      }
>
>To see whether you have access to this newsgroup only.
>

I have been trying this for years.

>-- 
>Julien ÉLIE
>
>« Je suis adroit de la main gauche et je suis gauche de la main
>   droite. » (Raymond Devos)


-- 
Member - Liberal International This is doctor@@nl2k.ab.ca Ici doctor@@nl2k.ab.ca
Yahweh, Queen & country!Never Satan President Republic!Beware AntiChrist rising!
Look at Psalms 14 and 53 on Atheism https://www.empire.kred/ROOTNK?t=94a1f39b  
BC save the Province; on 24 October 2020, vote Liberal and not NDP!
Re: readers.conf authentication
#88498
Author: Julien ÉLIE
Date: Sat, 10 Oct 2020 22:40
25 lines
2121 bytes
Hi Russ,

> I'm not sure if this is the problem, but given that you've already set up
> PAM authentication, you want just ckpasswd, not ckpasswd -s.  Requesting
> authentication against /etc/shadow with -s disables support for PAM
> authentication.  (This isn't entirely clear from the documentation.)

Oh, you're totally right that the readers.conf man page is very 
confusing about that.  I'll have a look to fix that.

Jason, you should have a look to the ckpasswd man page:
   https://www.eyrie.org/~eagle/software/inn/docs/ckpasswd.html


There is even a command-line example to manually test ckpasswd:

     (echo 'ClientAuthname: test' ; echo 'ClientPassword: testing') \
         | ckpasswd -f /path/to/passwd/file
(or -s, or without any option)

-- 
Julien ÉLIE

« Pour aller plus vite, j'additionne toujours de bas en haut : je fais
   du même coup l'addition et la preuve. » (Aurélien Scholl)
Re: readers.conf authentication
#88499
Author: Jason Evans
Date: Sun, 11 Oct 2020 06:09
15 lines
1588 bytes
On Sun, 11 Oct 2020 00:40:55 +0200, Julien ÉLIE wrote:

>      (echo 'ClientAuthname: test' ; echo 'ClientPassword: testing') \
>          | ckpasswd -f /path/to/passwd/file
> (or -s, or without any option)

This was the key that helped a lot. I had been going over the man page 
but I missed this test. I found out that even thought I *thought* I had 
set the setgid on ckpasswd, I hadn't actually. When I when back and tried 
again, the test command started working instead of giving me "ckpasswd: 
pam_authenticate failed: Authentication failure".

It works now. Thanks again, everyone!

JE
Re: readers.conf authentication
#88500
Author: Julien ÉLIE
Date: Sun, 11 Oct 2020 06:57
25 lines
2234 bytes
Hi Jason,
>>       (echo 'ClientAuthname: test' ; echo 'ClientPassword: testing') \
>>           | ckpasswd -f /path/to/passwd/file
>> (or -s, or without any option)
> 
> This was the key that helped a lot. I had been going over the man page
> but I missed this test. I found out that even thought I *thought* I had
> set the setgid on ckpasswd, I hadn't actually. When I when back and tried
> again, the test command started working instead of giving me "ckpasswd:
> pam_authenticate failed: Authentication failure".
> 
> It works now. Thanks again, everyone!

Good news that authentication now works fine!
Do not forget the rule for <unauthenticated> users in your readers.conf 
file.

Instead of setting the setgid on ckpasswd, didn't you test the ckpasswd 
command without the "-s" argument as Russ suggested?

-- 
Julien ÉLIE

« Pour aller plus vite, j'additionne toujours de bas en haut : je fais
   du même coup l'addition et la preuve. » (Aurélien Scholl)
Re: readers.conf authentication
#88501
Author: Jason Evans
Date: Sun, 11 Oct 2020 09:45
29 lines
2134 bytes
On Sun, 11 Oct 2020 08:57:12 +0200, Julien ÉLIE wrote:

> Good news that authentication now works fine!
> Do not forget the rule for <unauthenticated> users in your readers.conf
> file.
> 

I added it and restarted the inn service.

> Instead of setting the setgid on ckpasswd, didn't you test the ckpasswd
> command without the "-s" argument as Russ suggested?

I tried the test command with and without the -s flag. It worked without 
it, but wouldn't work with it.

I then created a new temp user to see if it worked for him also. Only 
when I ran the command against the temp user as root did it work. It 
wouldn't work if I ran the command against him as myself or even it as 
the "news" user. 

After I set the setgid on ckpasswd then I was able to successfully run 
the test on myself and the test user without needing to be root.

My next task is to get ssl working. I've already generated the 
certificates with letsencrypt and I've updated inn.conf to point to them. 
I just need to research further on how to actually enable the nntps port.

__
JE
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