Samba what am I doing wrong?

Soldato
Joined
19 Oct 2002
Posts
6,819
Location
Bath
I have a Hyper-V Debian server running my pihole and want to make better use of the server, so I decided to see how well I could share from and to it, so following This guide I installed samba and set it up exactly as per the guide but I get the following error when I do /etc/init.d/samba status

jingo.jpg


Any Idea what I've done wrong or what I need to change?

Thanks.
 
Soldato
Joined
10 Oct 2005
Posts
8,706
Location
Nottingham
No because you have no meaningful error messages there other than that the NMBD and SMBD processes haven't started (I would also note that from the messages the system appears to be using systemd so I am surprised you are using init scripts to start the service).

Try running the two commands it mentions on the third line (starting "See") as well as posting your smb.conf file.
 
Soldato
Joined
3 Oct 2013
Posts
3,597
Use systemctl for services ect. You can end up with some weird issues when mixing both

Code:
systemctl status nmbd.service
systemctl status smbd.service
journalctl -u nmbd.service
journalctl -u smbd.service

May shine more light on why it's failing

Run testparm to check syntax ect of your smb.conf file too, may have errors.
 
Soldato
OP
Joined
19 Oct 2002
Posts
6,819
Location
Bath
The SMB.conf is fine checked before starting services and it's all good, started the services independently and they work as they should, but I still cannot access the share, will post my conf in a sec.
 
Soldato
OP
Joined
19 Oct 2002
Posts
6,819
Location
Bath
smb.conf is as follows
Code:
[global]
workgroup = REGIMENT
server role = standalone server

[homes]
comment = Home Directories
browsable = yes
writable = yes

[public]
path = /media/storage/
public = yes
writable = yes
comment = Linux Share
printable = no
only guest = yes

Permissions for /media/storage/ are 777
 
Soldato
Joined
10 Oct 2005
Posts
8,706
Location
Nottingham
Have you tried commenting the idmap line given that your share settings allow for guest access so you shouldn't need to authenticate so it shouldn't be needed?

You also might want to add some logging lines to the global section to see if any more information is given out

Code:
   log file = /var/log/samba/log.%m
   log level = 3
 
Associate
Joined
9 Jun 2004
Posts
1,399
Do you want to use authentication for the share or just access it freely? I'm not an expert by any means but if you just want open access I think you will need to change the owner of the folder too. I believe that Windows uses nobody:nogroup.
 
Associate
Joined
9 Jun 2004
Posts
1,399
On my share I have the following:

[storage]
path = /storage
browsable =yes
writable = yes
guest ok = yes
public = yes
read only = no
create mask = 0777
directory mask = 0777
force user = raymond
force group = raymond

The shared folder is /storage (obviously) it's owner is raymond:raymond and permissions are 777.

This requires that I enter the credentials for raymond the first time I access the share from Windows but everything just works after that.
 
Soldato
OP
Joined
19 Oct 2002
Posts
6,819
Location
Bath
On my share I have the following:

[storage]
path = /storage
browsable =yes
writable = yes
guest ok = yes
public = yes
read only = no
create mask = 0777
directory mask = 0777
force user = raymond
force group = raymond

The shared folder is /storage (obviously) it's owner is raymond:raymond and permissions are 777.

This requires that I enter the credentials for raymond the first time I access the share from Windows but everything just works after that.
Thanks will try similar conf later off to work now.
 
Soldato
OP
Joined
19 Oct 2002
Posts
6,819
Location
Bath
Ok so I removed samba and reinstalled via apt-get and built a new conf using the advice here and it works straight away! dunno what was going on before tbh, just need a cron now to activate samba every time it boots.
 
Associate
Joined
9 Jun 2004
Posts
1,399
If you installed via apt, you shouldn't need a cron. It should already be enabled in systemd -
sudo systemctl status smbd
sudo systemctl status nmbd

If they aren't enabled then -
sudo systemctl enable smbd
sudo systemctl enable nmbd

Then reboot and samba should be running.
 
Associate
Joined
3 May 2018
Posts
604
then chmod 777 on the folder.

No, no, no, no.

Nor this:
create mask = 0777
directory mask = 0777

It's lazy, dumb and insecure.

775, mask 775 is what you want. Really it should be 664 for files, 775 for directories. Not making files world executable is exactly how Linux has avoid viruses for so many years.
 
Back
Top Bottom