Net ushershare: usershares are currently disabled

Hi, i am trying to set up a shared folder on my local network so i can watch movies on my tv. I followed some guides and i already have samba configured but when i go to my file manager(nemo) and go to the option to share file i get this error message: **"compartilhamento de rede de usuário" retornou erro 255: net usershare: usershares are currently disabled**.
english translation = **"user network sharing" returned error 255**

My samba.conf file:

Summary

[global]

      map to guest = Bad User
      usershare allow guests = yes
      hosts deny = 0.0.0.0/0
      hosts allow = 192.168.0.0/16
      

[sharing]
      comment = Arquivos Computador
      path = /mnt/a3a6ada3-b5fc-43d2-b4ee-e38f248a9ce8/Emulators
      read only = yes
      browseable = yes
      guest ok = yes
      force user = chloe
      force group = chloe

I tried searching the error online but couldn’t find much about it and the few suggest solutions that i found where from very old posts and they didn’t work.

Worth to mention that my /var/lib/samba/usershare is empty and that i am also tired so this post is probably poorly written, sorry for that.

what does sudo systemctl status smbd say?

… also I would leave out those restrictions in the beginning, and
also you need to use chloe as user on the other machine.
and there is also a security parameter as I can remember.

As with security=user I needed to set up the smb user and assign
an smb user password too

Summary

[global]
workgroup = ynet
security = user

[adata]
comment = adata from andy1 shared
path = /run/media/andy/ADATA/
valid users = andy
public = no
writable = yes

[andy]
comment = user data andy
path = /home/andy/
valid users = andy
public = no
writable = yes

Unit smbd.service could not be found.

I did that too, i used sudo groupadd -r sambashare and sudo gpasswd -a chloe sambashare

sorry it is sudo systemctl status smb

I gues ‘d’ at the end was too much

Summary
● smb.service - Samba SMB Daemon
     Loaded: loaded (/usr/lib/systemd/system/smb.service; enabled; preset: disa>
     Active: active (running) since Mon 2022-12-05 20:04:15 -03; 1h 17min ago
       Docs: man:smbd(8)
             man:samba(7)
             man:smb.conf(5)
   Main PID: 4728 (smbd)
     Status: "smbd: ready to serve connections..."
      Tasks: 3 (limit: 19066)
     Memory: 6.3M
        CPU: 100ms
     CGroup: /system.slice/smb.service
             ├─4728 /usr/bin/smbd --foreground --no-process-group
             ├─4731 /usr/bin/smbd --foreground --no-process-group
             └─4732 /usr/bin/smbd --foreground --no-process-group

dez 05 20:04:49 compiuter smbd[4843]: [2022/12/05 20:04:49.924816,  0] ../../li>
dez 05 20:04:49 compiuter smbd[4843]:   Denied connection from 127.0.0.1 (127.0>
dez 05 20:04:49 compiuter smbd[4844]: [2022/12/05 20:04:49.927085,  0] ../../li>
dez 05 20:04:49 compiuter smbd[4844]:   Denied connection from 127.0.0.1 (127.0>
dez 05 20:04:49 compiuter smbd[4845]: [2022/12/05 20:04:49.931592,  0] ../../li>
dez 05 20:04:49 compiuter smbd[4845]:   Denied connection from 127.0.0.1 (127.0>
dez 05 20:04:49 compiuter smbd[4846]: [2022/12/05 20:04:49.932565,  0] ../../li>
lines 1-23...skipping...
● smb.service - Samba SMB Daemon
     Loaded: loaded (/usr/lib/systemd/system/smb.service; enabled; preset: disabled)
     Active: active (running) since Mon 2022-12-05 20:04:15 -03; 1h 17min ago
       Docs: man:smbd(8)
             man:samba(7)
             man:smb.conf(5)
   Main PID: 4728 (smbd)
     Status: "smbd: ready to serve connections..."
      Tasks: 3 (limit: 19066)
     Memory: 6.3M
        CPU: 100ms
     CGroup: /system.slice/smb.service
             ├─4728 /usr/bin/smbd --foreground --no-process-group
             ├─4731 /usr/bin/smbd --foreground --no-process-group
             └─4732 /usr/bin/smbd --foreground --no-process-group

dez 05 20:04:49 compiuter smbd[4843]: [2022/12/05 20:04:49.924816,  0] ../../lib/util/access.c:372(allow_access)
dez 05 20:04:49 compiuter smbd[4843]:   Denied connection from 127.0.0.1 (127.0.0.1)
dez 05 20:04:49 compiuter smbd[4844]: [2022/12/05 20:04:49.927085,  0] ../../lib/util/access.c:372(allow_access)
dez 05 20:04:49 compiuter smbd[4844]:   Denied connection from 127.0.0.1 (127.0.0.1)
dez 05 20:04:49 compiuter smbd[4845]: [2022/12/05 20:04:49.931592,  0] ../../lib/util/access.c:372(allow_access)
dez 05 20:04:49 compiuter smbd[4845]:   Denied connection from 127.0.0.1 (127.0.0.1)
dez 05 20:04:49 compiuter smbd[4846]: [2022/12/05 20:04:49.932565,  0] ../../lib/util/access.c:372(allow_access)
dez 05 20:04:49 compiuter smbd[4846]:   Denied connection from 127.0.0.1 (127.0.0.1)
dez 05 20:04:49 compiuter smbd[4847]: [2022/12/05 20:04:49.933509,  0] ../../lib/util/access.c:372(allow_access)
dez 05 20:04:49 compiuter smbd[4847]:   Denied connection from 127.0.0.1 (127.0.0.1)

here a few ideas / questions
I could guess that weird long path name could be also the problem:

why not make something nice like /media/smbshare ???

cifs already installed I suppose ??

from where are you trying to reach the shares ?

The files are stored in a different device, my system is on a 120gb ssd and my files are on a 1 terabyte hdd.

cifs already installed I suppose ??

yep

from where are you trying to reach the shares ?

An android TV running kodi, i did this before, probably faced the same error but i have a memory problem and i probably forgot to write down how i fixed it. Also thanks for taking your time to help me, really appreciate it.

so the kodi system needs to submit as chloe with the according password?
can it do that?

here an other idea, try put under global the line:

usershare owner only = false

then restart samba server

thirdly, do you own and have the rights as chloe to that data volume?

so the kodi system needs to submit as chloe with the according password?
can it do that?

Yes, it asks for a user name and password.

here an other idea, try put under global the line:

usershare owner only = false

then restart samba server

Same error

thirdly, do you own and have the rights as chloe to that data volume?

Yes, i also tested with a home folder, same error.

did you try:

sudo smbpasswd -a chloe

?

then restart

another idea: maybe are the two lines to restrictive:

“force …”

too much in your smb.conf

try valid users = chloe

instead

my conclusion I would say is:

leave out “bad user line”

use “security user”

leave out the “deny ,” line

**so you remain secure because the share is user security, and the deny line **
has higher priority …
that way it should go

I tried this but it didn’t work, but i also ““learned”” how to fix it.

Since this is a new install and I am still setting it up I kept my old OS saved in i case a needed anything. So i checked my old OS samba.conf, there i found this:

Summary

Global parameters

[global]
dns proxy = No
log file = /usr/local/samba/var/log.%m
max log size = 50
server role = standalone server
server string = Samba Server
usershare allow guests = Yes
usershare max shares = 100
usershare path = /var/lib/samba/usershare
workgroup = MYGROUP
idmap config * : backend = tdb
include = /usr/local/samba/lib/smb.conf.

[homes]
browseable = No
comment = Home Directories
read only = No

[printers]
browseable = No
comment = All Printers
path = /usr/spool/samba
printable = Yes

I tried this conf and the error message changed to something else, this time it couldn’t find the /var/lib/samba/usershare. That was a easy fix, i just deleted it and created a new file, after this i got a permission error but after i made myself the owner of the file it worked!.

But now i have no idea what exactly made it work, i tried butchering down some parts of this old config into my new one but it didn’t work.

**you could take my version, which works, presuming you went **
with sudo smbpasswd -a chloe

I also have tried this, also didn’t work. I really have no idea witch part is the one making everything work.

  1. less is more, take just those essential lines.
    Copy my smb,conf modify just the variable values.
    ( restart )
  2. Test it first with you owm machine like go to
    your own share on your own machine,
    what does it say?

Will do, but tomorrow. Is late i need some sleep.

Thanks again for the help mate.

you are welcome : - )

Did and didn’t work, but now i know why!

In some systems you need to make and configure the usershare and after doing that you need to define it on the samba.conf. After i did this the first error got fixed, but another showed up, it was due to the “hosts deny = 0.0.0.0/0” part, after i removed it it start working again.

After learning this i made a new samba.conf, and this one is working just need to check to see if the tv recognize it.

new samba.conf:

Summary
[global]
	dns proxy = No
	log file = /usr/local/samba/var/log.%m
	map to guest = Bad User
	max log size = 50
	security = USER
	server role = standalone server
	server string = Samba Server
	usershare allow guests = Yes
	usershare max shares = 100
	usershare path = /var/lib/samba/usershare
	workgroup = MYGROUP
	idmap config * : backend = tdb
	include = /usr/local/samba/lib/smb.conf.

So if you reading this and have the same problem as me, just create a usershare folder and point to it in the samba.conf file. If you don’t know how to do that here is a link to the arch wiki that explain it:https://wiki.archlinux.org/title/samba#Enable_Usershares

1 Like