ALT Linux Sisyphus discussions
 help / color / mirror / Atom feed
From: "Alexei V. Mezin" <alexei@nanoscantech.ru>
To: ALT Linux Sisyphus discussions <sisyphus@lists.altlinux.org>
Subject: Re: [sisyphus] двухфакторная аутентификация с google authenticator
Date: Fri, 20 Sep 2019 09:04:33 +0300
Message-ID: <b5580a1c-5e42-3cd8-a75c-a17b4b2d1b4b@gmail.com> (raw)
In-Reply-To: <657f01e6-2be0-243b-5afd-037b2c24d0fb@basealt.ru>

20.09.2019 7:12, Anton Farygin пишет:

> Предполагаю что ты единственный пользователь Альта, кто пытается сделать 
> такую схему аутентификации.

Хм... ну Ок. Но инструмент-то имеется! Кто-то же его в Сизиф положил :) 
Да и задача не сказать чтоб редкая и экзотическая.



Потыкал в этот снаряд еще. Гугл говорит, что у всех работает, а у нас 
наверное слишком особенный sshd/pam.

Ситуация примерно такая:

№1 если ставить вызов google_auth первым в списке

#%PAM-1.0
auth           requisite       pam_google_authenticator.so 
echo_verification_code nullok
auth            required        pam_userpass.so
...

То при попытке логина ожидаемо сначала запрашивается одноразовый код. В 
логах видно, что он принимается корректно, но сразу же выскакивает надпись

sshd[31113]: error: PAM: Application needs to call libpam again for
alexei from 192.168.1.4

И второго запроса уже обычного пароля не происходит. Снова запрашивается 
код. После трех попыток видимо google-часть сдается, и тогда уже виден 
запрос пароля, но к успеху он не приводит.

№2 если поставить вызов google_auth после прочих auth, то сначала 
ожидаемо запрашивается пароль на вход в систему. Но входа не происходит. 
В логах видно, что google_auth не получила корректного кода. Но как бы 
она его смогла получить, если запрос кода не выдается?

№3 если гугло-часть поставить вперед, снабдив ключом forward_pass, то 
нормально происходит запрос вида "введите пароль и код". Если в одну 
строку ввести пароль и код в формате passwd111122222, то гугло-часть 
исправно получает свой код, видимо передает пароль дальше (где его 
должны перехватить ключем use_first_pass), но все снова возвращается на 
запрос пароля-кода с вот таким диагнозом

sshd[3566]: pam_tcb(sshd:auth): Authentication passed for alexei from 
(uid=0)
sshd[3564]: error: PAM: Conversation error for alexei from 127.0.0.1




  reply	other threads:[~2019-09-20  6:04 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-19 14:55 Alexei Mezin
2019-09-20  4:12 ` Anton Farygin
2019-09-20  6:04   ` Alexei V. Mezin [this message]
2019-09-20  7:35     ` Denis Medvedev
2019-09-20  7:41       ` Paul Wolneykien
2019-09-20  8:01         ` Alexei V. Mezin
2019-09-20 11:41           ` Alexei Mezin
2019-09-20 15:36             ` Dmitry V. Levin
2019-09-20 20:03               ` Alexei V. Mezin
2019-09-20 21:53                 ` Dmitry V. Levin
2019-09-21  6:42                   ` Alexei V. Mezin

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=b5580a1c-5e42-3cd8-a75c-a17b4b2d1b4b@gmail.com \
    --to=alexei@nanoscantech.ru \
    --cc=alexei.mezin@gmail.com \
    --cc=sisyphus@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 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