How to configure Samba to share (read/write) any folder with root permissions

rootsamba

I have a CentOS 5 VirtualBox guest on a Win7x64 host. I am attempting to setup a read/write share a directory owned by root with my Windows host using Samba, but I'm having no luck after running around in circles. To simplify matters, I've disabled my Firewall (/etc/init.d/iptables stop). As security and permissions are irrelevant for this purpose, I'd rather not have to set up another unix user/group/password.

Here is the output from testparm

Load smb config files from /etc/samba/smb.conf
rlimit_max: rlimit_max (1024) below minimum Windows limit (16384)
Processing section "[Guest Share]"
Loaded services file OK.
Server role: ROLE_STANDALONE

and the source of /etc/samba/smb.conf:

[global]
        workgroup = WRKGRP
        netbios name = SMBSERVER
        security = SHARE
        load printers = No

[Guest Share]
        comment = Guest access share
        path = /root/src
        read only = No
        guest ok = Yes

Running /etc/init.d/smb restart shows an OK status. However, on my Windows host, I can only see the share folder on the guest \\IPv4, but I cannot go into "Guest Share":
Windows Explore

"The network name cannot be found" error message is a common error, with a likely cause:

The user you are trying to access the share with does not have
sufficient permissions to access the path for the share. Both read (r)
and access (x) should be possible.

Am I trying to use root as a passwordless Samba guest? I'd like to, is it possible? How can I configure Samba to share (read/write) any folder with root permissions?

Best Answer

I am able to do this. For comparison, here is an entry of one of my shares:

[Music] ; user="jlacroix"
force user = jlacroix
path = /home/jlacroix/Music
writable = no
public = yes

Be sure to replace "jlacroix" with the username you use. It should force it to use that user despite what user is actually using the file. So you may need to change "jlacroix" to root. However, I don't advise sharing in this way because you should be careful about what can access root permissive files.

Related Question