The OpenNET Project / Index page

[ новости /+++ | форум | теги | ]

форумы  помощь  поиск  регистрация  майллист  вход/выход  слежка  RSS
"NX + LDAP + PAM_MOUNT"
Вариант для распечатки  
Пред. тема | След. тема 
Форум Открытые системы на сервере (Linux привязка / Linux)
Изначальное сообщение [ Отслеживать ]

"NX + LDAP + PAM_MOUNT"  +/
Сообщение от merlin.metso (ok) on 23-Дек-11, 20:45 
Доброго времени суток.

Появилась необходимость пересадить пользователей с Windows на Linux. Сейчас все работают на терминальном сервере Windows_2003 с тонких бездисковых клиентов. Используют 1с_8.2 + Офис. Профили, несколько дисков и "Мои Документы" монтируются по сети.

Для перехода был выбран вариант:
- терминальный сервер под Ubuntu_10.04_x64
- RX@Etersoft
- Wine@Etersoft
- тонкие клиенты на ThinStation-2.2.2h.
- аутентификация через LDAP сервер
- монтирование папки "Мои Документы" и нескольких "Дисков (W:,Z:...)", они нужны в Wine чтобы 1С могла с них доставать файлы, по сети.

Тонкого клиента собрал, аутентификацию в LDAP с созданием Хомяка (дом. папки) для нового пользователя сделал,..., осталось лишь монтировать сетевые Шары для пользователя. Для этого был выбран и настроен pam_mount. Но вот беда- после настройки pam_mount команда

sudo nxserver -- terminate username

перестала работать и начала выдавать

************************************************************************************
iddqd@xTerminal:~$ sudo nxserver --terminate testuser
NX> 100 NXSERVER - Version 3.2.0-74-SVN OS (GPL, using backend: 3.4.0)
reenter password for pam_mount:NX> 1000 NXNODE - Version 3.2.0-74-SVN OS (GPL, using backend: 3.4.0)
NX> 500 Error: Fatal - Missing parameter session id.
NX> 716 Terminating session  on user request.
rm: невозможно удалить «/tmp/.X0-lock»: Операция не позволяется
rm: невозможно удалить «/tmp/.X2030-lock»: Операция не позволяется
rm: невозможно удалить «/tmp/.X11-unix/X0»: Операция не позволяется
rm: невозможно удалить «/tmp/.X11-unix/X2030»: Операция не позволяется
NX> 1001 Bye.
pam_mount(spawn.c:101): error setting uid to 0
NX> 999 Bye
************************************************************************************

при этом сессия "висит" и никак не убивается, помогает только ПЕРЕЗАГРУЗКА. Впрочем после перезагрузки всё встает на свои места. Если отключить pam_mount в /etc/pad.d/common-sesson то сессия убивается через nxserver -- terminate, но это же "костыли" какие то.

Впринципе сейчас все работает, но запускать систему в продакшн при невозможности убить NX-сессию очень не хочется. Ведь как бы ни был надежен Linux но иногда сессии NX всё же приходится убивать ручками :(

Конфиги прилагаю.


/etc/pam.d/common-session
********************************************************************************
#
# /etc/pam.d/common-session - session-related modules common to all services
#
# This file is included from other service-specific PAM config files,
# and should contain a list of modules that define tasks to be performed
# at the start and end of sessions of *any* kind (both interactive and
# non-interactive).
#
# As of pam 1.0.1-6, this file is managed by pam-auth-update by default.
# To take advantage of this, it is recommended that you configure any
# local modules either before or after the default block, and use
# pam-auth-update to manage selection of other modules.  See
# pam-auth-update(8) for details.

# pre_auth-client-config # # here are the per-package modules (the "Primary" block)
# pre_auth-client-config # session      [default=1]                     pam_permit.so
# pre_auth-client-config # # here's the fallback if no module succeeds
# pre_auth-client-config # session      requisite                       pam_deny.so
# prime the stack with a positive return value if there isn't one already;
# this avoids us returning an error just because nothing sets a success code
# since the modules above will each just jump around
# pre_auth-client-config # session      required                        pam_permit.so
# pre_auth-client-config # # and here are more per-package modules (the "Additional" block)
# pre_auth-client-config # session      required        pam_unix.so
# pre_auth-client-config # session      optional                        pam_ldap.so
# pre_auth-client-config # session      optional                        pam_ck_connector.so nox11
# pre_auth-client-config # # end of pam-auth-update config
session required pam_limits.so
session required pam_mkhomedir.so skel=/etc/skel/
session required pam_unix.so
session optional pam_ldap.so
session optional pam_mount.so
********************************************************************************


/etc/pam.d/common-auth
********************************************************************************
#
# /etc/pam.d/common-auth - authentication settings common to all services
#
# This file is included from other service-specific PAM config files,
# and should contain a list of the authentication modules that define
# the central authentication scheme for use on the system
# (e.g., /etc/shadow, LDAP, Kerberos, etc.).  The default is to use the
# traditional Unix authentication mechanisms.
#
# As of pam 1.0.1-6, this file is managed by pam-auth-update by default.
# To take advantage of this, it is recommended that you configure any
# local modules either before or after the default block, and use
# pam-auth-update to manage selection of other modules.  See
# pam-auth-update(8) for details.

# pre_auth-client-config # # here are the per-package modules (the "Primary" block)
# pre_auth-client-config # auth [success=2 default=ignore]      pam_unix.so nullok_secure
# pre_auth-client-config # auth [success=1 default=ignore]      pam_ldap.so use_first_pass
# pre_auth-client-config # # here's the fallback if no module succeeds
# pre_auth-client-config # auth requisite                       pam_deny.so
# prime the stack with a positive return value if there isn't one already;
# this avoids us returning an error just because nothing sets a success code
# since the modules above will each just jump around
# pre_auth-client-config # auth required                        pam_permit.so
# pre_auth-client-config # # and here are more per-package modules (the "Additional" block)
# pre_auth-client-config # # end of pam-auth-update config
auth required pam_env.so
auth [default=2 success=ignore]         pam_unix.so # likeauth nullok
auth [default=1 success=ignore]         pam_ldap.so use_first_pass
auth requisite          pam_deny.so
auth optional           pam_mount.so
********************************************************************************

/etc/security/pam_mount.conf.xml
********************************************************************************
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE pam_mount SYSTEM "pam_mount.conf.xml.dtd">
<!--
    See pam_mount.conf(5) for a description.
-->

<pam_mount>

        <!-- debug should come before everything else,
        since this file is still processed in a single pass
        from top-to-bottom -->

<debug enable="0" />

        <!-- Volume definitions -->


        <!-- pam_mount parameters: General tunables -->

<!--
<luserconf name=".pam_mount.conf.xml" />
-->

<!-- Note that commenting out mntoptions will give you the defaults.
     You will need to explicitly initialize it with the empty string
     to reset the defaults to nothing. -->
<mntoptions allow="nosuid,nodev,loop,encryption,fsck,nonempty,allow_root,allow_other" />
<!--
<mntoptions deny="suid,dev" />
<mntoptions allow="*" />
<mntoptions deny="*" />
-->
<mntoptions require="nosuid,nodev" />
<path>/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin</path>

<logout wait="2000" hup="0" term="0" kill="0" />


        <!-- pam_mount parameters: Volume-related -->
<volume
    user="*"  
    fstype="cifs"
    server="server_IP"
    path="UsersDoc/%(USER)"
    mountpoint="/server/usersdoc/%(USER)"
    options="iocharset=utf8,nocase,nosuid,nodev,noexec,noperm,nounix,domain=assist.corp"
/>


<mkmountpoint enable="1" remove="true" />


</pam_mount>
********************************************************************************

Уже не знаю куда копать. Буду благодарен за помощь.

PS. Если есть способы выполнить поставленную задачу без pam_mount буду рассмотривать их. Мне главное чтобы пользователь мог работать и безопасность не страдала :)

Ответить | Правка | Cообщить модератору

Оглавление

Сообщения по теме [Сортировка по времени | RSS]


1. "NX + LDAP + PAM_MOUNT"  +/
Сообщение от ACCA (ok) on 24-Дек-11, 10:03 
> /etc/pam.d/common-session

[...]
> session required pam_unix.so
> session optional pam_ldap.so

--- session optional pam_mount.so
+++ session optional pam_mount.so try_first_pass


[...]

> /etc/pam.d/common-auth

[...]
> auth [default=1 success=ignore]         pam_ldap.so use_first_pass
> auth requisite          pam_deny.so

--- auth optional  pam_mount.so
+++ auth optional  pam_mount.so try_first_pass


https://bugs.launchpad.net/ubuntu/+source/pam/+bug/117736

Ответить | Правка | ^ к родителю #0 | Наверх | Cообщить модератору

2. "NX + LDAP + PAM_MOUNT"  +/
Сообщение от merlin.metso (ok) on 26-Дек-11, 13:32 
Спасибо за ответ, но добавление try_first_pass в файле common-session и common-auth не помогло. Более того в common-session ОС ругается на неизвестный параметр :(

По ссылке описана немного не моя Бага. В моем случае logout происходит без проблем (по крайней мере пользователь "отпускается", и сессия не "висит"). В моем случае проблемы начинаются при попытке "убить" сессию командой

nxserver-- terminate

Хотя конечно грустно, что у Убунты есть такие "долгоиграющие" баги :(

Может у кого-нибудь еще мысли по этому поводу?

Ответить | Правка | ^ к родителю #1 | Наверх | Cообщить модератору

3. "NX + LDAP + PAM_MOUNT"  +/
Сообщение от merlin.metso (ok) on 26-Дек-11, 19:04 
Я уже pam_mount пересобрал из исходников. Стоял 1.32 я поставил 2.9- все равно не помогает.

Может кто подскажет в какую сторону копать?

Ответить | Правка | ^ к родителю #2 | Наверх | Cообщить модератору

4. "NX + LDAP + PAM_MOUNT"  +/
Сообщение от s.bsa on 25-Апр-12, 10:14 
> Я уже pam_mount пересобрал из исходников. Стоял 1.32 я поставил 2.9- все
> равно не помогает.
> Может кто подскажет в какую сторону копать?

Если ещё актуально, то я решил так:

В common-auth перед pam_mount добавить:
auth [default=1 success=ignore] pam_succeed_if.so quiet service != su

В common-session перед pam_mount добавить:
session [default=1 success=ignore] pam_succeed_if.so quiet service != su

В common-session-noninteractive добавить
session [default=1 success=ignore] pam_succeed_if.so quiet service != su

Ответить | Правка | ^ к родителю #3 | Наверх | Cообщить модератору

Архив | Удалить

Рекомендовать для помещения в FAQ | Индекс форумов | Темы | Пред. тема | След. тема




Партнёры:
PostgresPro
Inferno Solutions
Hosting by Hoster.ru
Хостинг:

Закладки на сайте
Проследить за страницей
Created 1996-2024 by Maxim Chirkov
Добавить, Поддержать, Вебмастеру