Page 1 of 1

error in smb

Posted: 2021/09/18 17:27:37
by Jonigueh
Best regard. Please I have an error with the SMB of CentOs 8, I do not connect to any Windows 10 computer. attached configuration of the smb.conf file

[global]
workgroup = MYECOLOMBIA
# passdb backend = tdbsam
printing = cups
printcap name = cups
printcap cache time = 750
cups options = raw
# map to guest = Bad User
include = /etc/samba/dhcp.conf
logon path = \\%L\profiles\.msprofile
logon home = \\%L\%U\.9xprofile
logon drive = P:
usershare allow guests = No
add machine script = /usr/sbin/useradd -c Machine -d /var/lib/nobody -s
/bin/false %m$
domain logons = No
domain master = No
security = user
wins support = No

[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 = @ntadmin root
force group = ntadmin
create mask = 0664
directory mask = 0775


path = /u
browseable = Yes
writeable = Yes
guest ok = Yes
read only = No
directory mask = 0777

Re: error in smb

Posted: 2021/09/19 03:32:42
by BShT
if you security = user

you have to

adduser user

smbpasswd -a user

and i think you mix domain client and non domain confs...

Re: error in smb

Posted: 2021/09/19 14:32:26
by TrevorH
path = /u
browseable = Yes
writeable = Yes
guest ok = Yes
read only = No
directory mask = 0777
This is missing a share name heading like "[homes]" so it will be either ignored or treated as part of the preceding [print$] section and that is just wrong.

Also, if the path to the share you want to create is really "/u" then it's non-standard and you will need to read the instructions that are in /etc/samba/smb.conf.example to find out how you tell selinux that it's OK for that path to be used.

Re: error in smb

Posted: 2021/09/19 15:58:43
by pjsr2
Samba comes with a utility called "testparm" to check the validity of your configuration file.
Of course, testparm can only check the syntax, and there are many ways to create a non-functional configuration file that is syntactically correct. So an "OK" from testparm does not guarantee that your config file is perfect. See man testparm.

In your case, the config file is syntactically correct. However, testparm presents the contents in the way it has interpreted it, leaving out all unchanged settings. In that output, it is obvious that testparm concludes that

Code: Select all

path = /u
browseable = Yes
writeable = Yes
guest ok = Yes
read only = No
directory mask = 0777
belongs to the "[print$]" section, and this could have helped you to spot the error. As TrevorH already has pointed out, you are probably missing a "[homes]" heading.

error smb

Posted: 2021/09/25 15:43:22
by Jonigueh
When I try to connect from CentOs 8 to a Windows 10 computer it always asks for a username and password and Domain appears and there is no domain on Windows 10 computers. This is the configuration of my smb.conf file, the / u partition is necessary. So I had it with OpenSuse and everything worked fine, but now that we migrated to CentOs 8 because it was necessary for our software, the connection and the printers do not work.


[global]
workgroup = MYECOLOMBIA
# passdb backend = tdbsam
printing = cups
printcap name = cups
printcap cache time = 750
cups options = raw
# map to guest = Bad User
include = /etc/samba/dhcp.conf
logon path = \\%L\profiles\.msprofile
logon home = \\%L\%U\.9xprofile
logon drive = P:
usershare allow guests = No
add machine script = /usr/sbin/useradd -c Machine -d /var/lib/nobody -s /bin/false %m$
domain logons = No
domain master = No
security = user
wins support = No

[homes]
browseable = No
comment = Home Directories
inherit acls = Yes
read only = No

[home]
comment = Home Directories
path = /home/
valid users = %S, %D%w%S
browseable = Yes
writable = yes
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 = @ntadmin root
force group = ntadmin
create mask = 0664
directory mask = 0775


path = /u
browseable = Yes
writeable = Yes
guest ok = Yes
read only = No
directory mask = 0777
create mask = 777

Re: error in smb

Posted: 2021/09/25 16:54:48
by TrevorH
Please don't make duplicate posts. I've merged this one in with the original as you don't appear to have taken any notice of the replies you have received so far.