Configurando um servidor de arquivos no Samba.
Este arquivo mostra como configurar um Servidor de Arquivos no Samba
#CONFIGURAÇÃO SERVIDOR ARQUIVO SAMBA
cd /etc/samba
mv smb.conf-sample smb.conf
vim /etc/samba/smb.conf
#NA SEÇÃO GLOBAL DEIXE COMO NO MODELO ABAIXO:
workgroup = coloque o nome para o grupo ou domínio
server string = servidor samba
os level = 100
#VÁ PARA O FINAL DO ARQUIVO E ACRESCENTE:
encrypt passwords = yes
smb passwd file = /etc/samba/smbpasswd
[diretoria]
comment = pasta diretória
path = /home/diretoria
browseable = yes
writable = yes
force directory mode = 0777
force create mode = 0777
valid users = @diretoria
write list = @diretoria
[financeiro]
comment = pasta financeiro
path = /home/financeiro
browseable = yes
writable = yes
force directory mode = 0777
force create mode = 0777
valid users = @financeiro
write list = @financeiro
[rh]
comment = pasta rh
path = /home/rh
browseable = yes
writable = yes
force directory mode = 0777
force create mode = 0777
valid users = @rh
write list = @rh
[suporte]
comment = Pasta suporte
path = /home/suporte
browseable = Yes
writable = Yes
force directory mode = 0777
force create mode = 0777
valid users = @suporte
write list = @suporte
veto files = /*mp3/*jpg/*wma/*gif
[publica]
comment = pasta publica
browseable = yes
writable = yes
public = yes
#SALVE E SAIA DO ARQUIVO DE CONFIGURAÇÃO.
#VERIFICAR SE EXISTE ERRO NO ARQUIVO DE CONFIGURAÇÃO
testparm /etc/samba/smb.conf
#CRIAÇÃO DOS DIRETÓRIOS:
mkdir /home/diretoria financeiro rh suporte publica
#CRIAÇÃO DOS GRUPOS:
groupadd diretoria
groupadd financeiro
groupadd rh
groupadd suporte
#CRIAÇÃO DOS USUÁRIOS DO SISTEMA:
useradd –g diretoria –s /binf/false –d /dev/null dir1
useradd –g financeiro –s /bin/false –d /dev/nul l fin1
useradd –g rh –s /bin/false –d /dev/null rh1
useradd –g suporte –s /bin/false –d /dev/null sup1
#PERMISSÕES NOS DIRETÓRIOS:
chmod 770 /home/diretoria/ -R
chmod 770 /home/financeiro/ -R
chmod 770 /home/rh/ -R
chmod 770 /home/suporte/ -R
chmod 777 /home/publica/ -R
#MUDANDO O DONO DOS DIRETÓRIOS:
cd /home
chown dir1:diretoria diretoria/ -R
chown fin1:financeiro financeiro/ -R
chown rh1:rh rh/ -R
chown sup1:suporte suporte/ -R
#CRIAÇÃO DOS USUÁRIOS SAMBA:
smbpasswd –a rh1
smbpasswd –a fin1
smbpasswd –a rh1
smbpasswd –a sup1
#CONFIGURAÇÃO SERVIDOR ARQUIVO SAMBA
cd /etc/samba
mv smb.conf-sample smb.conf
vim /etc/samba/smb.conf
#NA SEÇÃO GLOBAL DEIXE COMO NO MODELO ABAIXO:
workgroup = coloque o nome para o grupo ou domínio
server string = servidor samba
os level = 100
#VÁ PARA O FINAL DO ARQUIVO E ACRESCENTE:
encrypt passwords = yes
smb passwd file = /etc/samba/smbpasswd
[diretoria]
comment = pasta diretória
path = /home/diretoria
browseable = yes
writable = yes
force directory mode = 0777
force create mode = 0777
valid users = @diretoria
write list = @diretoria
[financeiro]
comment = pasta financeiro
path = /home/financeiro
browseable = yes
writable = yes
force directory mode = 0777
force create mode = 0777
valid users = @financeiro
write list = @financeiro
[rh]
comment = pasta rh
path = /home/rh
browseable = yes
writable = yes
force directory mode = 0777
force create mode = 0777
valid users = @rh
write list = @rh
[suporte]
comment = Pasta suporte
path = /home/suporte
browseable = Yes
writable = Yes
force directory mode = 0777
force create mode = 0777
valid users = @suporte
write list = @suporte
veto files = /*mp3/*jpg/*wma/*gif
[publica]
comment = pasta publica
browseable = yes
writable = yes
public = yes
#SALVE E SAIA DO ARQUIVO DE CONFIGURAÇÃO.
#VERIFICAR SE EXISTE ERRO NO ARQUIVO DE CONFIGURAÇÃO
testparm /etc/samba/smb.conf
#CRIAÇÃO DOS DIRETÓRIOS:
mkdir /home/diretoria financeiro rh suporte publica
#CRIAÇÃO DOS GRUPOS:
groupadd diretoria
groupadd financeiro
groupadd rh
groupadd suporte
#CRIAÇÃO DOS USUÁRIOS DO SISTEMA:
useradd –g diretoria –s /binf/false –d /dev/null dir1
useradd –g financeiro –s /bin/false –d /dev/nul l fin1
useradd –g rh –s /bin/false –d /dev/null rh1
useradd –g suporte –s /bin/false –d /dev/null sup1
#PERMISSÕES NOS DIRETÓRIOS:
chmod 770 /home/diretoria/ -R
chmod 770 /home/financeiro/ -R
chmod 770 /home/rh/ -R
chmod 770 /home/suporte/ -R
chmod 777 /home/publica/ -R
#MUDANDO O DONO DOS DIRETÓRIOS:
cd /home
chown dir1:diretoria diretoria/ -R
chown fin1:financeiro financeiro/ -R
chown rh1:rh rh/ -R
chown sup1:suporte suporte/ -R
#CRIAÇÃO DOS USUÁRIOS SAMBA:
smbpasswd –a rh1
smbpasswd –a fin1
smbpasswd –a rh1
smbpasswd –a sup1
Nenhum comentário:
Postar um comentário