Samba (smb.conf)

Samba ROLE_STANDALONE

Categoria: Samba

Software: Samba

[ Hits: 11.888 ]

Por: rafael oliveira


Este arquivo mostra a configuração do Samba como ROLE_STANDALONE.


#1. Comando para testar servidor samba:
# smbclient -L servidor -U usuário
#2. Comando para testar resolução de nomes:
# smbclient -d 3 -L localhost
#3. Criando conta de usuário no sistema:
# useradd convidado -s /bin/false -d /dev/ -c "usuario guest"
#4. Se o nome for iniciado por "+" o parâmetro será tratado como um nome de grupo UNIX (/etc/group). O caractere "&" faz ele pesquisar o nome de grupo no banco de dados NIS. O caractere "@" permite fazer a busca do grupo primeiro no banco de dados NIS e caso ele não seja encontrado, no arquivo de grupos do sistema (/etc/group).
[global]
    hosts allow = 158.133.163.0/255.255.255.0
    security = user
    deadtime = 10
    keepalive = 600
    max disk size = 10240
#Performace
    getwd cache = yes
    write cache size = 5240288
    oplocks = yes
    kernel oplocks = no
    max xmit = 65535
    read raw = yes
    write raw = yes
    socket options = TCP_NODELAY IPTOS_LOWDELAY SO_RCVBUF=8192 SO_SNDBUF=8192
#Diretivas de eleições de master browser
    local master = yes
    domain master = yes
    preferred master = yes
    os level = 100
#Habilita servidor SAMBA à WINS
    wins support = Yes
    max wins ttl = 100
    dns proxy = no
    name resolve order = wins bcast hosts lmhosts
#Configurações de log
    panic action = /usr/share/samba/panic-action %d
    log file = /var/log/samba/log.%m
    max log size = 1000
    debug level = 1
    debug timestamp = yes
    syslog = 0
#Habilita suporte a senhas criptografadas
    encrypt passwords = true
    smb passwd file = /etc/samba/smbpasswd
#Configuraçẽs NetBIOS
    workgroup = suse
    netbios name = opensuse
    server string = servidor opensuse
#Mapeamento ao guest do servidor
    map to guest = Bad User
    guest account = convidado
    username level = 3
    usershare allow guests = No
    passdb backend = smbpasswd
#Impressão
    printing = cups
    load printers = yes
#Virtual File System
    vfs objects = recycle full_audit
#Auditoria
    full_audit:success = open,opendir,write,unlink,rename,mkdir,rmdir
    full_audit:prefix = %u|%I|%S
    full_audit:failure = none
    full_audit:facility = local5
    full_audit:priority = notice
#Lixeira
    recycle:facility = LOCAL1
    recycle:priority = NOTICE
    recycle:maxsize = 0
    recycle:repository = /home/samba/lixeira/%U
    recycle:directory_mode = 0754
    recycle:subdir_mode = 0754
    recycle:keeptree = yes
    recycle:touch = yes
    recycle:exclude = *tmp,*.log,*.iso,*.wav,*.mp3,*.wmv,*.avi
    recycle:exclude_dir = tmp,temp,cache
    recycle:versions = yes
    recycle:noversions = .doc|.xls|.ppt|*.dcl
[printers]
    comment = Todas Impressoras
    path = /var/spool/samba
    printable = Yes
    guest ok = yes
    browseable = No
    create mask = 0600
[print$]
    comment = Printer Drivers
    path = /var/lib/samba/printers
    guest ok = yes
##### Compartilhamentos #####

[publico]
    comment = sem restricao
    guest ok = yes
    wide links = no
    follow symlinks = yes
    hide files = /cobian
    dont descend = cobian
    create mask = 0666
    directory mask = 0777
    force directory mode = 1000
    security mask = 0000
    force security mode = 0666
    directory security mask = 0000
    force directory security mode = 1777
    inherit owner = yes
    writable = yes
    browseable = yes
    path = /home/samba/publico
    max connections = 0
    available = yes
[lixeira]
    comment = lixeira geral
    path = /home/samba/lixeira/%U
    valid users = %U
    directory mask = 0754
    create mask = 0764
    browseable = yes
    max connections = 0
    writable = yes
[adm-tec]
    comment = restrito ao setor
    path = /home/samba/adm-tec
    browseable = yes
    wide links = no
    follow symlinks = yes
    max connections = 10
    read only = no
    nt acl support = no
    veto files = /*.bat/*.exe/*.avi/*.wmv/*.mov/*.flv/*.mp4/*rmvb/*iso/*.mp3/*.com/*.src/*.inf/*.cab/*.pif/*.dat/*.cmd/*.vbs/*.vbe/*.shs/*.js/*.ogg/*.mkv
    delete veto files = yes
    valid users = @gestao,scanner
    write list = @gestao,scanner
    create mask = 0664
    directory mask = 0774
[showroom]
    comment = restrito ao setor
    wide links = yes
    follow symlinks = yes
    path = /home/samba/showroom
    browseable = yes
    read only = no
    write list = @showroom,scanner
    nt acl support = no
    veto files = /*.bat/*.exe/*.avi/*.wmv/*.mov/*.flv/*.mp4/*rmvb/*iso/*.mp3/*.com/*.src/*.inf/*.cab/*.pif/*.dat/*.cmd/*.vbs/*.vbe/*.shs/*.js/*.ogg
    delete veto files = yes
    create mask = 0664
    directory mask = 0774
    valid users = @showroom,scanner
    max connections = 10
[vendas]
    comment = restrito ao setor
    path = /home/samba/vendas
    browseable = yes
    wide links = no
    follow symlinks = yes
    writable = yes
    write list = @vendas,scanner
    nt acl support = no
    veto files = /*.bat/*.exe/*.avi/*.wmv/*.mov/*.flv/*.mp4/*rmvb/*iso/*.mp3/*.com/*.src/*.inf/*.cab/*.pif/*.dat/*.cmd/*.vbs/*.vbe/*.shs/*.js/*.ogg/*.mkv
    delete veto files = yes
    create mask = 0664
    directory mask = 0774
    valid users = @vendas,scanner
[adm]
    comment = restrito ao setor
    path = /home/samba/adm
    browseable = yes
    wide links = no
    follow symlinks = yes
    writable = yes
    write list = @adm,scanner
    nt acl support = no
    veto files = /*.bat/*.exe/*.avi/*.wmv/*.mov/*.flv/*.mp4/*rmvb/*iso/*.mp3/*.com/*.src/*.inf/*.cab/*.pif/*.dat/*.cmd/*.vbs/*.vbe/*.shs/*.js/*.ogg/*mkv
    delete veto files = yes
    create mask = 0664
    directory mask = 0774
    valid users = @adm,scanner
[oficina]
    comment = restrito ao setor
    path = /home/samba/oficina
    max connections = 10
    wide links = no
    follow symlinks = yes
    browseable = yes
    read only = yes
    write list = @oficina
    nt acl support = no
    veto files = /*.bat/*.rmvb/*.avi/*.mp4/*.mp3/*.wmv/*.flv/*.wmv/*.mp3/*.com/*.src/*.inf/*.cab/*.pif/*.dat/*.cmd/*.vbs/*.vbe/*.shs/*.js/*.ogg/*.mkv
    delete veto files = yes
    force user = root
    force group = oficina
    valid users = @oficina,scanner
[leonardo]
    comment = restrito
    path = /home/samba/leonardo
    max connections = 5
    wide links = no
    follow symlinks = yes
    browseable = yes
    read only = yes
    nt acl support = no
    veto files = /*.bat/*.exe/*.avi/*.wmv/*.mov/*.flv/*.mp4/*rmvb/*iso/*.mp3/*.com/*.src/*.inf/*.cab/*.pif/*.dat/*.cmd/*.vbs/*.vbe/*.shs/*.js/*.ogg/*mkv
    delete veto files = yes
    write list = @sambausers
    valid users = @sambausers
    create mask = 0664
    directory mask = 0774
[laurentino]
    comment = restrito
    path = /home/samba/laurentino
    max connections = 5
    wide links = no
    follow symlinks = yes
    browseable = yes
    writable = yes
    nt acl support = no
    veto files = /*.bat/*.exe/*.avi/*.wmv/*.mov/*.flv/*.mp4/*rmvb/*iso/*.mp3/*.com/*.src/*.inf/*.cab/*.pif/*.dat/*.cmd/*.vbs/*.vbe/*.shs/*.js/*.ogg/*.mkv
    delete veto files = yes
    write list = @sambausers
    valid users = @sambausers
    create mask = 0664
    directory mask = 0774
[recepcao]
    comment = restrito ao setor
    path = /home/samba/recepcao
    browseable = yes
    wide links = no
    follow symlinks = yes
    max connections = 5
    read only = no
    nt acl support = no
    veto files = /*.bat/*.exe/*.avi/*.wmv/*.mov/*.flv/*.mp4/*rmvb/*iso/*.mp3/*.com/*.src/*.inf/*.cab/*.pif/*.dat/*.cmd/*.vbs/*.vbe/*.shs/*.js/*.ogg/*.mkv
    delete veto files = yes
    valid users = @sambausers
    write list = @sambausers
    create mask = 0664
    directory mask = 0774
[alexandre]
    comment = restrito
    path = /home/samba/alexandre
    max connections = 5
    wide links = no
    follow symlinks = yes
    browseable = yes
    read only = no
    nt acl support = no
    veto files = /*.bat/*.exe/*.avi/*.wmv/*.mov/*.flv/*.mp4/*rmvb/*iso/*.mp3/*.com/*.src/*.inf/*.cab/*.pif/*.dat/*.cmd/*.vbs/*.vbe/*.shs/*.js/*.ogg/*.mkv
    delete veto files = yes
    write list = @sambausers
    valid users = @sambausers
    create mask = 0664
    directory mask = 0774
[FAX]
    comment = fax
    path = /home/samba/fax
    browseable = yes
    wide links = no
    follow symlinks = yes
    read only = no
    guest ok = yes
    nt acl support = no
    veto files = /*.bat/*.exe/*.avi/*.wmv/*.mov/*.flv/*.mp4/*rmvb/*iso/*.mp3/*.com/*.src/*.inf/*.cab/*.pif/*.dat/*.cmd/*.vbs/*.vbe/*.shs/*.js/*.ogg/*.mkv
    delete veto files = yes
    max connections = 0
    create mask = 0666
    directory mask = 0777
  


Comentários
[1] Comentário enviado por agleson em 07/11/2014 - 11:03h

Olá amigo, vamos pegar por exemple a pasta [recepcao], vamos supor que tenho 3 usuários (Joao, Maria e Lucas)e desses usuários somente 2 pode escrever que são (Joao e Maria) e 1 somente leitura no caso (Lucas) como configurar? me dê um exemplo.

[2] Comentário enviado por rafaelgrinder em 07/11/2014 - 12:25h

use a diretiva:
read only = yes
write list = joao maria


Contribuir com comentário

  



Patrocínio

Site hospedado pelo provedor RedeHost.
Linux banner

Destaques

Artigos

Dicas

Tópicos

Top 10 do mês

Scripts