You are not logged in.

#1 2017-07-05 10:13:27

dice
Member
From: Germany
Registered: 2014-02-10
Posts: 413

Samba user shares only work as root

I am trying to setup samba usershares. I followed this instructions to configure samba and create the relevant paths and permissions.
I remember doing this some time ago on a different arch install and it worked but things might have changed since then.

The problem is running any of

net usershare [info|list|add|delete] 

results in an error:

% net usershare add test testfolder                                                               :(
Failed to init messaging context

Running this command as root works...but that's not exactly how usershares should work, I guess.

The folder has read-write permission for group sambashare which I am a member of.

% ls -l /var/lib/samba/          
total 1388
-rw------- 1 root root       421888 18. Jan 2015  account_policy.tdb
-rw------- 1 root root          696 18. Jan 2015  group_mapping.tdb
drwxr-xr-x 5 root root         4096 25. Feb 22:23 private
-rw------- 1 root root       528384 12. Jun 21:21 registry.tdb
-rw------- 1 root root       421888  5. Jul 11:35 share_info.tdb
drwxrwx--T 2 root sambashare   4096  5. Jul 12:03 usershare
-rw------- 1 root root        32768 23. Feb 19:00 winbindd_cache.tdb
drwxr-x--- 2 root root         4096 23. Feb 18:49 winbindd_privileged

Is there some kind of permission I forgot to set?


I put at button on it. Yes. I wish to press it, but I'm not sure what will happen if I do.  (Gune | Titan A.E.)

Offline

#2 2017-07-06 12:42:10

seth
Member
Registered: 2012-09-03
Posts: 51,165

Re: Samba user shares only work as root

Since it seems a permission issue: are you in the sambashare group? (enter "id" or "groups")
You need to relogin after adding yourself (or run a new login shell)

Offline

#3 2017-07-08 09:06:07

dice
Member
From: Germany
Registered: 2014-02-10
Posts: 413

Re: Samba user shares only work as root

Yes I am in the sambashare group:

% id
uid=1000(lukas) gid=1000(lukas) groups=1000(lukas),7(lp),10(wheel),11(ftp),95(storage),108(vboxusers),150(wireshark),619(bumblebee),997(docker),1003(sambashare),1004(boinc),1006(androidsdk)

I can't even run the `net` command as user.

% net
Failed to init messaging context

Whereas:

 % sudo net                                                                                        :(
Invalid command: net 
Usage:
net rpc             Run functions using RPC transport
net rap             Run functions using RAP transport
net ads             Run functions using ADS transport
net file            Functions on remote opened files
net share           Functions on shares
net session         Manage sessions
net server          List servers in workgroup
net domain          List domains/workgroups on network
net printq          Modify printer queue
net user            Manage users
net group           Manage groups
net groupmap        Manage group mappings
net sam             Functions on the SAM database
net validate        Validate username and password
net groupmember     Modify group memberships
net admin           Execute remote command on a remote OS/2 server
net service         List/modify running services
net password        Change user password on target server
net changetrustpw   Change the trust password
net changesecretpw  Change the secret password
net setauthuser     Set the winbind auth user
net getauthuser     Get the winbind auth user settings
net time            Show/set time
net lookup          Look up host names/IP addresses
net g_lock          Manipulate the global lock table
net join            Join a domain/AD
net dom             Join/unjoin (remote) machines to/from a domain/AD
net cache           Operate on the cache tdb file
net getlocalsid     Get the SID for the local domain
net setlocalsid     Set the SID for the local domain
net setdomainsid    Set domain SID on member servers
net getdomainsid    Get domain SID on member servers
net maxrid          Display the maximum RID currently used
net idmap           IDmap functions
net status          Display server status
net usershare       Manage user-modifiable shares
net usersidlist     Display list of all users with SID
net conf            Manage Samba registry based configuration
net registry        Manage the Samba registry
net eventlog        Process Win32 *.evt eventlog files
net printing        Process tdb printer files
net serverid        Manage the serverid tdb
net notify          notifyd client code
net help            Print usage information

works as expected.
smbd and nmbd are enabled and started. Static pre-configured shares work without problems.

I am wondering if this might be some kind of intended behavior since a non-root user should not be able to use the net command. However this makes usershares unusable.

I don't even know if this is a particular problem on my system.
Are you, kind reader of this thread, able to do anything using net as non-root?

Last edited by dice (2017-07-08 09:07:33)


I put at button on it. Yes. I wish to press it, but I'm not sure what will happen if I do.  (Gune | Titan A.E.)

Offline

#4 2017-07-09 09:12:54

seth
Member
Registered: 2012-09-03
Posts: 51,165

Offline

Board footer

Powered by FluxBB