#!/bin/sh if [ "${idm_bootstrap:-}" = true ] || [ "${enable_idm:-}" = false ]; then return 0 fi # Create state dataset to persist keytabs across OS rebuilds. create_dataset -o "mountpoint=${keytab_dir}" "${state_dataset}/keytabs" # Install packages. pkg install -y \ cyrus-sasl-gssapi \ nss-pam-ldapd-sasl \ openldap26-client \ pam_krb5 \ perl5 \ p5-perl-ldap \ p5-Authen-SASL \ pam_mkhomedir # Script to create /usr/local/home/${USER} on login. install_file -m 0555 /usr/local/libexec/pam-create-local-homedir # Configure PAM/NSS integration. install_template -m 0644 \ /etc/pam.d/login \ /etc/pam.d/sshd install_file -m 0644 \ /etc/nsswitch.conf \ /etc/pam.d/system \ /etc/pam.d/sudo \ /etc/pam.d/su \ /etc/pam.d/other install_template -m 0644 /etc/login.access install_template -m 0644 \ /etc/krb5.conf \ /etc/nscd.conf \ /usr/local/etc/openldap/ldap.conf \ /usr/local/etc/nslcd.conf # Ensure /home exists and configure skel files. install_directory -m 0755 /home install_file -m 0644 \ /usr/share/skel/dot.login \ /usr/share/skel/dot.profile \ /usr/share/skel/dot.shrc # Create ldap.conf symlink. ln -snfv /usr/local/etc/openldap/ldap.conf /usr/local/etc/ldap.conf # Create host object (if it doesn't exist). ldap_add "cn=${BOXCONF_HOSTNAME},${hosts_basedn}" <