ALT Linux Sisyphus discussions
 help / color / mirror / Atom feed
* [sisyphus] двухфакторная аутентификация с google authenticator
@ 2019-09-19 14:55 Alexei Mezin
  2019-09-20  4:12 ` Anton Farygin
  0 siblings, 1 reply; 11+ messages in thread
From: Alexei Mezin @ 2019-09-19 14:55 UTC (permalink / raw)
  To: ALT Linux Sisyphus discussions

Сизиф, только что обновил систему, поставил 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





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

end of thread, other threads:[~2019-09-21  6:42 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-19 14:55 [sisyphus] двухфакторная аутентификация с google authenticator Alexei Mezin
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

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