Commit 4d3c81d1 authored by Vitaly Lipatov's avatar Vitaly Lipatov

tune_sssd.sh: some update

parent 381325f7
...@@ -37,15 +37,18 @@ if [ ! -L $LIBDIR/samba/ldb ] ; then ...@@ -37,15 +37,18 @@ 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/etersoft.conf || fatal
[sssd] [sssd]
domains = ETERSOFT.RU domains = $REALM
[domain/ETERSOFT.RU] [domain/$REALM]
id_provider = ad id_provider = ad
auth_provider = ad auth_provider = ad
access_provider = ad
chpass_provider = ad chpass_provider = ad
default_shell = /bin/bash default_shell = /bin/bash
fallback_homedir = /home/%u fallback_homedir = /home/%u
;debug_level = 5 ;debug_level = 5
...@@ -56,14 +59,17 @@ ldap_chpass_dns_service_name = ad ...@@ -56,14 +59,17 @@ ldap_chpass_dns_service_name = ad
ldap_id_mapping = False ldap_id_mapping = False
;use_fully_qualified_names = True ;use_fully_qualified_names = True
# change for production ; always ask KDC
cache_credentials = false cache_credentials = false
;ad_hostname = asu.office.etersoft.ru ;ad_hostname = asu.office.etersoft.ru
;ad_server = dc.etersoft.ru ;ad_server = dc.etersoft.ru
;ad_domain = ETERSOFT.RU ;ad_domain = ETERSOFT.RU
enumerate = true enumerate = true
; krb5_canonicalize = True ; krb5_canonicalize = True
dyndns_update = False
EOF EOF
chmod 0600 /etc/sssd/conf.d/etersoft.conf chmod 0600 /etc/sssd/conf.d/etersoft.conf
...@@ -71,20 +77,25 @@ else ...@@ -71,20 +77,25 @@ else
echo "Skipping sssd conf creating" echo "Skipping sssd conf creating"
fi fi
# TODO: Fedora has special command for change nssswitch.conf
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
fi fi
( cd /etc ; git diff nsswitch.conf | cat ) ( cd /etc ; git diff nsswitch.conf | cat )
# TODO: realmd
UPHOST=$(hostname -s | tr [:lower:] [:upper:]) UPHOST=$(hostname -s | tr [:lower:] [:upper:])
WORKGROUP=$(echo "$REALM" | sed -e "s|\..*||")
if ! grep -q "realm = ETERSOFT.RU" /etc/samba/smb.conf ; then if ! grep -q "realm = $REALM" /etc/samba/smb.conf ; then
cat <<EOF >>/etc/samba/smb.conf cat <<EOF >>/etc/samba/smb.conf
[global] [global]
security = ads security = ads
realm = ETERSOFT.RU realm = $REALM
workgroup = ETERSOFT workgroup = $WORKGROUP
netbios name = $UPHOST netbios name = $UPHOST
template shell = /bin/bash template shell = /bin/bash
kerberos method = system keytab kerberos method = system keytab
......
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