Commit 065f2c5b authored by Vitaly Lipatov's avatar Vitaly Lipatov

tune_sssd.sh: improve detections

parent 07a23d84
...@@ -6,6 +6,18 @@ fatal() ...@@ -6,6 +6,18 @@ fatal()
exit 1 exit 1
} }
# Get REALM (needed for sssd tuning only) from DNS
REALM=$(host -t txt _kerberos | sed -e 's|.*"\(.*\)".*|\1|')
if [ -z "$REALM" ] ; then
if [ -n "$1" ] ; then
REALM="$1"
shift
else
fatal "Check your DNS with $ host -t txt _kerberos or run with REALM as param"
fi
fi
echo "Use REALM $REALM ..."
case $(distr_info -d) in case $(distr_info -d) in
Ubuntu|Debian) Ubuntu|Debian)
# Ubuntu # Ubuntu
...@@ -30,16 +42,18 @@ subst() ...@@ -30,16 +42,18 @@ subst()
} }
fi fi
LIBDIR=/usr/lib64 LIBDIR=$(getconf LIBDIR)
[ -d /usr/lib64 ] || LIBDIR=/usr/lib if [ ! -d "$LIBDIR" ] ; then
LIBDIR=/usr/lib64
[ -d /usr/lib64 ] || LIBDIR=/usr/lib
fi
if [ ! -L $LIBDIR/samba/ldb ] ; then if [ ! -L $LIBDIR/samba/ldb ] ; then
ln -s $LIBDIR/ldb/modules/ldb $LIBDIR/samba/ldb ln -s $LIBDIR/ldb/modules/ldb $LIBDIR/samba/ldb
fi fi
REALM="ETERSOFT.RU"
if [ -d /etc/sssd/conf.d ] ; then if [ -d /etc/sssd/conf.d ] ; then
cat <<EOF >/etc/sssd/conf.d/etersoft.conf || fatal cat <<EOF >/etc/sssd/conf.d/ad.conf || fatal
[sssd] [sssd]
domains = $REALM domains = $REALM
...@@ -58,21 +72,15 @@ fallback_homedir = /home/%u ...@@ -58,21 +72,15 @@ fallback_homedir = /home/%u
ldap_chpass_dns_service_name = ad ldap_chpass_dns_service_name = ad
ldap_id_mapping = False ldap_id_mapping = False
;use_fully_qualified_names = True use_fully_qualified_names = False
; always ask KDC ; always ask KDC
cache_credentials = false cache_credentials = false
;ad_hostname = asu.office.etersoft.ru
;ad_server = dc.etersoft.ru
;ad_domain = ETERSOFT.RU
enumerate = true enumerate = true
; krb5_canonicalize = True
dyndns_update = False dyndns_update = False
EOF EOF
chmod 0600 /etc/sssd/conf.d/etersoft.conf chmod 0600 /etc/sssd/conf.d/ad.conf
else else
echo "Skipping sssd conf creating" echo "Skipping sssd conf creating"
fi fi
...@@ -81,8 +89,8 @@ fi ...@@ -81,8 +89,8 @@ fi
if ! grep -q " sss" /etc/nsswitch.conf ; then if ! grep -q " sss" /etc/nsswitch.conf ; then
subst "s| mysql| sss mysql|g" /etc/nsswitch.conf subst "s| mysql| sss mysql|g" /etc/nsswitch.conf
( cd /etc ; git diff nsswitch.conf | cat )
fi fi
( cd /etc ; git diff nsswitch.conf | cat )
# TODO: realmd # TODO: realmd
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment