This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
2fa_на_предприятии [2025/09/15 08:34] val [История вопроса] |
2fa_на_предприятии [2025/10/07 08:34] (current) val [Шаг 1. Настраиваем SSH доступ с 2FA] |
||
---|---|---|---|
Line 4: | Line 4: | ||
* [[https://datatracker.ietf.org/doc/html/rfc6238]] | * [[https://datatracker.ietf.org/doc/html/rfc6238]] | ||
- | * [[https://2fa.zone/|Get 2FA Verification Code]] | + | * [[https://play.google.com/store/apps/details?id=ru.yandex.key&hl=en|Yandex Key – Google Play]] |
+ | * [[https://2fa.zone/]] | ||
* [[https://2fa.fb.rip/]] | * [[https://2fa.fb.rip/]] | ||
* [[https://2fa.live/]] | * [[https://2fa.live/]] | ||
Line 28: | Line 29: | ||
===== Запись вебинара ===== | ===== Запись вебинара ===== | ||
- | * Тэги: | + | * https://youtu.be/VMIi5-XY7Gk |
+ | * https://rutube.ru/video/private/7fb7b99656ae3819fcabccc090412065/ | ||
+ | * https://ok.ru/specialistru/topic/158109049773425 | ||
+ | * https://vk.com/video-2190892_456239493 | ||
+ | |||
+ | * Тэги: 2FA, OTP, TOTP, SSH, PAM, OpenVPN | ||
===== История вопроса ===== | ===== История вопроса ===== | ||
Line 40: | Line 46: | ||
<code> | <code> | ||
+ | $ timedatectl status #!!! | ||
+ | |||
$ sudo apt-get install libpam-google-authenticator | $ sudo apt-get install libpam-google-authenticator | ||
</code> | </code> | ||
Line 56: | Line 64: | ||
... | ... | ||
NNNNNNNN | NNNNNNNN | ||
+ | </code><code> | ||
+ | student@debian:~$ more .google_authenticator | ||
+ | ... | ||
</code><code> | </code><code> | ||
debian:~# cat /etc/pam.d/sshd | debian:~# cat /etc/pam.d/sshd | ||
Line 88: | Line 99: | ||
* [[Пакет OpenVPN#Использование PAM аутентификации]] | * [[Пакет OpenVPN#Использование PAM аутентификации]] | ||
- | <code> | ||
- | debian:~# cp /etc/pam.d/login /etc/pam.d/openvpn | ||
- | debian:~# cat /etc/pam.d/openvpn | + | ===== Шаг 4. Настраиваем 2FA доступ к GitLab ===== |
- | </code><code> | + | |
- | auth required pam_google_authenticator.so authtok_prompt=pin | + | |
- | #auth required pam_google_authenticator.so authtok_prompt=pin user=root secret=/etc/openvpn/google-auth/${USER} | + | |
- | ... | + | |
- | </code><code> | + | |
- | # apt install pamtester | + | |
- | # pamtester openvpn student authenticate | + | * [[https://docs.gitlab.com/user/profile/account/two_factor_authentication/|GitLab Two-factor authentication]] |
- | pin | + | |
- | Password: | + | |
- | pamtester: successfully authenticated | + | |
- | </code><code> | + | |
- | # cat /etc/openvpn/openvpn1.conf | + | |
- | </code><code> | + | |
- | ... | + | |
- | plugin /usr/lib/x86_64-linux-gnu/openvpn/plugins/openvpn-plugin-auth-pam.so "openvpn login USERNAME password PASSWORD pin OTP" | + | |
- | ... | + | |
- | </code><code> | + | |
- | debian:~# systemctl enable openvpn@openvpn1 --now | + | |
- | debian:~# journalctl -f | + | ===== Проблемы ===== |
- | ... | + | |
- | Aug 29 09:45:09 debian openvpn(pam_google_authenticator)[2483]: Failed to read "/home/student/.google_authenticator" for "student" | + | |
- | ... | + | |
- | </code><code> | + | |
- | # systemctl edit openvpn@openvpn1 | + | |
- | </code><code> | + | |
- | [Service] | + | |
- | ProtectHome=no | + | |
- | </code> | + | |
- | ===== Шаг 4. Настраиваем 2FA доступ к GitLab ===== | + | |
- | * [[https://docs.gitlab.com/user/profile/account/two_factor_authentication/|GitLab Two-factor authentication]] | + | * [[https://docs.user.com/imap-for-account-with-2-step-verification/|How to configure IMAP/SMTP for account with a 2-step verification]] |
+ | |||
+ | ===== Итоги/Вопросы ===== | ||