[Samba] Cannot write over root owned file

david rankin drankin at cox-internet.com
Thu May 4 14:36:53 GMT 2006


>From: "Larry Alkoff" <labradley at mindspring.com>
> david rankin wrote:
>> From: "Larry Alkoff" <labradley at mindspring.com>
>>> david rankin wrote:
>>>> From: "Larry Alkoff" <labradley at mindspring.com>
>>>>>
>
> If you have security = share it looks to me like everyone would see the 
> samba icon but could not access it since they didn't have the password 
> (and maybe 'valid user = david' would prevent access also).
>
> Or did you mean 'access the samba share' by "see"?
>

I have security=share, and Yes I meant 'see' the share. browseable=no takes 
care of that.

>
>> [samba]
>>        comment = Base Samba Share
>>        path = /home/samba
>>        valid users = david
>>        force user = david
>>        force group = ochiltree
>>        admin users = david
>>        browseable = no
>>        writeable = Yes
>>        inherit permissions = yes
>>
>>
>>> 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.
>>>
>>
>> Well for me, its fire up PuTTy; 
>> www.chiark.greenend.org.uk/~sgtatham/putty/
>> ssh server, log in as me,
>> su
>> and you are in.
>
> I haven't done much PuTTy yet.  At this point I'm trying to access all 
> shares from the Linux boxes.  I'm on a compaign to eliminate all Windows 
> computers from my house except one or two, including changing out my 
> wife's to a Mac.  Most of my computing time is spent at one Linux box and 
> I only access the Windows boxen by cli to transfer a few files and to 
> backup.
>

Ok, I think I understand now. You were smbmounting the windows boxes on your 
linux box and then from your linux box using the cli to do what you needed 
to do on the windows shares, right? I'm no expert on this, but I think you 
have found also found the answer, "So if I run the script as $USER=root I'm 
root". From man smbmount:

 username=<arg>
              specifies the username to connect as. If this is not given, 
then
              the  environment  variable   USER  is used. This option can 
also
              take the form "user%password" or "user/workgroup" or 
"user/work-
              group%password" to allow the password and workgroup to be 
speci-
              fied as part of the username.

So what you want is: smbmount //tillie/all  /mnt/tillie -o username=root; 
which I presume you would have to be root to do. Using su to execute some 
commands has always been problematic where the command being issues relies 
on evironment variables. cron is a good example. I think the user 
environment as seen by smbmount was what was biting you in this case. Others 
with far more knowledge than I may want to weigh in or add more detail if 
required.



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



More information about the samba mailing list