From: Alexei Mezin <alexei.mezin@gmail.com> To: ALT Linux Sisyphus discussions <sisyphus@lists.altlinux.org> Subject: [sisyphus] двухфакторная аутентификация с google authenticator Date: Thu, 19 Sep 2019 17:55:07 +0300 Message-ID: <6ee4c3ff-02fc-02fa-b81d-6e0b900cbea1@gmail.com> (raw) Сизиф, только что обновил систему, поставил google authenticator. Настройки такие: # cat /etc/pam.d/sshd #%PAM-1.0 auth required pam_google_authenticator.so auth required pam_userpass.so auth include common-login-use_first_pass account include common-login password include common-login session include common-login В sshd_config изменил одну строку # Change to yes to enable s/key passwords ChallengeResponseAuthentication yes Перезаупстил sshd. Кратко резюмирую ситуацию: если логиниться по сети, то ни один код не подходит, хоть в логах не пишется про ошибку с кодом, пишется только про "PAM: Application needs to call libpam again". если логиниться на локалхост из уже открытой сессии, и ввести ДВА раза подряд один и тот же валидный код, то доходит до запроса пароля, но пароль оказывается неправильным. Если вводить один раз код, то ничего не происходит, снова запрашивает код. Это у всех так, или я что-то неправильно готовлю? Хронология: пытаюсь по сети попасть на сервер: sshd[31113]: error: PAM: Application needs to call libpam again for alexei from 192.168.1.4 sshd(pam_google_authenticator)[31118]: Trying to reuse a previously used time-based code. Retry again in 30 seconds. Warning! This might mean, you are currently subject to a man-in-the-middle attack. sshd(pam_google_authenticator)[31118]: Invalid verification code sshd[31113]: error: PAM: Application needs to call libpam again for alexei from 192.168.1.4 хм... просроченный код. Ок, жду следующего, ввожу: sshd[31113]: error: PAM: Application needs to call libpam again for alexei from 192.168.1.4 sshd[31113]: Postponed keyboard-interactive for alexei from 192.168.1.4 port 42962 ssh2 [preauth] А нифига не работает. Ок, попытка номер два, в этот раз логин из уже залогиненной сессии sshd(pam_google_authenticator)[31352]: Failed to compute location of secret file sshd[31348]: error: PAM: Application needs to call libpam again for alexei from 127.0.0.1 sshd[31348]: error: PAM: Application needs to call libpam again for alexei from 127.0.0.1 и так далее. В итоге если ДВА раза подряд ввести правильный (не протухший во времени) код, то система запрашивает обычным запросом пароль пользователя, но даже правильный пароль не принимает! sshd[31348]: pam_tcb(sshd:auth): Authentication passed for alexei from (uid=0) sshd[31348]: Failed password for alexei from 127.0.0.1 port 54922 ssh2
next reply other threads:[~2019-09-19 14:55 UTC|newest] Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top 2019-09-19 14:55 Alexei Mezin [this message] 2019-09-20 4:12 ` Anton Farygin 2019-09-20 6:04 ` Alexei V. Mezin 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=6ee4c3ff-02fc-02fa-b81d-6e0b900cbea1@gmail.com \ --to=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