You are not logged in.

#1 2014-07-24 15:38:52

swordfeng
Member
Registered: 2014-07-24
Posts: 19

[Solved] Samba usershare refuses anonymous access

Seems no reply.Changed my title.

I've just followed the instructions on wiki page "Samba" to allow usershares.
It works well with username&password, but it breaks when I set guest_ok=y
Setting a public share directly in smb.conf works.
This is the global part of my /etc/samba/smb.conf
-----------------------------------------------------------------------------
[global]
workgroup = WORKGROUP
server string = Samba Server
load printers = no
security = user
guest account = nobody
map to guest = Bad User
log file = /var/log/samba/%m.log
max log size = 50
name resolve order = wins bcast host
wins support = yes
usershare path = /var/lib/samba/usershare
usershare max shares = 100
usershare allow guests = yes
usershare owner only = False
--------------------------------------------------------------------
and this is /var/lib/samba/usershare/xxx
------------------------------------------------------------------
#VERSION 2
path=/home/swordfeng/xxx
comment=
usershare_acl=S-1-1-0:R,S-1-5-21-657951478-151232139-423176409-1001:F
guest_ok=y
sharename=xxx
------------------------------------------------------------------
And a log:
process_usershare_file: stat of /var/lib/samba/usershare/xxx failed. Permission denied.


Googled the problem and tried everything to fix it but no use
If anyone can make usershare with anonymous access working, please tell me how did you configure your samba server

Newbie here.Forgive my poor English.

Last edited by swordfeng (2014-07-26 13:45:20)

Offline

#2 2014-07-25 18:02:54

Soukyuu
Member
Registered: 2014-04-08
Posts: 854

Re: [Solved] Samba usershare refuses anonymous access

Reading the smb.conf documentation here, I get the impression you have to have the samba user you map to the guest acc ("nobody" in your case) in your samba account database. It says it's the default account, but to me it's unclear if the account actually exist. Try adding the user and see if it fixes it?

Last edited by Soukyuu (2014-07-25 18:07:40)


[ Arch x86_64 | linux | Framework 13 | AMD Ryzen™ 5 7640U | 32GB RAM | KDE Plasma Wayland ]

Offline

#3 2014-07-26 02:36:16

Buddlespit
Member
From: Chesapeake, Va.
Registered: 2014-02-07
Posts: 507

Re: [Solved] Samba usershare refuses anonymous access

A previous thread where I posted my samba config
https://bbs.archlinux.org/viewtopic.php … 8#p1438378


An old man, trying to stay sane

Offline

#4 2014-07-26 13:42:07

swordfeng
Member
Registered: 2014-07-24
Posts: 19

Re: [Solved] Samba usershare refuses anonymous access

Soukyuu wrote:

Reading the smb.conf documentation here, I get the impression you have to have the samba user you map to the guest acc ("nobody" in your case) in your samba account database. It says it's the default account, but to me it's unclear if the account actually exist. Try adding the user and see if it fixes it?

Yeah, the document helped a lot.
However, it's not a problem about the samba accounts. I simply changed the "guest account" in smb.conf to my own username and then it works. Then I discovered I can easily make my folder in an NTFS partition shared with anonymous users, regardless of the guest account. Guess it's something about system security and the choose of guest account though I don't know how it actually happens.
So I have just two choices...Set the guest account to my own account, or to nobody and I can only use usershare in the NTFS partition. Not a big problem as modifying smb.conf manually works all right.

Offline

#5 2014-07-26 13:44:59

swordfeng
Member
Registered: 2014-07-24
Posts: 19

Re: [Solved] Samba usershare refuses anonymous access

Buddlespit wrote:

A previous thread where I posted my samba config
https://bbs.archlinux.org/viewtopic.php … 8#p1438378

Thanks for your config file sharing. But actually I'm talking about the "usershare" feature that uses a command "net usershare" or a gui like nemo-share.
The direct share settings in smb.conf works all right.

Offline

#6 2014-07-26 15:14:02

Soukyuu
Member
Registered: 2014-04-08
Posts: 854

Re: [Solved] Samba usershare refuses anonymous access

swordfeng wrote:
Soukyuu wrote:

Reading the smb.conf documentation here, I get the impression you have to have the samba user you map to the guest acc ("nobody" in your case) in your samba account database. It says it's the default account, but to me it's unclear if the account actually exist. Try adding the user and see if it fixes it?

Yeah, the document helped a lot.
However, it's not a problem about the samba accounts. I simply changed the "guest account" in smb.conf to my own username and then it works.

That's what I'm saying. Your user account is obviously in the samba database, but is the user account "nobody" in it as well? You could also create a user "sambaguest", add it to the sambashare group via adduser, and map guest to that.


[ Arch x86_64 | linux | Framework 13 | AMD Ryzen™ 5 7640U | 32GB RAM | KDE Plasma Wayland ]

Offline

Board footer

Powered by FluxBB