Samba (smb.conf)

Exemplo de configuração do Samba

Categoria: Samba

Software: Samba

[ Hits: 14.789 ]

Por: Perfil removido


Exemplo de configuração do Samba com lixeira em cada compartilhamento (individual, pois assim é possível disponibilizar a lixeira para os usuários do respectivo grupo compartilhamento).

Para auditoria funcionar, não esqueça de acrescentar a seguinte linha ao arquivo /etc/syslog.conf ou /etc/rsyslog.conf (caso seu sistema use o rsyslog):

local5.alert -/var/log/samba/auditoria.log

É simples, mas o que vale é a intenção de colaborar. Até +


[global]
name resolve order = wins bcast hosts
netbios name = servidor-pdc
workgroup = dominio
time server = yes
security = user
map to guest = Bad User
os level = 100
wins support = yes
server string = Ubuntu Server
# hosts allow = 192.168.0.0/255.255.255.0
# remote announce = 192.168.0.255/dominio
winbind use default domain = yes
winbind enum users = yes
winbind enum groups = yes
idmap uid = 10000-20000
idmap uid = 10000-20000
winbind uid = 10000-20000
winbind gid = 10000-20000
template shell = /bin/false
passwd chat debug = yes
unix password sync = yes
username map = /etc/samba/smbusers
passdb backend = tdbsam
admin users = @sysadmin
unix password sync = yes
domain logons = yes
domain master = yes
preferred master = yes
local master = yes
log level = 3
max log size = 1000
log file = /var/log/samba/log.%m
passwd program = /usr/bin/passwd %u
passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
add machine script = /usr/sbin/useradd -s /bin/false -d /var/lib/nobody -g maquinas %u
add user script = /usr/sbin/adduser --quiet --disabled-password --gecos "" %u
delete user script = /usr/sbin/userdel %u
#shutdown script = /home/samba/bin/shutdown %m %t %r %f
add group script = /usr/sbin/groupadd %g
set primary group script = /usr/sbin/usermod -g %g %u
add user to group script = /usr/sbin/usermod -G %g %u
delete group script = /usr/sbin/groupdel %g
message command = /bin/sh -c '/usr/bin/linpopup "%f" "%m" %s; rm %s' &
#dfree command = /home/samba/bin/dfree.sh

# include = /home/samba/etc/smb.conf.%m

printing = CUPS
printcap name = CUPS
cups options = "raw media=a4"
load printers = yes
unix extensions = yes
unix charset = UTF8
display charset = cp850
socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192

logon script = KIX32.exe netlogon.kix
logon home = \\%L\profiles\%U
logon path = \\%L\profiles\%U
logon drive = U:
template homedir = /home/%U
usershare prefix allow list = /home /srv /media
usershare prefix deny list = /etc /dev /root /proc
csc policy = disable
enable privileges = yes
hide files = /desktop.ini/outlook*.lnk/*Briefcase*/
veto files = /*Security*/*.tmp/*root*/.AppleDouble/.bin/.AppleDesktop/Network Trash Folder/

#======================= Lixeira =======================
recycle:directory_mode = 0770
recycle:exclude = *.tmp, *.temp, *.ldb, *.o, *.obj, ~*.*, *.bak
recycle:exclude_dir = tmp, temp, cache
recycle:facility = LOCAL1
recycle:keeptree = Yes
recycle:maxsize = 10000000
recycle:noversions = .ppt|*.dcl
recycle:priority = NOTICE
recycle:subdir_mode = 0770
recycle:touch = True
recycle:versions = Yes

#======================= Shares ========================

[printers]
comment = All Printers
browseable = no
path = /var/spool/samba
printable = yes
valid users = @publico
writable = yes
create mode = 777
write list = @sysadmin

[print$]
comment = Printer Drivers
path = /var/lib/samba/printers
admin users = @sysadmin @lpadmin
write list = @sysadmin
read list = @publico

[PDF]
comment = Impressora PDF ( cups-pdf )
path = /var/spool/samba
read only = No
create mask = 0770
printable = Yes
printer name = PDF
; oplocks = No
admin users = @sysadmin
write list = @sysadmin
read list = @publico

[homes]
comment = Home (Diretorio Pessoal)
valid users = %S
read only = no
browsable = no
create mode = 0700
veto files = /*.wmv/*.wav/*.mp3/*.vob/*.mov/*.iso/*.nrg/
vfs objects = recycle
recycle:repository = /home/%U/.Lixeira
vfs objects = full_audit
full_audit:facility = LOCAL5
full_audit:failure = close closedir mkdir open opendir rename rmdir write
full_audit:prefix = %U|%I|%P
full_audit:priority = ALERT
full_audit:success = close mkdir open rename rmdir write

[netlogon]
comment = Servico de logon
path = /home/samba/netlogon
guest ok = yes
browseable = no
admin users = @sysadmin
write list = @sysadmin
vfs objects = recycle
recycle:repository = /home/samba/netlogon/.Lixeira/%U
vfs objects = full_audit
full_audit:facility = LOCAL5
full_audit:failure = close closedir mkdir open opendir rename rmdir write
full_audit:prefix = %U|%I|%P
full_audit:priority = ALERT
full_audit:success = close mkdir open rename rmdir write
#root preexec = /home/samba/bin/powerlogon.sh %I %m %a %U %G

[profiles]
comment = Network Profiles Service
path = /home/samba/profiles/%U
read only = No
store dos attributes = Yes
create mask = 0600
directory mask = 0700
hide files = /desktop.ini/outlook*.lnk/*Briefcase*
browseable = no
vfs objects = recycle
recycle:repository = /home/samba/profiles/.Lixeira/%U
vfs objects = full_audit
full_audit:facility = LOCAL5
full_audit:failure = close closedir mkdir open opendir rename rmdir write
full_audit:prefix = %U|%I|%P
full_audit:priority = ALERT
full_audit:success = close mkdir open rename rmdir write

[apps]
comment = Aplicativos globais
path = /home/samba/apps
guest ok = yes
browseable = no
create mask = 0775
directory mask = 0775
admin users = @sysadmin
write list = @sysadmin
read list = @users

[setup]
comment = Executáveis de instalação
path = /home/samba/setup
browseable = no
create mask = 0775
directory mask = 0775
admin users = @sysadmin
write list = @sysadmin
read list = @sysadmin

[financeiro]
comment = Dados do Departamento Financeiro
path = /home/samba/dados/financeiro
browseable = yes
writable = yes
read only = no
create mask = 0770
directory mask = 0770
admin users = @financeiro
write list = @financeiro
read list = @financeiro
vfs objects = recycle
recycle:repository = /home/samba/dados/.Lixeira/%U
vfs objects = full_audit
full_audit:facility = LOCAL5
full_audit:failure = close closedir mkdir open opendir rename rmdir write
full_audit:prefix = %U|%I|%P
full_audit:priority = ALERT
full_audit:success = close mkdir open rename rmdir write

[gerencia]
comment = Dados da Equipe de Gerentes
path = /home/samba/dados/gerencia
browseable = yes
writable = yes
read only = no
create mask = 0770
directory mask = 0770
admin users = @gerencia
write list = @gerencia
read list = @gerencia
vfs objects = recycle
recycle:repository = /home/samba/dados/.Lixeira/%U
vfs objects = full_audit
full_audit:facility = LOCAL5
full_audit:failure = close closedir mkdir open opendir rename rmdir write
full_audit:prefix = %U|%I|%P
full_audit:priority = ALERT
full_audit:success = close mkdir open rename rmdir write

[comercial]
comment = Dados da Equipe de Vendas
path = /home/samba/dados/comercial
browseable = yes
writable = yes
read only = no
create mask = 0770
directory mask = 0770
admin users = @comercial
write list = @comercial
read list = @comercial
vfs objects = recycle
recycle:repository = /home/samba/dados/.Lixeira/%U
vfs objects = full_audit
full_audit:facility = LOCAL5
full_audit:failure = close closedir mkdir open opendir rename rmdir write
full_audit:prefix = %U|%I|%P
full_audit:priority = ALERT
full_audit:success = close mkdir open rename rmdir write

[marketing]
comment = Dados da Equipe de Marketing
path = /home/samba/dados/marketing
browseable = yes
writable = yes
read only = no
create mask = 0770
directory mask = 0770
admin users = @marketing
write list = @marketing
read list = @marketing
vfs objects = recycle
recycle:repository = /home/samba/dados/.Lixeira/%U
vfs objects = full_audit
full_audit:facility = LOCAL5
full_audit:failure = close closedir mkdir open opendir rename rmdir write
full_audit:prefix = %U|%I|%P
full_audit:priority = ALERT
full_audit:success = close mkdir open rename rmdir write


  


Comentários
[1] Comentário enviado por DiegoWagner em 22/10/2009 - 15:31h

Muito bom!!

[2] Comentário enviado por manoel messias em 23/10/2009 - 10:02h

Olá amigos estou trabalhando monitorando um telecentro mas os PCs estão como diz o nosso linguajar da região parando sozinho..... é que quando ligo O PC ele começa iniciando o LINUX metasys normalmente mas numa tela preta ele para pedindo um login e um password mas o Login ele aceita eu digitar mas o password ele num aceita digitar não...... isso tudo ainda numa tela preta sem entrar no ambiente gráfico............e está acontecendo com todos os PCs o que faço alguem pode me ajudar..
grato.
manoelmessyas@hotmail.com

[3] Comentário enviado por willianlpp em 23/11/2009 - 12:04h

bah, muito bom esse teu artigo velho ajudou mto.. abraço!


Contribuir com comentário

  



Patrocínio

Site hospedado pelo provedor RedeHost.
Linux banner

Destaques

Artigos

Dicas

Tópicos

Top 10 do mês

Scripts