Samba Shares Problem

General support questions
russiank
Posts: 2
Joined: 2017/11/15 09:05:06

Samba Shares Problem

Postby russiank » 2017/11/15 10:07:19

Hi Everyone.

Ill start off by saying I'm very new to Cent-OS7 and Cent-OS in general. I do use Manjaro on my Work Laptop. I have configures Samba before but only ever for individual users on individual Folders. and that i can get to work no problem. I have been testing setting up group shares as we have a client of ours that is looking for a new "server" but they just want something to run as a file server Hence me looking at Cent-OS rather than getting them a new windows server with server OS. I don't see the point in them spending that much money when they just want a file server

Ok so enough of the back story. Like i mentioned before i am able to set samba up for individual users which is fine if I want to share data between my laptop and home desktop

Just a side Note this isn't the final setup. Iv been playing with Cent-OS to familiarise myself with it before we look at installing it at a customer

However for our clients purposes i need to assign groups to allow access to certain data e.g. sales should't be able to access Finance data. as well as some users needing access to all data whether its sales or finance etc. i created 2 groups. added all users to one group. and just certain users to the 2nd. i also have a seperate folder with only one share user allocated. which i used just to confirm samba was working. after which i setup 2 folders. created the additional users. and the 2 groups. added the users to the groups created user smb passwords etc. after which the folders show on the windows machines but i am unable to access them or the original folder i setup to test either.

I have spent alot of time on google with this issue and i have tried reinstalling centos and setting up samba groups with several different guides to no avail. below you will find my smb.conf info. any help i could get would be much appreciated

# See smb.conf.example for a more detailed config file or
# read the smb.conf manpage.
# Run 'testparm' to verify the config is correct after
# you modified it.

[global]
workgroup = WORKGROUP
security = user

passdb backend = tdbsam

printing = cups
printcap name = cups
load printers = yes
cups options = raw

;[homes]
; comment = Home Directories
; valid users = %S, %D%w%S
; browseable = No
; read only = No
; inherit acls = Yes

[printers]
comment = All Printers
path = /var/tmp
printable = Yes
create mask = 0600
browseable = No

[print$]
comment = Printer Drivers
path = /var/lib/samba/drivers
write list = root
create mask = 0664
directory mask = 0775

[RestrictedAdmin]
path = /home/admin/Public
read only = No
guest ok = No
valid users = admin
browsable = Yes

[Finance]
path = /nvs/Finance
read only = No
guest ok = No
valid users = @Finance
browsable = Yes

[CompanyData]
path = /nvs/CompanyData
read only = No
guest ok = No
valid users = @Users
browsable = Yes

rodrigoyoshioka
Posts: 1
Joined: 2017/11/17 10:29:03

Re: Samba Shares Problem

Postby rodrigoyoshioka » 2017/11/17 10:41:29

Hi @russiank, when I changed to CentOS7 with samba 4 I had some problems too. I'll tell what happened and what I did to solve. Maybe it may help you.

First, after days trying to make samba works, I realize that the problem was because I share folders inside /home/user folder, I used to do that in previous versions but in this one, it return permissions errors, so in your configuration you share a "/home/admin/Public" it didn't work for me. I solved it creating a folder in /.

I have a samba 4 with many groups and users that are allowed to access their group folder with password, and a public folder without password, I'll share my samba configuration.

Code: Select all

[global]
        workgroup = WORKGROUP
        server string = Servidor de Arquivos
        netbios name = SERVIDOR
        interfaces = lo enp3s0 127.0.0.1 172.16.0.0/24 xxx.xxx.xxx/28
        hosts allow = 127. 172.16.0. xxx.xx.xxx.xxx.
        log file = /var/log/samba/log.%m
        max log size = 50
        security = user
        passdb backend = tdbsam
        map to guest = bad user
        dns proxy = no
        load printers = no
        cups options = raw
        printcap name = /dev/null
        printing = bsd
        wide links = yes
        unix extensions = no

[SCANNER]
        comment = Arquivos do Scanner
        path = /home/arquivos/scanner
        browseable = yes
        writable = yes
        guest ok = yes
        create mask = 0770
        directory mask = 0770
        force group = nobody

[PASTA PUBLICA]
        comment = Arquivos que todos podem ter acesso
        path = /home/arquivos/publico
        browseable = yes
        writable = yes
        guest ok = yes
        create mask = 0770
        directory mask = 0770
        force group = nobody

[ALMOXARIFADO]
        comment = Arquivos do Almoxarifado
        path = /home/arquivos/almoxarifado
        browseable = yes
        writable = yes
        guest ok = no
        valid users = @almoxarifado, leonardo, @diretoria, edgar
        create mask = 0770
        directory mask = 0770
        force group = almoxarifado

[CENTRAL_DE_RELACIONAMENTO]
        comment = Arquivos da Central de Relacionamento
        path = /home/arquivos/central_de_relacionamento
        browseable = yes
        writable = yes
        guest ok = no
        valid users = @centralderelacionamento, @diretoria, leonardo.m
        create mask = 0770
        directory mask = 0770
        force group = centralderelacionamento


I hope it my help you.

russiank
Posts: 2
Joined: 2017/11/15 09:05:06

Re: Samba Shares Problem

Postby russiank » 2017/11/20 06:39:21

Hi @rodrigoyoshioka. Thanks for your response for some reason i didn't get notified that there was a reply on my post.

the share that was in public was just me making sure samba was working. there wont be ant shares in public when this gets implemented at the client.

I will have a look through your config when i have a moment, Im one man manning the fort today.... its only 8.30am and i already feel like its time to go home..... Will let you know when iv had a look at it and if it works for me.