Configuração SAMBA com LDAP
Autor: Breno Sabella | Publicado: 2012-03-17T14:24:00-03:00

# Parâmetros Globais
[global]

&nbsp; &nbsp;# Dominio, Nome e Descricao
&nbsp; &nbsp; &nbsp; &nbsp; workgroup = SEU_DOMINIO
&nbsp; &nbsp; &nbsp; &nbsp; netbios name = PDC
&nbsp; &nbsp; &nbsp; &nbsp; server string = Autentication Server
&nbsp; &nbsp; &nbsp; &nbsp; printcap name = /etc/cups
&nbsp; &nbsp; &nbsp; &nbsp; load printers = yes
&nbsp; &nbsp; &nbsp; &nbsp; printing = cups
&nbsp; &nbsp; &nbsp; &nbsp; printcap cache time = 60
&nbsp; &nbsp; &nbsp; &nbsp; show add printer wizard = No
&nbsp; &nbsp; &nbsp; &nbsp; interfaces = lo, eth0
&nbsp; &nbsp; &nbsp; &nbsp; bind interfaces only = Yes
&nbsp; &nbsp; &nbsp; &nbsp; log level = 1
&nbsp; &nbsp; &nbsp; &nbsp; log file = /var/log/samba/%m.log
&nbsp; &nbsp; &nbsp; &nbsp; max log size = 0
&nbsp; &nbsp; &nbsp; &nbsp; debug level = 1
&nbsp; &nbsp; &nbsp; &nbsp; syslog = 0
&nbsp; &nbsp; &nbsp; &nbsp; security = user
&nbsp; &nbsp; &nbsp; &nbsp; domain logons = yes
&nbsp; &nbsp; &nbsp; &nbsp; preferred master = yes
&nbsp; &nbsp; &nbsp; &nbsp; domain master = yes
&nbsp; &nbsp; &nbsp; &nbsp; os level = 65
&nbsp; &nbsp; &nbsp; &nbsp; logon path =
&nbsp; &nbsp; &nbsp; &nbsp; logon home =
&nbsp; &nbsp; &nbsp; &nbsp; logon script = script.vbs
&nbsp; &nbsp; &nbsp; &nbsp; encrypt passwords = yes
&nbsp; &nbsp; &nbsp; &nbsp; username map = /etc/samba/smbusers
&nbsp; &nbsp; &nbsp; &nbsp; passdb backend = ldapsam:ldap://ip_servidor_LDAP
&nbsp; &nbsp; &nbsp; &nbsp; ldap ssl = no
&nbsp; &nbsp; &nbsp; &nbsp; ldap passwd sync = yes
&nbsp; &nbsp; &nbsp; &nbsp; ldap delete dn = Yes
&nbsp; &nbsp; &nbsp; &nbsp; ldap admin dn = cn=root,dc=dominio,dc=com,dc=br
&nbsp; &nbsp; &nbsp; &nbsp; ldap suffix = dc=dominio,dc=com,dc=br
&nbsp; &nbsp; &nbsp; &nbsp; ldap machine suffix = ou=Hosts
&nbsp; &nbsp; &nbsp; &nbsp; ldap user suffix = ou=Users
&nbsp; &nbsp; &nbsp; &nbsp; ldap group suffix = ou=Group
&nbsp; &nbsp; &nbsp; &nbsp; ldap idmap suffix = sambaDomainName=dominio
&nbsp; &nbsp; &nbsp; &nbsp; idmap backend = ldap:ldap://ip_servidor_LDAP
&nbsp; &nbsp; &nbsp; &nbsp; idmap uid = 10000-20000
&nbsp; &nbsp; &nbsp; &nbsp; idmap gid = 10000-20000
&nbsp; &nbsp; &nbsp; &nbsp; enable privileges = yes
&nbsp; &nbsp; &nbsp; &nbsp; add user script = /usr/sbin/smbldap-useradd -m "%u"
&nbsp; &nbsp; &nbsp; &nbsp; delete user script = /usr/sbin/smbldap-userdel "%u"
&nbsp; &nbsp; &nbsp; &nbsp; add group script = /usr/sbin/smbldap-groupadd -p "%g"
&nbsp; &nbsp; &nbsp; &nbsp; delete group script = /usr/sbin/smbldap-groupdel "%g"
&nbsp; &nbsp; &nbsp; &nbsp; add user to group script = /usr/sbin/smbldap-groupmod -m "%u" "%g"
&nbsp; &nbsp; &nbsp; &nbsp; delete user from group script = /usr/sbin/smbldap-groupmod -x "%u" "%g"
&nbsp; &nbsp; &nbsp; &nbsp; set primary group script = /usr/sbin/smbldap-usermod -g "%g" "%u"
&nbsp; &nbsp; &nbsp; &nbsp; add machine script = /usr/sbin/smbldap-useradd -w "%u"
&nbsp; &nbsp; &nbsp; &nbsp; smb ports = 445 139
&nbsp; &nbsp; &nbsp; &nbsp; name resolve order = wins bcast hosts
&nbsp; &nbsp; &nbsp; &nbsp; #admin users = @Domain Admins
&nbsp; &nbsp; &nbsp; &nbsp; utmp = Yes
&nbsp; &nbsp; &nbsp; &nbsp; time server = Yes
&nbsp; &nbsp; &nbsp; &nbsp; template shell = /bin/false
&nbsp; &nbsp; &nbsp; &nbsp; winbind use default domain = yes
&nbsp; &nbsp; &nbsp; &nbsp; map acl inherit = Yes
&nbsp; &nbsp; &nbsp; &nbsp; strict locking = Yes
&nbsp; &nbsp; &nbsp; &nbsp; socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
&nbsp; &nbsp; &nbsp; &nbsp; wins server = ip_servidor_wins
&nbsp; &nbsp; &nbsp; &nbsp; wins support = Yes
&nbsp; &nbsp; &nbsp; &nbsp; dos charset = CP850
&nbsp; &nbsp; &nbsp; &nbsp; unix charset = ISO8859-1
&nbsp; &nbsp; &nbsp; &nbsp; veto files = /*.eml/*.nws/*.{*}/
&nbsp; &nbsp; &nbsp; &nbsp; veto oplock files = /*.doc/*.xls/*.mdb/
&nbsp; &nbsp; &nbsp; &nbsp; directory mask = 0770
&nbsp; &nbsp; &nbsp; &nbsp; directory security mask = 0770
 force create mode = 0770
 force security mode = 0770
 force directory security mode = 770
 force security mode = 770
 force directory mode = 770
 force unknown acl user = yes
&nbsp; &nbsp; &nbsp; &nbsp; security mask = 770
&nbsp; &nbsp; &nbsp; &nbsp; hidedotfiles = yes
&nbsp; &nbsp; &nbsp; &nbsp; recycle:repository = .lixeira
&nbsp; &nbsp; &nbsp; &nbsp; recycle:keeptree = True
&nbsp; &nbsp; &nbsp; &nbsp; recycle:touch = True
&nbsp; &nbsp; &nbsp; &nbsp; recycle:versions = True
&nbsp; &nbsp; &nbsp; &nbsp; recycle:exclude = *.tmp|*.temp|*.o|*.obj|~$*|*.$$$
&nbsp; &nbsp; &nbsp; &nbsp; recycle:excludedir = /tmp|/temp|/trash
&nbsp; &nbsp; &nbsp; &nbsp; recycle:noversions = .doc|.xls|.ppt|.dbf|.nsx|.idx|.dbt
&nbsp; &nbsp; &nbsp; &nbsp; recycle:maxsize = 0

#=============================
#===== Compartilhamentos =====
#=============================

[netlogon]
&nbsp; &nbsp; &nbsp; &nbsp; comment = Servico de Logon em Rede [ SCRIPT.VBS ]
&nbsp; &nbsp; &nbsp; &nbsp; path = /data/netlogon
&nbsp; &nbsp; &nbsp; &nbsp; public = yes
&nbsp; &nbsp; &nbsp; &nbsp; browseable = no
&nbsp; &nbsp; &nbsp; &nbsp; read only = Yes

[Rh]
comment = RH
path = /data/rh
public = yes
writable = yes
printable = no
write list = @rh @diretoria

[Seguranca]
comment = Seguranca
path = /data/seguranca
public = yes
writable = yes
printable = no
write list = @seguranca @diretoria

[PapelParede]
comment = papelparede
path = /data/papelparede
public = yes
browseable = no
writable = yes
printable = no
write list = @usuario

[printers]
&nbsp; &nbsp;comment = Spool de Impressao SMB
&nbsp; &nbsp;path = /var/spool/samba
&nbsp; &nbsp;browseable = No
&nbsp; &nbsp;guest ok = Yes
&nbsp; &nbsp;writeable = No
&nbsp; &nbsp;printable = Yes
&nbsp; &nbsp;create mode = 0700
&nbsp; &nbsp;use client driver = yes

[print$]
&nbsp; &nbsp;path = /var/lib/samba/printers
&nbsp; &nbsp;browseable = yes
&nbsp; &nbsp;write list = @"Operadores de Impressao" root
&nbsp; &nbsp;guest ok = yes
&nbsp; &nbsp;inherit permissions = yes

[HP_LJ1020]
&nbsp; &nbsp;comment = Impressora Pública
&nbsp; &nbsp;path = /var/spool/samba
&nbsp; &nbsp;browseable = no
&nbsp; &nbsp;printable = yes
&nbsp; &nbsp;printer = hp1
&nbsp; &nbsp;valid users = @impressora
&nbsp; &nbsp;guest ok = yes
&nbsp; &nbsp;read only = yes
&nbsp; &nbsp;use client driver = yes
&nbsp; &nbsp;print command = lpr -r -h -p %p %s