LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Problem with Samba (https://www.linuxquestions.org/questions/linux-newbie-8/problem-with-samba-4175658324/)

PingAn 07-31-2019 04:11 AM

Problem with Samba
 
Dear all,
I installed Samba in CentOS 7 and there is error (with Samba) when shutting down the machine. Where to find out the error?

dc.901 07-31-2019 06:09 AM

Quote:

Originally Posted by PingAn (Post 6020064)
Dear all,
I installed Samba in CentOS 7 and there is error (with Samba) when shutting down the machine. Where to find out the error?

Where/how do you see the error if you do not know where to find it? How do you know it is error with samba?

If you use systemctl to stop samba service, do you get any error?

PingAn 07-31-2019 08:33 AM

1 Attachment(s)
Please see error attached to this. Thanks.

michaelk 07-31-2019 04:39 PM

The problem is actually happening when samba starts but you only see it at shutdown.

The errors indicate that some directives in your smb.conf file are not correct or the smb.conf file itself is corrupted some how. Did you edit the file and if so how?

Please post your /etc/samba/smb.conf file but please remove all the comments i.e files that start with a ; or # characters.

PingAn 07-31-2019 10:03 PM

Thanks. Here is the file (there is actual IP or domain instead of ?)
[global]
workgroup = SAMBA
security = user

passdb backend = tdbsam

printing = cups
printcap name = cups
load printers = yes
cups options = raw
workgroup = ???.??
[homes]
comment = Home Directories
valid users = %S, %D%w%S
browseable = No
read only = No
inherit acls = Yes
unix charset = UTF-8
dos charset = CP932
hosts allow = ?.?.?.?
security = smb01
passdb backend = ????
map to guest = Bad User
[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 = @printadmin root
force group = @printadmin
create mask = 0664
directory mask = 0775
[Share]
path = /home/share# shared directory
writable = yes# writable
guest ok = yes# guest allowed
guest only = yes# guest only
create mode = 0777# fully accessed file
directory mode = 0777# fully accessed directory

michaelk 08-01-2019 07:51 AM

There are directives specific to the [global] section and ones specific to the [share] section and you can use the testparm utility to verify the syntax of your smb.conf file.

Quote:

inherit acls = Yes
unix charset = UTF-8
dos charset = CP932
hosts allow = ?.?.?.?
passdb backend = ????
map to guest = Bad User
These directives belong in the [global] section and the reason for the error messages above. In addition security = smb01 is not correct. I'm not exactly sure what you are trying to accomplish but the directive should be in the [global] section. If you want to enable SMB version 1 which is not recommended, the correct syntax should be:

min procotol = SMB1

For more information see the samba guide.
https://www.samba.org/samba/docs/cur...mb.conf.5.html

PingAn 08-01-2019 11:19 PM

1 Attachment(s)
Here is current file

[global]
workgroup = SAMBA
security = user
passdb backend = tdbsam
printing = cups
printcap name = cups
load printers = yes
cups options = raw
min procotol = SMB1
# security = smb01
workgroup = ?.?
[homes]
comment = Home Directories
valid users = %S, %D%w%S
browseable = No
read only = No
inherit acls = Yes
unix charset = UTF-8
dos charset = CP932
hosts allow = ?.?.?.?
passdb backend = ??
map to guest = Bad User
[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 = @printadmin root
force group = @printadmin
create mask = 0664
directory mask = 0775
[Share]# any name you like
path = /home/share# shared directory
writable = yes# writable
guest ok = yes# guest allowed
guest only = yes# guest only
create mode = 0777# fully accessed file
directory mode = 0777# fully accessed directory

but I still get attached error.

pan64 08-02-2019 01:10 AM

you did not fix the problem mentioned by michaelk (and stated in the error message you posted)

PingAn 08-02-2019 01:49 AM

1 Attachment(s)
Here is file

[global]
workgroup = SAMBA
security = user
passdb backend = tdbsam
printing = cups
printcap name = cups
load printers = yes
cups options = raw
min procotol = SMB1
# security = smb01
workgroup = ?.?
inherit acls = Yes
unix charset = UTF-8
dos charset = CP932
hosts allow = ?.?.?.*
passdb backend = ??
map to guest = Bad User
[homes]
comment = Home Directories
valid users = %S, %D%w%S
browseable = No
read only = 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 = @printadmin root
force group = @printadmin
create mask = 0664
directory mask = 0775
[Share]# any name you like
path = /home/share# shared directory
writable = yes# writable
guest ok = yes# guest allowed
guest only = yes# guest only
create mode = 0777# fully accessed file
directory mode = 0777# fully accessed directory

and I still have got attached error below.

pan64 08-02-2019 02:59 AM

you might want to check testparm: https://www.samba.org/samba/docs/cur...estparm.1.html

michaelk 08-02-2019 07:11 AM

Once you modify the smb.conf file to manually restart samba run the command as root
systemctl start nmb
systemctl start smb


Quote:

passdb backend = ??
workgroup = ?.?
I realize your trying to hide information but there are only three available backends. tdbsam, smbpasswd or ldapsam. The default is tdbsam and is already at the top of your smb.conf file. You also already have workgroup directive and just replace SAMBA with your actual workgroup name. See below.

Quote:

workgroup = SAMBA
passdb backend = tdbsam

PingAn 08-03-2019 12:17 AM

1 Attachment(s)
Many thanks Michael.

Quote:

systemctl start nmb
systemctl start smb
Below is current smb.conf. I did change file and start it.

Quote:

[global]
workgroup = SAMBA
security = user
passdb backend = tdbsam
printing = cups
printcap name = cups
load printers = yes
cups options = raw
min procotol = SMB1
# security = smb01
inherit acls = Yes
unix charset = UTF-8
dos charset = CP932
hosts allow = ?.?.?.?
map to guest = Bad User
[homes]
comment = Home Directories
valid users = %S, %D%w%S
browseable = No
read only = 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 = @printadmin root
force group = @printadmin
create mask = 0664
directory mask = 0775
[Share]# any name you like
path = /home/share# shared directory
writable = yes# writable
guest ok = yes# guest allowed
guest only = yes# guest only
create mode = 0777# fully accessed file
directory mode = 0777# fully accessed directory

But I still get attached error.

michaelk 08-03-2019 06:13 AM

Can not see the actual error message

systemctl -l restart smb

Or look at the log

journalctl -u smb

PingAn 08-03-2019 08:53 AM

1 Attachment(s)
Quote:

systemctl -l restart smb

Or look at the log

journalctl -u smb
Thanks. I did restart smb and please see details attached below.

michaelk 08-03-2019 09:01 AM

My fault, I misspelled protocol.

Try:
min protocol = SMB1


All times are GMT -5. The time now is 02:20 AM.