[Samba] Cannot write over root owned file

Larry Alkoff labradley at mindspring.com
Wed May 3 19:11:48 GMT 2006

david rankin wrote:
> From: "Larry Alkoff" <labradley at mindspring.com>
>> However, when I tried to copy over a root owned file, first as su and 
>> then as su -, the operation failed.  Why can't I copy over a root 
>> owned file when I'm root?
>> I also noticed that, when I touched as su or su -, I could create the 
>> file but in each case owner was lba:users.  However, when I did the 
>> same touch within my own file system, the file owner became root.
>> I smbmounted the share with a simple _root_ script containing:
>> smbmount  //tillie/all  /mnt/tillie  -o uid=0
>> Shouldn't that have given me root priviledges?
>> Which leads to the question,  how do I act as root on a samba share?
>> Or perhaps the question is how do I become root on the share?
>> Is sharing as root okay or is it bad practice?  Why?
> Larry, in your smb.conf, try this:
>        valid users = you
>        force user = root
>        force group = root
>        admin users = you
> I believe if you just set admin users = whoever, that will force the 
> user and group to root by default. It has been a while since I played 
> with this, but I still use it and it works...

I'm a little hesitant to access a share with full root access all the 
time.  Do you consider this safe?

What I've worked out is to mount tillie in my smbmt script with the line:
smbmount //tillie/all  /mnt/tillie
which picks up the $USER.
So if I run the script as $USER=root I'm root, otherwise a user even 
though my $UID=0 when I su to run the script and smbmount.

I wish there was some way to "su" into a share but haven't seen it yet.

> Aside: Next time you are at the Salt Lick in Driftwood, don't forget to 
> order the blueberry cobbler and vanilla ice cream desert. Yes, after the 
> family style all you can eat, it will hurt, but it is worth it...

Ahh, Salt Lick.  I live close by, off Camp Ben Macoulough Rd about two 
miles from Hwy 290 West so I've been there more times than is good for 
me <g>

Come to town some town and I'll treat you.  I'm in the book.

> -- 
> David C. Rankin, J.D., P.E.
> 510 Ochiltree Street
> Nacogdoches, Texas 75961
> (936) 715-9333
> (936) 715-9339 fax
> www.rankinlawfirm.com

Larry Alkoff N2LA - Austin TX
Using Thunderbird on Slackware Linux

More information about the samba mailing list