smbmount read-only woes

smbmount read-only woes

Post by Graham Lidbur » Thu, 12 Jun 2003 19:29:57



Dear Group

I am having exactly the same problem with smbfs shares. I can write to NT
shares when running as root, but can only read them when running as a
non-root user.

I have the following line in my fstab file;

//server/share   /mnt/nt_files  smbfs  noauto,uid=500,gid=504 0 0

Where uid =  a test user account ID & GID is the ID of a group I have setup
to allow a number of users to mount the share.

When the user mounts the share they type;

sudo mount -o username=nt-domain-acc-name,workgroup=domain /mnt/nt_files

followed by their NT Password

This actually works OK when I log-in as the test user, however, this only
works for the user whose uid is specified in fstab, the Group gid does not
appear to have any effect. I have to change the 'uid' in fstab to the ID of
the user that need to mount this share.

Is this something to do with ACL's etc?

Your help would be much appreciated.


> I gave it a shot but still no luck.   I can still mount, read, and write
as
> root, but as soon as I switch to a user account (same username/password as
> my windows box), the ability to write goes away.

> Using umask in the mounted directory, I get 002 as user and 022 as root.




> > > I'm trying to connect my Linux box to my Windows box, and am almost
> > > there, but have hit a snag -- I can mount a share via smb on my Linux
> > > box, and as root can read and write files just fine. But when I switch
> > > to my user account, I can read files on the mount point fine, but
can't
> > > write to it.

> > You can add options to change user and group of the mounted disk.

> > mount -t smbfs -o username=WINDOWS_USER,uid=LOCAL_USER,gid=LOCAL_GROUP
> >   //WINDOWS_COMPUTER//SHARE /MOUNTPOINT

> > You have to mount as root.
> > Perhaps you can also use the umask option, I didn't try it.
> > See man mount for details.

> > Hope this helps

> > Simon

 
 
 

smbmount read-only woes

Post by Graham Lidbur » Fri, 13 Jun 2003 18:42:02


Simon

The secret appears to be to set Masks.

This appears to work,

In fstab, add the following....

//Servername/Sharename /mnt/folder smbfs noauto,gid=xxx,dmask=774,fmask=774
0 0

Where, '/mnt/folder' is a folder that has already been created,

xxx = the ID of a group, I have used 100 (the users group) (any users you
want to be able to use the share must be in this group).

ie

//Myserver/A_share$ /mnt/nt_files smbfs noauto,gid=100,dmask=774,fmask=774 0
0

To mount the share, set-up SUDO to allow users to run the mount & umount
commands.

Then they can type

sudo mount -o username=Domain\\domain_name /mnt/folder

To unmount

sudo umount /mnt/folder

I dare say that there are all sorts of reasons why doing this is Bad, and
that there are better ways to implement this, but I am a Newbi to Linux
myself and so far, this is the only way I have got it to work.
If anyone knows what I should be doing to achieve the above, please feel
free to let me know.

Regards

Graham Lidbury



> > I'm trying to connect my Linux box to my Windows box, and am almost
> > there, but have hit a snag -- I can mount a share via smb on my Linux
> > box, and as root can read and write files just fine. But when I switch
> > to my user account, I can read files on the mount point fine, but can't
> > write to it.

> You can add options to change user and group of the mounted disk.

> mount -t smbfs -o username=WINDOWS_USER,uid=LOCAL_USER,gid=LOCAL_GROUP
>   //WINDOWS_COMPUTER//SHARE /MOUNTPOINT

> You have to mount as root.
> Perhaps you can also use the umask option, I didn't try it.
> See man mount for details.

> Hope this helps

> Simon


 
 
 

1. smbmount read-only woes

Hi,

I'm trying to connect my Linux box to my Windows box, and am almost
there, but have hit a snag -- I can mount a share via smb on my Linux
box, and as root can read and write files just fine. But when I switch
to my user account, I can read files on the mount point fine, but can't
write to it.

I tried to mount as a user, but was unable to (restricted), so I did a
chmod a+s on smbmnt and smbumount. That allowed me to mount and read the
share with my user account, but I am still unable to write without
switching to su.

I'm running Samba 2.2.1a on Redhat 7.2 and connecting to a WinXP Pro box.

Any help would be greatly appreciated.

thanks!
-Brian

2. Money 2005 US file loadable witn Money 2005 UK version?

3. Any way for smbmount to ignore Read-Only attribs?

4. Q: Re: MbeDgnInfo.GetGlobalOrigin

5. Outlook/Exchange woes from Antivirus woes: install & uninstall hoses receipts

6. Can a Mobile Telephone From the U.S. be Used Anywhere Else?

7. Read-only with no password, read/write with one

8. open a file read-only, but tell the client that its read-write?

9. smbmount won't mount READ ONLY!

10. read-only file

11. Read-Only Files on SBS2000 Share?

12. Users keep getting Word files with Read-Only attribute