<?xml version="1.0" encoding="UTF-8" ?>

<bugzilla version="5.2"
          urlbase="https://bugzilla.altlinux.org/"
          
          maintainer="jenya@basealt.ru"
>

    <bug>
          <bug_id>45272</bug_id>
          
          <creation_ts>2023-02-14 14:33:22 +0300</creation_ts>
          <short_desc>Не работает аутентификация pam</short_desc>
          <delta_ts>2026-02-03 16:17:36 +0300</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>4</classification_id>
          <classification>Development</classification>
          <product>Sisyphus</product>
          <component>freeradius</component>
          <version>unstable</version>
          <rep_platform>x86_64</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>WORKSFORME</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P5</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Elena Mishina">lepata</reporter>
          <assigned_to name="Alexey Shabalin">shaba</assigned_to>
          <cc>grenka</cc>
    
    <cc>shaba</cc>
    
    <cc>vetal.davv</cc>
          
          <qa_contact>qa-sisyphus</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>221651</commentid>
    <comment_count>0</comment_count>
    <who name="Elena Mishina">lepata</who>
    <bug_when>2023-02-14 14:33:22 +0300</bug_when>
    <thetext>При настройке PAM аутентификации:
Если запускать radius как сервис, то аутентификация не работает, в логах:
# systemctl start radiusd.service
$ radtest user 123 localhost 1218 testing123
Access-Reject

radiusd[4098]: pam_tcb(radiusd:auth): Credentials for user user unknown
radiusd[3826]: pam_tcb(radiusd:auth): Authentication failed for UNKNOWN USER from (uid=460)


Если запустить radiusd в режиме отладки, то аутентификация работает:
# radiusd

$ radtest user 123 localhost 1218 testing123
Access-Accept

radiusd[4119]: pam_tcb(radiusd:auth): Authentication passed for user from user(uid=0)

Вся разница в том, что в первом случае radiusd, запущен от пользователя radiusd
а во втором от root.

В файле /etc/raddb/radiusd.conf, можно было бы задать пользователя/группу от чьего имени запускать radiusd, но только в том случае, если служба запускается от root, иначе при изменении имени/группы в /etc/raddb/radiusd.conf, служба не стартует.

Из файла /etc/raddb/radiusd.conf:
«Radiusd is run as the name of this user.
    If commented out, the server will run as the user that started it. In order to change to a different user, the server MUST be started as root (or have root privileges).
 On systems with shadow passwords, group = shadow might need to be set for the server to be able to read the shadow password file. If users can be authenticated while in debug mode, but not while in daemon mode, then it may be that the debugging mode server is running as a user that can read the shadow info and that the user listed below cannot.»

Можно сделать так, чтобы в настройках службы был указан root, а в файле /etc/raddb/radiusd.conf:
user = radiusd
group = radiusd
?
Тогда и служба будет по умолчанию запущена от radiusd и редактировать только конфиг radiusd можно будет.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>281376</commentid>
    <comment_count>1</comment_count>
    <who name="Виталий">vetal.davv</who>
    <bug_when>2026-02-03 16:17:36 +0300</bug_when>
    <thetext>Не хватает прав на файлы /etc/tcb/.../shadow.
У них  права -группа auth на чтение.
Добавляем юзера radiusd в группу auth и все работает.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>