From: "Денис Черносов" <denis0.ru@gmail.com> To: ALT Linux Community general discussions <community@lists.altlinux.org> Subject: Re: [Comm] "pam_mount password:" - неаккуратненько как-то Date: Mon, 22 Jun 2009 11:41:36 +0500 Message-ID: <d77783290906212341n3ab5be5fna1e6030eb00aac59@mail.gmail.com> (raw) In-Reply-To: <20090619233836.GA15680@wo.int.altlinux.org> 20 июня 2009 г. 4:38 пользователь Dmitry V. Levin (ldv@altlinux.org) написал: > On Fri, Jun 19, 2009 at 11:46:36AM +0500, Денис Черносов wrote: >> День добрый всем! >> >> auth optional pam_mount.so >> auth sufficient pam_tcb.so shadow fork prefix=$2a$ count=8 >> nullok use_first_pass >> auth requisite pam_succeed_if.so uid >= 500 quiet >> auth required pam_ldap.so use_first_pass >> >> В пятом бранче pam_mount, будучи поставленный первым в auth (а >> по-другому его заставить работать у меня не получилось), меняет строку >> запроса пароля и вместо просто "password:" пишет "pam_mount >> password:". > > Не надо помещать pam_mount.so в стеке аутентификации до pam_tcb.so, > это не правильно по сути. Согласен, мне это тоже кажется "неправильным по сути". Но в примере явно указано, что при аутентификации через ldap или winbind нужно модуль pam_mount ставить впереди... ---------------------- #man pam_mount .... When "sufficient" is used in the second column, you must make sure that pam_mount is added before this entry. Otherwise pam_mount will not get executed should a previous PAM module suc‐ ceed. Also be aware of the "include" statements. These make PAM look into the specified file. If there is a "sufficient" statement, then the pam_mount entry must either be in the included file before the "sufficient" statement or before the "include" statement. If you use pam_ldap, pam_winbind, or any other authentication services that make use of PAM's sufficient keyword, model your configuration on the following order: ・・・ account sufficient pam_ldap.so auth required pam_mount.so auth sufficient pam_ldap.so use_first_pass auth required pam_unix.so use_first_pass session optional pam_mount.so ・・・ This allows for: 1. pam_mount, as the first "auth" module, will prompt for a password and export it to the PAM system. 2. pam_ldap will use the password from the PAM system to try and authenticate the user. If this succedes, the user will be authenticated. If it fails, pam_unix will try to authenti‐ cate. .... ------------------------------ А второй вариант (см. ниже) указывается именно для таких как мы с вами :) ----------------------------- ... Alternatively, the following is possible (thanks to Andrew Morgan for the hint!): auth [success=2 default=ignore] pam_unix2.so auth [success=1 default=ignore] pam_ldap.so use_first_pass auth requisite pam_deny.so auth optional pam_mount.so It may seem odd, but the first three lines will make it so that at least one of pam_unix2 or pam_ldap has to succeed. As you can see, pam_mount will be run after successful authentifica‐ tion with these subsystems. ... ----------------------------- Причем, оба этих варианта - рабочие. А вот если попытаться без затей поставить pam_mount после остальных модулей, то пароль запрашивается два раза. Причем даже при перезапуске демонов (веселуха service network restart - введи пароль...). И это не решается использованием опции use_first_pass. Единственное, что я не пробовал - это ставить строчку с account впереди строчек с auth. Потому что, насколько я понимаю, от этого ничего не изменится... >> $ su - >> pam_mount password: >> >> На 4.1 такого не наблюдалось. Зачем понадобилось "кишки светить" перед >> юзерами и можно ли это поведение отключить по-простому? > > Попробуйте спросить у автора pam_mount. Хотя я бы не стал его винить, > ведь благодаря ему сразу видна ошибка в стеке аутентификации. Никто его не винит. Просто см. сабж - "неаккуратненько как-то". И хотелось бы узнать, есть ли возможность сэмулировать старое поведение. >> auth [success=2 default=ignore] pam_tcb.so shadow fork prefix=$2a$ count=8 nullok >> auth requisite pam_succeed_if.so uid >= 500 quiet >> auth [success=1 default=ignore] pam_ldap.so use_first_pass >> auth optional pam_mount.so > > Вы неправильно списали с pam_mount(8). Чтобы понять, в чём ошибка, > придётся прочитать и понять pam.conf(5). Ошибки нет. Этот вариант работает. Мой вопрос касается скорее эстетики, чем функциональности... > P.S. Извините, что отвечаю не на те вопросы, которые вы задаёте, > а на те, которые напрашиваются. Просто я сейчас готовил сборку > пакета pam-1.1.0-alt1, и вы попали под горячую руку. :) Не всегда получается задать удачный вопрос, чтобы получить полезный ответ ;) -- С уважением, Черносов Денис
next prev parent reply other threads:[~2009-06-22 6:41 UTC|newest] Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top 2009-06-19 6:46 Денис Черносов 2009-06-19 23:38 ` Dmitry V. Levin 2009-06-22 6:41 ` Денис Черносов [this message] 2009-06-22 16:48 ` Dmitry V. Levin 2009-06-24 8:31 ` Денис Черносов 2009-06-24 11:12 ` Dmitry V. Levin 2009-06-25 6:27 ` Денис Черносов 2009-06-25 21:19 ` Dmitry V. Levin 2009-06-25 23:23 ` Dmitry V. Levin 2009-06-26 7:41 ` Денис Черносов 2009-06-26 19:10 ` Dmitry V. Levin 2009-06-26 21:48 ` [Comm] pam-config-1.5.0-alt1 Dmitry V. Levin 2009-06-26 7:21 ` [Comm] "pam_mount password:" - неаккуратненько как-то Денис Черносов 2009-06-26 19:05 ` Dmitry V. Levin 2009-06-22 10:06 ` Andrew V. Stepanov 2009-06-24 9:02 ` Денис Черносов
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=d77783290906212341n3ab5be5fna1e6030eb00aac59@mail.gmail.com \ --to=denis0.ru@gmail.com \ --cc=community@lists.altlinux.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
ALT Linux Community general discussions This inbox may be cloned and mirrored by anyone: git clone --mirror http://lore.altlinux.org/community/0 community/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 community community/ http://lore.altlinux.org/community \ mandrake-russian@linuxteam.iplabs.ru community@lists.altlinux.org community@lists.altlinux.ru community@lists.altlinux.com public-inbox-index community Example config snippet for mirrors. Newsgroup available over NNTP: nntp://lore.altlinux.org/org.altlinux.lists.community AGPL code for this site: git clone https://public-inbox.org/public-inbox.git