Delete configuration Samba

Hi,

I have tried to set up Samba on my new installation and I almost had it. I made some tweaks in the configuration, and suddenly the shares were gone on my Windows machines. I did something I can’t remember. Is it a way to delete the configuration so I can start a new with setting up Samba? I even got a message in dolphin saying it could not connect to smb localhost.

Dag R

The smb.conf file is the pertinent config file for samba.

I even got a message in dolphin saying it could not connect to smb localhost.

Dag R

Check

sudo systemctl status smb

Any errors?

BTW, what does testparm report?

testparm -s

testparm -s

dagr@opensuse22:~> testparm -s 
Load smb config files from /etc/samba/smb.conf 
Loaded services file OK. 
Weak crypto is allowed 

Server role: ROLE_STANDALONE 

# Global parameters 
[global] 
        logon drive = P: 
        logon home = \\%L\%U\.9xprofile 
        logon path = \\%L\profiles\.msprofile 
        map to guest = Bad User 
        printcap name = cups 
        usershare allow guests = Yes 
        usershare max shares = 100 
        wins support = Yes 
        idmap config * : backend = tdb 
        cups options = raw 


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


[profiles] 
        comment = Network Profiles Service 
        create mask = 0600 
        directory mask = 0700 
        path = %H 
        read only = No 


[users] 
        comment = All users 
        guest ok = Yes 
        inherit acls = Yes 
        path = /home 
        read only = No 
        veto files = /aquota.user/groups/shares/ 


[groups] 
        comment = All groups 
        inherit acls = Yes 
        path = /home/groups 
        read only = No 


[Nedlastinger] 
        guest ok = Yes 
        inherit acls = Yes 
        path = /home/dagr/Nedlastinger 
        read only = No 


[Plysh] 
        guest ok = Yes 
        inherit acls = Yes 
        path = /home/dagr/Plysh 
        read only = No



systemctl status smb:

systemctl status smb 
● smb.service - Samba SMB Daemon 
     Loaded: loaded (/usr/lib/systemd/system/smb.service; enabled; vendor preset: disabled) 
     Active: active (running) since Sun 2022-09-11 21:48:23 CEST; 18h ago 
       Docs: man:smbd(8) 
             man:samba(7) 
             man:smb.conf(5) 
    Process: 5880 ExecStartPre=/usr/share/samba/update-apparmor-samba-profile (code=exited, status=0/SUCCESS) 
   Main PID: 5889 (smbd) 
     Status: "smbd: ready to serve connections..." 
      Tasks: 4 (limit: 4915) 
     CGroup: /system.slice/smb.service 
             ├─ 5889 /usr/sbin/smbd --foreground --no-process-group 
             ├─ 5891 /usr/sbin/smbd --foreground --no-process-group 
             ├─ 5892 /usr/sbin/smbd --foreground --no-process-group 
             └─ 5893 /usr/lib64/samba/samba-bgqd --ready-signal-fd=47 --parent-watch-fd=13 --debuglevel=0 -F



When you say the shares were gone, do you actually mean you can’t discover the shares automatically? Or that when you try to access them by a file manager you are denied access?

It should be as simple as navigating to them with “\<IP address or hostname>&lt;share>”

The shares on my windows machine does not appear and when I tries to take them up in Dolphin (network shares) on the Opensuse server it says:

Klarte ikke kople til vert for smb://opensuse22.local/ No shared folders found.


The first part is in Norwegian and means: cannot connect to (host) local shares. I must have done something wrong here.

Dag R

On the server check

smbclient -L localhost

I expect that to show the shares without any issue.

Also, regarding the Avahi hostname “opensuse22.local”…

On the openSUSE host itself, check

avahi-resolve-host-name opensuse22.local

Can you ping that successfully from the Windows machine?

ping opensuse22.local

If you use the actual IP address in the Windows file manager, does it work ok?

All the tests you made me do works but the ip adress in the file manager.

Dag R

Ok. Next thing to check is your openSUSE firewall.

firewall-cmd --list-all
firewall-cmd --list-all 
public (active) 
  target: default 
  icmp-block-inversion: no 
  interfaces: eth1 
  sources:  
  services: dhcpv6-client samba 
  ports:  
  protocols:  
  forward: no 
  masquerade: no 
  forward-ports:  
  source-ports:  
  icmp-blocks:  
  rich rules: 



I changed the global setup from the post on the howto pages on the forum, and it works now. I have som problems with the users on the windows network, but I will place those questions in another thread.

Dag R

Can you share which parameters were causing problems for you? It might help others who come searching.

I went to Swerdnas post for setting up Samba https://forums.opensuse.org/content.php/199-Configure-Samba-for-Local-Lan-Workgroup. Then I went to the part «Reconfigure global stanza» and replaced the lines in my stanza with the one in the article and restartet smb/nmb.

Then I wrote the adress of the share in the file manager in Windows on the form “\<hostname>&lt;share>” , and the shares appeared. When I did that before the reconfiguring I only wrote in the host name without backslashes. Maybe it would have worked without reconfiguring the stanza, if I had I read the answers in the thread more thoroughly.

Thanx for the help.

Dag R

Ok, that old article describes the same as the default ‘samba-client’ package provides. You had added

wins support = Yes
idmap config * : backend = tdb 

Not sure what impact that might have had (if any).

Then I wrote the adress of the share in the file manager in Windows on the form “\<hostname>&lt;share>” , and the shares appeared. When I did that before the reconfiguring I only wrote in the host name without backslashes. Maybe it would have worked without reconfiguring the stanza, if I had I read the answers in the thread more thoroughly.

Thanx for the help.

Dag R

Yes, the correct way to enter the shared network share is using the format ‘\hostname\share’. Anyway, good to read that it is working as expected now.

Only one thing, when I go to Dolphin and click on Network -> shared folders (smb) I get the main folder (opensuse22), but when I click on the folder i get the message: No folders found. When I go to details at says the folder has no owner. This must be wrong? I did some mess with Samba users. I made one completely new user and made a copy of my personal user. This may have affected I can not open this network folder on the server. Can you help me out here?

Dag R

That is actually the host (not the share).

…but when I click on the folder i get the message: No folders found. When I go to details at says the folder has no owner. This must be wrong?

Show the permissions of that folder, as specified in your working smb.conf.

I don’t understand your answer. Could you explain where I find those permissions? Is it in the global ,or do you mean I have to set the permssions, or have I already set the permissions (but not aware of it)?

Dag R

I meant checking the directories you shared eg /home/dagr/Nedlastinger (as listed in smb.conf)…

ls -ld /home/dagr/Nedlastinger

Ok. I thought it was enough to mark them in the smb.conf as shared. I have opened those to folders for guest access, and now it works. The only thing I have not got to work properly is the access of the host in Dolphin (on the host). But Samba and file sharing works, and that’s the main thing.

Dag R