Update DEBIAN/postinst
Deploy Package / Explore-Gitea-Actions (push) Successful in 7s Details

This commit is contained in:
Carneiro 2024-11-19 08:38:41 -03:00
parent 8207762068
commit c2a5cae7aa
1 changed files with 10 additions and 1 deletions

View File

@ -4,17 +4,26 @@ set -e
. /usr/share/debconf/confmodule
# stores ldap bindpw in $RET
db_get alice-auth/ldap-bind-password
SSSD_CONFIG=/etc/sssd/sssd.conf
SSHD_CONFIG=/etc/ssh/sshd_config
# sets bindpw in sssd config
sed -i "s/ldap_default_authtok =.*/ldap_default_authtok = $RET/" $SSSD_CONFIG
# sets auth keys script in sshd config
sed -i "s/#AuthorizedKeysCommand/AuthorizedKeysCommand/" $SSHD_CONFIG
sed -i "/AuthorizedKeysCommand\( \|$\)/s/AuthorizedKeysCommand.*/AuthorizedKeysCommand \/usr\/bin\/sss_ssh_authorizedkeys/" $SSHD_CONFIG
# change permissions and owner of sssd config
chmod 600 $SSSD_CONFIG
chown root:root $SSSD_CONFIG
systemctl restart sssd autofs ssh
# check if sss is set on hosts in /etc/nsswitch.conf
if ! grep -q '^hosts:.*sss' /etc/nsswitch.conf; then
sed -i 's/files/files sss/' /etc/nsswitch.conf
fi
systemctl restart sssd autofs ssh