Welcome to Linux Forums! With a comprehensive Linux Forum, information on various types of Linux software and many Linux Reviews articles, we have all the knowledge you need a click away, or accessible via our knowledgeable members.
Find the answer to your Linux question:
New to Linux Forums? Register here for free!
    Linux Forums > GNU Linux Zone > Servers > Samba / CIFS mount point won't allow read/write for non-root user

Forgot Password?
 Servers   Anything server related, Apache, MySQL, Samba, server security, sendmail, exim, etc

Site Navigation
Linux Articles
Linux Forums
Linux Downloads
Linux Hosting
Free Magazines
Job Board
IRC Chat
RSS Feeds


Linux Forum Topics
Linux Forums
Your Distro
Linux Resources
GNU Linux Zone
The Community
Reply
 
Thread Tools Display Modes
Old 09-02-2007   #1 (permalink)
Just Joined!
 
Join Date: Jul 2007
Posts: 18
Samba / CIFS mount point won't allow read/write for non-root user

I've got a Windows Server 2003 R2 machine with a share. A user, let's call it "mang", is added in Windows' Computer Management, and the user is given Full Access to the share.

In Linux (using Red Hat Enterprise Server 5), in /etc/fstab I have the following:

//mangwin1/mang /mnt/mangwin1 cifs username=mang,password=mypass

Note that smbfs is not available in RHES5, only cifs -- that is, that's what I understood after an hour or two of research getting this thing initially set up and running, but I'm open for correction of course.

As root, I am able to navigate to /mnt/mangwin1 and it sees my share fine. I can add files, create directories, the whole nine yards. If I "su mang", though, at first it seems like I can do anything but then suddenly after the first write (or it seems that's when it happens, can't put my finger on the timing) suddenly everything becomes owned by root and read-only to me as 'mang'. If I had created a file called "foo", I cannot "touch foo" (Permission Denied). If I reboot, I can touch it, modify it, but if I create a foo2, the whole thing locks up again.

As root I tried running "chown mang /mnt/mangwin1 -R" which worked at first up until the "mang" user wrote to the file.

I also tried (in fstab):

//mangwin1/mang /mnt/mangwin1 cifs username=mang,password=mypass,file_mode=0777,dir_m ode=0777 0 0

No change.

I suspected perhaps it was SELinux. Setting that to "Disabled" as default and rebooting resulted in no change.

Help!! I'm still quite new to Linux and don't know what to guess anymore!

Thanks,
Jon
stimpy77 is offline  


Reply With Quote
Old 09-03-2007   #2 (permalink)
Just Joined!
 
Join Date: Jul 2007
Posts: 18
Getting this up and running is pretty critical to us right now. I realize that this is Labor Day weekend, but if anyone can at least point me to another forum or even a reliable paid consulting service (perhaps we should call up Red Hat since we bought their RHES 5 license) so that this can be resolved early this week it would be nice.

Windows Server 2003 R2 does have NFS support. Is it feature-complete enough to meet our needs (given the scenario of publishing a couple gigs of small files each night from Linux to Windows) such that you guys recommend using it??
stimpy77 is offline   Reply With Quote
Old 09-04-2007   #3 (permalink)
Just Joined!
 
Join Date: Jul 2007
Posts: 18
We *think* we may have finally figured this one out. When declaring the parameters of the mount (i.e. in /etc/fstab), in addition to the username and password you also need to set the uid=xxx or the gid=xxx, where uid is a User ID and gid is a Group ID.

In our case, we added uid=505:

mount -t cifs -o user=mang,pass=12345,uid=505 //mangwin1/mang /mnt/mangwin1

However, file_mode and dir_mode seem to have not functioned as they should have, so we took them out. Might also be picky about using "user" and "pass" rather than "username" and "password".
stimpy77 is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Free Magazines
Run Your Own Web Server Using Linux & Apache - Free 191 Page Preview
Learn about everything you'll need to build and maintain your Linux servers, and to deploy Web applications to them.
subscribe
Open Source Security Myths Dispelled
Dispel the five major myths surrounding Open Source Security and gain the tools necessary to make a truly informed decision for your IT organization
subscribe
InformationWeek
InformationWeek is the only newsweekly you'll need to stay on top of the latest developments in information technology.
subscribe



All times are GMT. The time now is 09:24 AM.






© 2000 - 2009 - All Rights Reserved - Property of  MAS Media

Content Relevant URLs by vBSEO 3.3.0 RC2