Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have been searching and experimenting for two days trying to figure out the smb.conf and mount.cifs options that will let me mount a directory on host B, cifs mounted on host A that will permit *any* user on host A to have full access without reqiring each and every user to be in the samba password file. No matter what I try, files are created as read-only. Even using the example given in the vanilla smb.conf-sample:
[tmp]
comment = Temporary file space
path = /tmp
read only = no
public = yes
files created by the remote user are 0640. Not only that, but after creating the file the user can no longer read or update it!!!
ls -l on mounted directory /mnt/tmp to remote directory /tmp:
-rw-r----- 1 nobody nogroup 3547 2013-06-05 15:04 that
Adding:
create mask = 0660
force create mode = 0660
Has no effect. Surely this is a common need. I've googled all over and many forums, including this one, Experts-Exchange, Ubuntu, etc. have threads about this, but they all trail off with no solution determined.
Is there someone at LQ who knows how to do this? Is it even possible with samba?
Stefan - thanks for you post. I tried you suggestion. No joy. I believe I have solved the problem, however ...
As I suspected, the resolution is to use NFS, not CIFS. CIFS works great for Windows mounting samba -- it even gives it the 0660/0771 permissions that I specifiy in the smb.conf file. Unix-to-Unix, however, is another story. After doing more googling I've found that numerous people have the same problem trying to cifs mount a remote unix folder on unix. A I mentioned in my original post, none of these threads I've perused have any resolution. I finally tried NFS and it seems to work just fine. Here's my solution:
On the hosting computer: I have a md RAID filesystem (not important to the solution, just for reader FYI) mounted at /mnt/RAID. This filesystem contains several directories, one of which is 'n'.
In the hosting /etc/exports I added the entry:
/mnt/RAID 192.168.0.0/24(rw,root_squash,all_squash,anonuid=1001,anongid=301)
You can read the exports man page for details on these options, but basically, the 'squash' options cause any connecting user (including root) to re-map to the "anonymous" user's id and group. The anaonuid and anongid options specify what the anonymous user's uid and gid, respectively, will be. These ids correspond to a particular user and group on the remote connecting computers AND, most importantly, they correspond the the user and group of the 'guest' account specified in the local smb.conf. This way, whether a user is connecting from a Windows workstation using samba, or a linux host using nfs, they will all access this mount as the same user/group.
Finally, on the hosting computer, I made /etc/rc.d/rc.nfsd executable and ran:
/etc/rc.d/rc.nfsd start # this is the init script location for Slackware
On the remote, mounting host, I added the following to /etc/fstab, where "ohprsstorage" is the hostname of the hosting computer:
It all seems to be working fine. My user's umask on the remote mounting host is 0007, and files I create there on the nfs mounted directory get created with 0664 (I still want 0660, but no big deal for the moment), and with the userid and groupid specified in the exports file. No 'permission denied' or 0640 permissions making it impossible for me to create or update files. I have group r/w permissions for the 10001.301 user so only linux users with group permission can access the nfs mounted files ... just like a real Unix filesystem!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.