ALT Linux Sisyphus discussions
 help / color / mirror / Atom feed
* [sisyphus] Inappropriate ioctl with PAM
@ 2003-03-21  9:52 Grigory Batalov
  2003-03-21 11:28 ` Владимир
  0 siblings, 1 reply; 2+ messages in thread
From: Grigory Batalov @ 2003-03-21  9:52 UTC (permalink / raw)
  To: sisyphus

Hi!
Я собрал себе mod_auth_pam для apache, хочу сквозную
аутентификацию сделать. Но не работает.
Взято отсюда: http://pam.sourceforge.net/mod_auth_pam/
плюс патчи из мэйл-листа.

Сделаны следующие настройки:

# less /etc/httpd/conf/httpd.conf
---
User apache
Group apache
...
LoadModule pam_auth_module        modules/mod_auth_pam.so
LoadModule auth_module        modules/mod_auth.so
...
AddModule mod_auth_pam.c
AddModule mod_auth.c
...
<Directory "/var/www/html">
    Options Indexes Includes FollowSymLinks MultiViews
    AllowOverride AuthConfig
    Order allow,deny
    Allow from all

    <Files index.shtml.ru.*>
        <IfModule mod_charset.c>
            CharsetDisable On
        </IfModule>
    </Files>
</Directory>
---

Т.е. модуль подключен, аутентификация через PAM разрешена
(см. лог ниже).

$ ls -l /etc/pam.d/httpd 
-rw-r--r--    1 root     root          156 Мар 21 12:22 /etc/pam.d/httpd

$ cat /etc/pam.d/httpd 
---
#%PAM-1.0
auth       required     /lib/security/pam_stack.so debug service=system-auth
account    required     /lib/security/pam_stack.so debug service=system-auth
---

Т.е. /etc/pam.d/httpd читаем всеми.

$ cat /var/www/html/secure/.htaccess 
---
AuthPAM_Enabled on
AuthPAM_FallThrough off
AuthType Basic
AuthName "By Invitation Only"
Require user bga
---

Требуется быть 'bga' для прохождения аутентификации.
При обращении к директории http://localhost/secure/
выдаётся запрос пароля. В логах следующее:

# cat /etc/httpd/logs/access_log 
---
127.0.0.1 - bga [21/Mar/2003:12:28:00 +0300] "GET /secure/ HTTP/1.0" 401 467
---

# cat /etc/httpd/logs/error_log 
---
[Fri Mar 21 12:27:43 2003] [notice] Apache/1.3.27 (ALT Linux/alt13bga) mod_auth_pam/1.1.2b rus/PL30.16 configured -- resuming normal operations
[Fri Mar 21 12:27:43 2003] [notice] Accept mutex: sysvsem (Default: sysvsem)
[Fri Mar 21 12:28:00 2003] [error] [client 127.0.0.1] (25)Inappropriate ioctl for device: PAM: user 'bga' - not authenticated: Authentication service cannot retrieve authentication info.
---

# less /var/log/messages
...
Mar 21 12:27:58 bga pam_tcb[16293]: Credentials for user bga unknown
Mar 21 12:27:58 bga pam_tcb[16285]: httpd: Authentication failed for UNKNOWN USER from (uid=96)
...

Таким образом, запрос к PAM уходит (uid 96 == apache), а что
дальше - не понятно. Немного поковырявшись, дошёл до вызова
pam_authenticate(..., ...), который возвращает ошибку.

----------------------------------------------------------
Вопрос: что за (25)Inappropriate ioctl for device, где его
можно исправить, в каком направлении патчить mod_auth_pam,
чтобы он вписывался в Master 2.2 без напильника ?

-- 
 Баталов Григорий,
 системный администратор
 ОАО "Ковдорский ГОК"


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [sisyphus] Inappropriate ioctl with PAM
  2003-03-21  9:52 [sisyphus] Inappropriate ioctl with PAM Grigory Batalov
@ 2003-03-21 11:28 ` Владимир
  0 siblings, 0 replies; 2+ messages in thread
From: Владимир @ 2003-03-21 11:28 UTC (permalink / raw)
  To: sisyphus

Grigory Batalov пишет:

>Hi!
>Я собрал себе mod_auth_pam для apache, хочу сквозную
>аутентификацию сделать. Но не работает.
>Взято отсюда: http://pam.sourceforge.net/mod_auth_pam/
>плюс патчи из мэйл-листа.
>
>Сделаны следующие настройки:
>
># less /etc/httpd/conf/httpd.conf
>---
>User apache
>Group apache
>...
>LoadModule pam_auth_module        modules/mod_auth_pam.so
>LoadModule auth_module        modules/mod_auth.so
>...
>AddModule mod_auth_pam.c
>AddModule mod_auth.c
>...
><Directory "/var/www/html">
>    Options Indexes Includes FollowSymLinks MultiViews
>    AllowOverride AuthConfig
>    Order allow,deny
>    Allow from all
>
>    <Files index.shtml.ru.*>
>        <IfModule mod_charset.c>
>            CharsetDisable On
>        </IfModule>
>    </Files>
></Directory>
>---
>
>Т.е. модуль подключен, аутентификация через PAM разрешена
>(см. лог ниже).
>
>$ ls -l /etc/pam.d/httpd 
>-rw-r--r--    1 root     root          156 Мар 21 12:22 /etc/pam.d/httpd
>
>$ cat /etc/pam.d/httpd 
>---
>#%PAM-1.0
>auth       required     /lib/security/pam_stack.so debug service=system-auth
>account    required     /lib/security/pam_stack.so debug service=system-auth
>---
>
>Т.е. /etc/pam.d/httpd читаем всеми.
>
>$ cat /var/www/html/secure/.htaccess 
>---
>AuthPAM_Enabled on
>AuthPAM_FallThrough off
>AuthType Basic
>AuthName "By Invitation Only"
>Require user bga
>---
>
>Требуется быть 'bga' для прохождения аутентификации.
>При обращении к директории http://localhost/secure/
>выдаётся запрос пароля. В логах следующее:
>
># cat /etc/httpd/logs/access_log 
>---
>127.0.0.1 - bga [21/Mar/2003:12:28:00 +0300] "GET /secure/ HTTP/1.0" 401 467
>---
>
># cat /etc/httpd/logs/error_log 
>---
>[Fri Mar 21 12:27:43 2003] [notice] Apache/1.3.27 (ALT Linux/alt13bga) mod_auth_pam/1.1.2b rus/PL30.16 configured -- resuming normal operations
>[Fri Mar 21 12:27:43 2003] [notice] Accept mutex: sysvsem (Default: sysvsem)
>[Fri Mar 21 12:28:00 2003] [error] [client 127.0.0.1] (25)Inappropriate ioctl for device: PAM: user 'bga' - not authenticated: Authentication service cannot retrieve authentication info.
>---
>
># less /var/log/messages
>...
>Mar 21 12:27:58 bga pam_tcb[16293]: Credentials for user bga unknown
>Mar 21 12:27:58 bga pam_tcb[16285]: httpd: Authentication failed for UNKNOWN USER from (uid=96)
>...
>
>Таким образом, запрос к PAM уходит (uid 96 == apache), а что
>дальше - не понятно. Немного поковырявшись, дошёл до вызова
>pam_authenticate(..., ...), который возвращает ошибку.
>
>----------------------------------------------------------
>Вопрос: что за (25)Inappropriate ioctl for device, где его
>можно исправить, в каком направлении патчить mod_auth_pam,
>чтобы он вписывался в Master 2.2 без напильника ?
>
>  
>

Если мне не изменяет память, то для нормальной работы через pam 
требуется ставить
минимум GID бит.


-- 
Best regards
Vladimir




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-03-21 11:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-03-21  9:52 [sisyphus] Inappropriate ioctl with PAM Grigory Batalov
2003-03-21 11:28 ` Владимир

ALT Linux Sisyphus discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/sisyphus/0 sisyphus/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 sisyphus sisyphus/ http://lore.altlinux.org/sisyphus \
		sisyphus@altlinux.ru sisyphus@altlinux.org sisyphus@lists.altlinux.org sisyphus@lists.altlinux.ru sisyphus@lists.altlinux.com sisyphus@linuxteam.iplabs.ru sisyphus@list.linux-os.ru
	public-inbox-index sisyphus

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.sisyphus


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git