feat: add pam-pkcs11 configuration
Recommends libpam-pkcs11 package. Add configuration for Safenet module (pam_pkcs11.conf) Add UID mapper generator (pkcs11_generate_uids) Configure certificates for pam_pkcs11 from postinst.
This commit is contained in:
19
usr/sbin/pkcs11_generate_uids
Executable file
19
usr/sbin/pkcs11_generate_uids
Executable file
@@ -0,0 +1,19 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Written by Michel Decima
|
||||
# Copyright 2021 Orange
|
||||
#
|
||||
# Generate uid mapping for pam_pkcs11 using /etc/passwd
|
||||
#
|
||||
|
||||
(( EUID == 0 )) || { echo 2>&1 "Not root." ; exit 1 ; }
|
||||
|
||||
mkdir -p /etc/pam_pkcs11
|
||||
# generate uid mapping for uppercase login ABCD1234 -> abcd1234
|
||||
getent -s files passwd \
|
||||
| awk -F: '
|
||||
/[a-z]{4}[0-9]{4}/ {
|
||||
printf "%s -> %s\n", toupper($1), $1
|
||||
}' \
|
||||
>> /etc/pam_pkcs11/uid_mapping
|
||||
sort -u -o /etc/pam_pkcs11/uid_mapping /etc/pam_pkcs11/uid_mapping
|
||||
Reference in New Issue
Block a user