LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 12-30-2011, 03:58 AM   #1
ask
LQ Newbie
 
Registered: Oct 2005
Location: Amsterdam, The Netherlands
Distribution: Ubuntu 11.10 amd64, Puppy, FreeNAS 8.0.2
Posts: 13

Rep: Reputation: 0
How to automount a Samba network share read-write for multiple users on boot?


Hi everyone,

This question/problem must have come up several times without doubt, but nevertheless I'm still struggling with it (and it's beginning to spin!).

I have a Samba network share (just a regular, all-default share) which I would like to automount at boot, so all users can have read-write access to it.

My steps so far:
[1] On the server, I created a group called "machines", and added a new user "client-machine" to it.
[2] On the client, I created a group called "remote", and added a new system user "client-machine". In addition, I added the "remote" group as secondary group to an existing user ("user1").
[3] I added the following line to /etc/fstab:
# network shares on samba server
//192.168.x.y/Music /media/Music cifs defaults,acl,credentials=/root/.smbcredentials,iocharset=utf8,gid=remote,uid=client-machine,file_mask=0777,dir_mask=0777 0 0


Where /root/.smbcredentials contains the Samba user name ("client-machine") and password.

Believe it or not, but on reboot (or issuing "sudo mount -a") this actually works :-) On opening Nautilus (Ubuntu's file manager), the network share shows up. However, documents (both new or copied) end up with permissions -rw-r--r--, so there's no way I can edit any document after it has been created or copied.

I then started searching the web... :-( The suggestions I found implied using (a) ACL, (b) umask, (c) scripts to mount the shares on login instead of on boot. I've tried (a) and (b) until I found this helpful post on ACLs, umask and shared directories. As considered (c), I found myriad suggestions, of which I couldn't decide which one was best.

Has anyone encountered the same issue? How did you cope with it? Any suggestions are more than welcome!

Thanks already,
Memel
 
Old 12-30-2011, 04:32 AM   #2
Doc CPU
Senior Member
 
Registered: Jun 2011
Location: Stuttgart, Germany
Distribution: Mint, Debian, Gentoo, Win 2k/XP
Posts: 1,099

Rep: Reputation: 344Reputation: 344Reputation: 344Reputation: 344
Hi there,

Quote:
Originally Posted by ask View Post
This question/problem must have come up several times without doubt
probably has, but I haven't stumbled across any post about it - but across the problem itself.

Quote:
Originally Posted by ask View Post
Believe it or not, but on reboot (or issuing "sudo mount -a") this actually works :-) On opening Nautilus (Ubuntu's file manager), the network share shows up. However, documents (both new or copied) end up with permissions -rw-r--r--, so there's no way I can edit any document after it has been created or copied.
Yes, that rings a bell. I had the same effect about a year ago. Strange enough, from a Windows client I had full access!
I also spent a lot of time searching, and came up with nothing. Then I happened to get a book on Samba (O'Reilly press, the title is just "Samba") and got aware of the directive "unix extensions". Just for a try, I added
Code:
unix extensions = no
to the global section of my smb.conf file - and hey, that worked. No ACL stuff, however.

My suspicion is that the two Linux machines detect behind Samba's back that they're of the same species, and negotiate access rights differently, bypassing the Samba configuration. Maybe that works for you too.

How's the weather in beautiful Amsterdam? - I visited the city a few times during motor yacht cruises through the Netherlands (moored in Oosterdok for the nights, close to the drawbridge of Prins-Hendrikskade), and I like it very much. Many of the small towns around as well, like Alsmeer and the Westeinder Plassen, Bodegraven or Gouda. Get back there every two or three years ...

[X] Doc CPU
 
Old 01-02-2012, 03:33 AM   #3
ask
LQ Newbie
 
Registered: Oct 2005
Location: Amsterdam, The Netherlands
Distribution: Ubuntu 11.10 amd64, Puppy, FreeNAS 8.0.2
Posts: 13

Original Poster
Rep: Reputation: 0
[solved] How to automount a Samba network share read-write for multiple users on boot?

It works! I'm so happy!
Now all my directories & files are created with the dir_mask and file_mask specified.

btw. weather is ok. No snow this year, just an afwul lot of rain. Last December has been one of the hottest in hundred years..
 
  


Reply

Tags
acl, fstab, samba, share, umask


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Samba share read only for guests and write for some specific users ^andrea^ Linux - Server 6 06-21-2011 05:42 PM
Why can I not write to a SAMBA share when read/write is enabled? eric m Linux - General 4 08-21-2006 09:22 PM
samba, some users read, others write? softmoo Linux - Networking 1 07-06-2005 11:13 AM
share read and write permission to users suguname Mandriva 3 01-18-2005 12:53 AM
A share that users can see, read and write to....without password fatboyal Linux - Newbie 11 01-16-2004 08:56 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 04:54 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration