1006
правок
Kekaloav (обсуждение | вклад) |
Kekaloav (обсуждение | вклад) |
||
Строка 1: | Строка 1: | ||
Строка 8: | Строка 9: | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
#!/bin/bash | #!/bin/bash | ||
SCHOOL=648 | SCHOOL=648 | ||
LDOMAIN="sao.obr.mos.ru" | LDOMAIN="sao.obr.mos.ru" | ||
ADMIN="kekaloav" | ADMIN="kekaloav" | ||
ADMINPASS= | ADMINPASS='pass' | ||
DOMAIN="`echo ${LDOMAIN} | awk '{print toupper($0)}'`" | DOMAIN="`echo ${LDOMAIN} | awk '{print toupper($0)}'`" | ||
LHOSTNAME="`hostname`" | LHOSTNAME="`hostname`" | ||
Строка 17: | Строка 19: | ||
service sssd stop | service sssd stop | ||
apt-get -y install samba-common-tools sssd-ad task-auth-ad-sssd samba-client cifs-utils systemd-settings-enable-kill-user-processes | |||
cp /etc/nsswitch.conf /etc/sssd/nsswitch.conf_ | |||
apt-get -y install samba-common-tools task-auth-ad-sssd | cp /etc/sssd/sssd.conf /etc/sssd/sssd.conf_ | ||
cp /etc/krb5.conf /etc/krb5.conf_ | cp /etc/krb5.conf /etc/krb5.conf_ | ||
cp /etc/samba/smb.conf /etc/samba/smb.conf_ | cp /etc/samba/smb.conf /etc/samba/smb.conf_ | ||
echo -e "[logging]\n\n[libdefaults]\ndefault_realm = ${DOMAIN}\ndns_lookup_kdc = true\ndns_lookup_realm = false\nticket_lifetime = 24h\nrenew_lifetime = 7d\nforwardable = true\nrdns = false\ndefault_ccache_name = KEYRING:persistent:%{uid}" > /etc/krb5.conf | echo -e "[logging]\n\n[libdefaults]\ndefault_realm = ${DOMAIN}\ndns_lookup_kdc = true\ndns_lookup_realm = false\nticket_lifetime = 24h\nrenew_lifetime = 7d\nforwardable = true\nrdns = false\ndefault_ccache_name = KEYRING:persistent:%{uid}" > /etc/krb5.conf | ||
echo - | echo -n "[global]\nsecurity = ads\nrealm = ${DOMAIN}\nworkgroup = ${DOMAIN:0:3}\nnetbios name = ${HOSTNAME}\ntemplate shell = /bin/bash\nkerberos method = system keytab\nwins support = no\nwinbind use default domain = yes\ninbind enum users = no\nwinbind enum groups = no\ntemplate homedir = /home/${DOMAIN}/%U\nidmap config * : range = 200000-2000200000\nidmap config * : backend = sss\nmachine password timeout = 0\n[homes]\nbrowseable = no\nwritable = yes\n[printers]\ncomment = All Printers\npath = /var/spool/samba\nbrowseable = no\nguest ok = no\nwritable = no\nprintable = yes\n" > /etc/samba/smb.conf | ||
if [ -z "`cat /etc/pam.d/system-auth | grep 'pam_mount.so disable_interactive'`" ] ; then | if [ -z "`cat /etc/pam.d/system-auth | grep 'pam_mount.so disable_interactive'`" ] ; then | ||
Строка 37: | Строка 36: | ||
fi | fi | ||
system-auth write ad ${DOMAIN} ${LHOSTNAME} ${DOMAIN:0:3} ${ADMIN} ${ADMINPASS} | |||
service sssd stop | |||
sed -i 's/ad_gpo_access_control = permissive/ad_gpo_access_control = disabled/g' /etc/sssd/sssd.conf | |||
service sssd start | service sssd start | ||
</syntaxhighlight>Отключение<syntaxhighlight lang="bash"> | </syntaxhighlight>Отключение<syntaxhighlight lang="bash"> |