Samba - failed to load configuration file

Hello,

Merry Christmas everyone!

I am trying to get Samba working and I have it installed but not sure what to do next. When I try to check the status I get:

[~]$ samba
[2021/12/27 15:00:15,  0] ../../lib/util/debug.c:1100(reopen_one_log)
  reopen_one_log: Unable to open new log file '/var/log/samba/log.samba': Permission denied
Can't load /etc/samba/smb.conf - run testparm to debug it
samba - Failed to load config file!
[~]$

I then run testparm and get:

[ ~]$ testparm
Load smb config files from /etc/samba/smb.conf
Error loading services.
[ ~]$

Any ideas? Thanks!

Ok so I just created a blank smb.conf file and I got passed the above. That seemed to be the issue for the above. But now I’m stuck at:

samba
[2021/12/27 15:40:22,  0] ../../lib/util/debug.c:1100(reopen_one_log)
  reopen_one_log: Unable to open new log file '/var/log/samba/log.samba': Permission denied
[2021/12/27 15:40:22.737805,  0] ../../source4/samba/server.c:626(binary_smbd_main)
  samba version 4.15.3 started.
  Copyright Andrew Tridgell and the Samba Team 1992-2021
[2021/12/27 15:40:22.739235,  0] ../../lib/util/become_daemon.c:119(exit_daemon)
  exit_daemon: daemon failed to start: Failed to cleanup temporary files, error code 22
[ ~]$

@rebornosday One of the problems is that while creating the conf (not the log yet) file, it seems like the permissions weren’t set correctly. After extending the permissions of the /etc/samba/smb.conf file to 770, try running testparm. Check if it still says that it cannot open the conf file.

Perhaps also try extending the permissions of the /var/log/samba/log.samba file after that.

1 Like

Thanks permissions updated and now when running “samba” in terminal there is no longer any output. I checked the logs and now its just outputting this there now:

[2021/12/27 15:49:17.378724,  0] ../../source4/samba/server.c:626(binary_smbd_main)
  samba version 4.15.3 started.
  Copyright Andrew Tridgell and the Samba Team 1992-2021
[2021/12/27 15:49:17.380038,  0] ../../lib/util/become_daemon.c:119(exit_daemon)
  exit_daemon: daemon failed to start: Failed to cleanup temporary files, error code 22

Also, in the attached image this is what I get when I try to set a share via the GUI. Thanks!

@rebornosday Enabling usershares requires this procedure to be completed.

Thanks, I followed the article here but still I get the same errors as before: How to add and enable users for Samba share - TechRepublic

What does your /etc/samba/smb.conf look like?

All I have in it is:

usershare owner only = false

The link I shared here has other things. I don’t have enough information to know what’s wrong on your end. Did you want to check the steps here?

Ahh sorry, missed the link in your text. Checking now.

Ran through it all. Its saying I don’t have permission in the GUI to add a share. So I checked what groups I’m in and its not showing I am in the “sambashare” group. So I tried to re-add it below but when I check again, I’m not in it?

[ ~]$ sudo gpasswd sambashare -a main
Adding user main to group sambashare
[ ~]$ groups
wheel main
[ ~]$

Hmm I found this command it shows I am apart of the sambashare group:

[ ~]$ getent group sambashare
sambashare:x:964:main
[ ~]$

Not sure what to do as in the GUI when I try to add a share its saying:

net usershare: cannot open usershare directory /var/lib/samba/usershares. Error Permission denied
You do not have permission to create a usershare. Ask your administrator to grant you permissions to create a share.

Your user account has to be added to the group. Here is an example on how to do it: samba - local network share error, no permission to create - Ask Ubuntu

Yeah I tried this on my second to last post above but it doesn’t fix it. I ran Nautilus with sudo and then I get this error:

Anyone have any idea why its saying invalid characters on this? Seems like its stuck on that but I have no idea why. Thanks

My guess is that the sharename probably shouldn’t be a path.