Folder Permissions with Samba

Asked

Viewed 528 times

0

Good evening, everyone.

I have a file server on Linux, which is consumed on Windows. Each department has its own specific folder (and they all use a public folder), and I need only the user of that department to be able to access its folder (no problem it is visible to other users).

I did the procedures as follows:

  1. I created users on linux and samba;
  2. I created the folders;
  3. I changed the folder owner (chown usuario:usuario Folder name);
  4. I put the folder and the user in smb.conf

When I access the server by ip (for example 192.168.1.100/Files) in windows explorer, I have the desired result, ie the user who is logged in (I typed the user and the password) will only have access to your folder. However, if I map the server address with the net use, all folders are released (net use Z: 192.168.1.100 files /user: userName password).

I made several changes to smb.conf to try to get around it and I have no idea how to fix it.

I’ll put snippets of my smb.conf

[global]
    workgroup = SAMBA
    security = user
    valid users = adm ##Já coloquei o nome de todos os usuarios aqui para testar
    passdb backend = tdbsam
    wins support = yes
    netbios name = NomeExemplo
    map to guest = bad user
    guest account = nobody

[Arquivos]
    path = /mnt/Arquivos
    writable = yes
    guest ok = yes
    admin users = adm
    write list = adm
    browseable = yes
    guest only = yes

[Pasta Setor1]
    path = /mnt/Arquivos/Pasta Setor1
    valid users = usuario1
    write list = usuario1
    public = no
    browseable = yes
    writable = yes

[Pasta Setor2]
    path = /mnt/Arquivos/Pasta Setor2
    valid users = usuario2
    write list = usuario2
    public = no
    browseable = yes
    writable = yes

[Pasta Publica]
    path = /mnt/Arquivos/Pasta Publica
    comment = Pasta Publica
    public = yes
    browseable = yes
    writable = yes

I appreciate the help in case someone has already been through this or thinks there is something wrong in smb.conf

  • Remove or comment the line valid users in [GLOBAL], restart samba and try again.

  • The same way. It works the way I need it if I go straight through the server’s ip. If I map it, it’s all clear.

  • how are the permissions of each directory?

  • I put 660, 600 and 777

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.