This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
использование_библиотеки_pam [2022/01/12 16:07] val [Использование pam_script] |
использование_библиотеки_pam [2024/12/10 06:50] (current) val [Использование библиотеки PAM] |
||
---|---|---|---|
Line 2: | Line 2: | ||
* [[http://www.freebsd.org/doc/ru/articles/pam/index.html|FreeBSD Handbook: Подключаемые Модули Аутентификации (PAM)]] | * [[http://www.freebsd.org/doc/ru/articles/pam/index.html|FreeBSD Handbook: Подключаемые Модули Аутентификации (PAM)]] | ||
- | * [[http://www.ibm.com/developerworks/ru/library/l-pam/index.html|IBM: Основы и настройка PAM]] | + | * [[https://redos.red-soft.ru/base/redos-7_3/7_3-security/7_3-sys-auth/7_3-pam/|red-soft.ru Подключаемые модули аутентификации (PAM). Общие сведения]] |
+ | * [[https://losst.pro/nastrojka-pam-v-linux|Настройка PAM в Linux]] | ||
===== Терминология PAM ===== | ===== Терминология PAM ===== | ||
Line 155: | Line 156: | ||
client1:~# grep -r ssh /etc/pam.* | client1:~# grep -r ssh /etc/pam.* | ||
+ | |||
+ | client1:~# pam-auth-update | ||
</code> | </code> | ||
Line 226: | Line 229: | ||
</code><code> | </code><code> | ||
... | ... | ||
- | auth [success=2 default=ignore] pam_krb5.so minimum_uid=1000 try_first_pass | + | # here are the per-package modules (the "Primary" block) |
- | auth [success=1 default=ignore] pam_unix.so nullok_secure try_first_pass | + | auth [success=2 default=ignore] pam_krb5.so minimum_uid=1000 |
+ | auth [success=2 default=ignore] pam_unix.so nullok_secure try_first_pass | ||
auth requisite pam_deny.so | auth requisite pam_deny.so | ||
auth sufficient pam_script.so | auth sufficient pam_script.so | ||
auth required pam_permit.so | auth required pam_permit.so | ||
+ | # and here are more per-package modules (the "Additional" block) | ||
... | ... | ||
</code><code> | </code><code> | ||
Line 237: | Line 242: | ||
#!/bin/bash | #!/bin/bash | ||
- | id $PAM_USER &>/dev/null || useradd -m -s /bin/bash $PAM_USER | + | id "$PAM_USER" &>/dev/null || useradd -m -s /bin/bash "$PAM_USER" |
+ | |||
+ | #echo "$PAM_USER:$PAM_AUTHTOK" | /usr/sbin/chpasswd | ||
+ | #useradd -m -p "$(/usr/bin/mkpasswd -m sha-512 $PAM_AUTHTOK)" -s /bin/bash "$PAM_USER" | ||
</code> | </code> | ||