generated from alice-meta-packages/alice-meta-template
Update DEBIAN/postinst
Deploy Package / Explore-Gitea-Actions (push) Successful in 7s
Details
Deploy Package / Explore-Gitea-Actions (push) Successful in 7s
Details
This commit is contained in:
parent
8207762068
commit
c2a5cae7aa
|
@ -4,17 +4,26 @@ set -e
|
||||||
|
|
||||||
. /usr/share/debconf/confmodule
|
. /usr/share/debconf/confmodule
|
||||||
|
|
||||||
|
# stores ldap bindpw in $RET
|
||||||
db_get alice-auth/ldap-bind-password
|
db_get alice-auth/ldap-bind-password
|
||||||
|
|
||||||
SSSD_CONFIG=/etc/sssd/sssd.conf
|
SSSD_CONFIG=/etc/sssd/sssd.conf
|
||||||
SSHD_CONFIG=/etc/ssh/sshd_config
|
SSHD_CONFIG=/etc/ssh/sshd_config
|
||||||
|
|
||||||
|
# sets bindpw in sssd config
|
||||||
sed -i "s/ldap_default_authtok =.*/ldap_default_authtok = $RET/" $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 "s/#AuthorizedKeysCommand/AuthorizedKeysCommand/" $SSHD_CONFIG
|
||||||
sed -i "/AuthorizedKeysCommand\( \|$\)/s/AuthorizedKeysCommand.*/AuthorizedKeysCommand \/usr\/bin\/sss_ssh_authorizedkeys/" $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
|
chmod 600 $SSSD_CONFIG
|
||||||
chown root:root $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
|
Loading…
Reference in New Issue