Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ubuntu enable unix #12660

Merged
merged 18 commits into from
Dec 17, 2024
Merged
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Create bash_pam_unix_enable macro
alanmcanonical committed Dec 16, 2024
commit dadf18aa28778afbf87eae93c4755e482c51b179
39 changes: 39 additions & 0 deletions shared/macros/10-bash.jinja
Original file line number Diff line number Diff line change
@@ -901,6 +901,45 @@ DEBIAN_FRONTEND=noninteractive pam-auth-update
{{%- endmacro -%}}


{{#
Enable pam_unix.so PAM module by using pam-auth-update.
This option is only recommended when pam-auth-update tool is available for the system.
#}}
{{%- macro bash_pam_unix_enable() -%}}
conf_name=cac_unix
if [ ! -f /usr/share/pam-configs/"$conf_name" ]; then
cat << EOF > /usr/share/pam-configs/"$conf_name"
Name: Unix authentication
Default: yes
Priority: 257
Conflicts: unix
Auth-Type: Primary
Auth:
[success=end default=ignore] pam_unix.so try_first_pass
Auth-Initial:
[success=end default=ignore] pam_unix.so
Account-Type: Primary
Account:
[success=end new_authtok_reqd=done default=ignore] pam_unix.so
Account-Initial:
[success=end new_authtok_reqd=done default=ignore] pam_unix.so
Session-Type: Additional
Session:
required pam_unix.so
Session-Initial:
required pam_unix.so
Password-Type: Primary
Password:
[success=end default=ignore] pam_unix.so obscure use_authtok try_first_pass yescrypt
Password-Initial:
[success=end default=ignore] pam_unix.so obscure yescrypt
EOF
fi

DEBIAN_FRONTEND=noninteractive pam-auth-update
{{%- endmacro -%}}


{{#
Validate an authselect custom profile integrity and ensures the correct file path is defined
in the "PAM_FILE_PATH" variable. The macros which change PAM files are the same regardless of