From cd1ce69f104686bbb33e049c2c4c112e78febd36 Mon Sep 17 00:00:00 2001 From: Cullum Smith Date: Wed, 25 Sep 2024 21:38:13 -0400 Subject: finish idm client stuff --- scripts/os/freebsd/50-idm | 114 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 114 insertions(+) create mode 100644 scripts/os/freebsd/50-idm (limited to 'scripts/os') diff --git a/scripts/os/freebsd/50-idm b/scripts/os/freebsd/50-idm new file mode 100644 index 0000000..ea94082 --- /dev/null +++ b/scripts/os/freebsd/50-idm @@ -0,0 +1,114 @@ +#!/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 + +# Configure PAM/NSS integration. +install_file -m 0644 \ + /etc/nsswitch.conf \ + /etc/pam.d/sshd + +install_template -m 0644 \ + /etc/krb5.conf \ + /etc/nscd.conf \ + /usr/local/etc/openldap/ldap.conf \ + /usr/local/etc/nslcd.conf + +# 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}" <