jpbastos3
(usa Outra)
Enviado em 13/10/2012 - 16:46h
#etc/samba/smb.conf
[global]
admin users = joaopaulo
invalid users = root #Impede que a conta root seja usada caso invadam o servidor
netbios name = servidor
server string = servidor
workgroup = imais
domain master = yes
domain logons = yes
#Onde serao buscados os scripts de logon e variaveis de ambiente
logon script = /home/samba/netlogon/netlogon.bat
logon path = \\%L\profiles\%u
logon home = \\%L\%U
logon drive = P:
#Script para cadastrar automaticamente as maquinas que tentarem logar no servidor
add machine script = /usr/sbin/useradd -d /dev/null -g 1007 -s /bin/false -M %u
socket options = TCP_NODELAY SO_SNBFUC=8192 SO_RCVBUF=8192
null passwords = no
passwd program = /usr/bin/passwd %u
passwd chat = "*New*UNIX*password*" %n\n "*Retype*new*UNIX*password*" %n\n" *passwd:*all*authentication*tokens*updated*successfully*"
unix charset = iso8859-1
display charset = cp850
#Nivel de autenticacao
security = user
encrypt passwords = yes
enable privileges = yes
passdb backend = tdbsam
preferred master = yes
local master = yes
os level = 100
#Configuracao de impressoras - Desabilitadas
load printers = no
printing = bsd
printcap name = /dev/null
show add printer wizard = no
disable spoolss = yes
#Configuracao da Lixeira
vfs objects = recycle
recycle:keeptree = yes
recycle:versions = yes
recycle:reposiroty = /home/samba/trash/%U
recycle:exclude = *.tmp, *.log, *.obj, *.bak, *.iso
recycle:exclude_dir = tmp, cache
#Script de verificacao de credenciais e mapeamento de unidades
[netlogon]
comment = Servico de Logon
path = /home/samba/netlogon
browseable = no
guest ok = yes
#Armazenamento dos perfis moveis dos usuarios
[profiles]
path = /home/samba/profiles
read only = no
writeable = yes
browseable = no
create mask = 0600
directory mask = 0700
#Aqui comecam os compartilhamentos
[Publico]
#todos
path = /home/shares/publico
browseable = yes
writable = yes
public = yes
guest ok = yes
create mask = 0777
directory mask = 0777
vfs objects = recycle
[Administrativo]
#@root (joaopaulo alexandre)
#@administrativo (gleidson)
path = /home/shares/administrativo
browseable = yes
writable = yes
guest ok = yes
create mask = 0777
directory mask = 0777
vfs objects = recycle
valid users = @root @administrativo
[Financeiro]
#@root (joaopaulo alexandre)
#@administrativo (gleidson)
path = /home/shares/financeiro
browseable = yes
writable = yes
create mask = 0777
directory mask = 0777
vfs objects = recycle
valid users = @root @administrativo
[Marketing]
#@root (joaopaulo alexandre)
#@marketing (anapaula)
path = /home/shares/marketing
browseable = yes
writable = yes
create mask = 0777
directory mask = 0777
vfs objects = recycle
valid users = @root @marketing
[Projetos]
#@root (joaopaulo alexandre)
#@projetos (simone rosangela vilceia daiane anacarol paula alice andreza anaflavia)
path = /home/shares/projetos
browseable = yes
writable = yes
guest ok = yes
create mask = 0777
directory mask = 0777
vfs objects = recycle
valid users = @root @projetos
[Estudos Tecnicos]
#@root (joaopaulo alexandre)
#@etecnicos (elias)
path = /home/shares/etecnicos
browseable = yes
writable = yes
create mask = 0777
directory mask = 0777
vfs objects = recycle
valid users = @root @etecnicos
[Treinamentos]
#@root (joaopaulo alexandre)
path = /home/shares/treinamentos
browseable = yes
writable = yes
guest ok = yes
create mask = 0777
directory mask = 0777
vfs objects = recycle
valid users = @root @treinamentos
[Manutencao]
#joaopaulo
path = /home/shares/restrito
browseable = yes
writable = yes
create mask = 0777
directory mask = 0777
vfs objects = recycle
valid users = joaopaulo
#/home/samba/netlogon/netlogon.bat
echo Verificando permissoes, aguarde...
echo net time \\Servidor /set /yes
NET GROUPMAP ADD NTGROUP="root" UNIXGROUP=root
NET GROUPMAP ADD NTGROUP="administrativo" UNIXGROUP=administrativo
NET GROUPMAP ADD NTGROUP="marketing" UNIXGROUP=marketing
NET GROUPMAP ADD NTGROUP="projetos" UNIXGROUP=projetos
NET GROUPMAP ADD NTGROUP="etecnicos" UNIXGROUP=etecnicos
NET GROUPMAP ADD NTGROUP="treinamentos" UNIXGROUP=treinamentos
:a
\\Servidor\home\samba\netlogon\ ifmember "root"
if not errorlevel 1 goto b
net use s: \\servidor\home\shares\publico /yes
net use t: \\servidor\home\shares\administrativo /yes
net use u: \\servidor\home\shares\financeiro /yes
net use v: \\servidor\home\shares\marketing /yes
net use w: \\servidor\home\shares\projetos /yes
net use x: \\servidor\home\shares\etecnicos /yes
net use y: \\servidor\home\shares\treinamentos /yes
net use z: \\servidor\home\shares\restrito /yes
goto quit
:b
\\Servidor\home\samba\netlogon\ ifmember "administrativo"
if not errorlevel 1 goto c
net use s: \\servidor\home\shares\publico /yes
net use t: \\servidor\home\shares\administrativo /yes
net use u: \\servidor\home\shares\financeiro /yes
goto quit
:c
\\Servidor\home\samba\netlogon\ ifmember "marketing"
if not errorlevel 1 goto d
net use s: \\servidor\home\shares\publico /yes
net use t: \\servidor\home\shares\marketing /yes
goto quit
:d
\\Servidor\home\samba\netlogon\ ifmember "projetos"
if not errorlevel 1 goto e
net use s: \\servidor\home\shares\publico /yes
net use t: \\servidor\home\shares\projetos /yes
goto quit
:e
\\Servidor\home\samba\netlogon\ ifmember "etecnicos"
if not errorlevel 1 goto f
net use s: \\servidor\home\shares\publico /yes
net use t: \\servidor\home\shares\etecnicos /yes
goto quit
:f
\\Servidor\home\samba\netlogon\ ifmember "treinamentos"
if not errorlevel 1 goto quit
net use s: \\servidor\home\shares\publico /yes
net use t: \\servidor\home\shares\treinamentos /yes
goto quit
:quit
PS: Montei tanto o smb.conf quanto o netlogon.bat com base em coisas que li na internet, ainda estou aprendendo a mecher com Linux. Por favor, apontem erros de sintaxe '-'
PS2: No início falei apenas do usuario joaopaulo mas depois testei os outros e nenhum conseguiu mapear as unidades de rede.