LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This 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


Reply
  Search this Thread
Old 11-23-2012, 03:27 PM   #1
mk1234
LQ Newbie
 
Registered: Nov 2012
Posts: 8

Rep: Reputation: Disabled
NFS and file permissions problem


Hi,
I have a problem with NFS regarding file permissions when copying file that has no read / write permissions for group.

First, this is how I set NFS:
- created accounts for users on the server
- each user has in server's /etc/exports line with exported folder and his machine ip as well as following parameters: anonuid and anongid to match his uid/gid, rw and all_squash.
- all users are in one common group, lets call it "fornfs"
- each user has in his .profile on their machines umask set to 002

Example of /etc/exports line:
/mnt/share 192.168.1.10(rw,no_subtree_check,all_squash,anonuid=1001,anongid=1004)

Server is Debian Squeeze, clients are Kubuntu 12.04.1. Exported folder is SEC_TYPE="ext2" TYPE="ext3" (ACL doesn't work with < ext4?).

Now, if user A makes a file, it gets correct permissions (by correct I mean also rw for group) thanks to umask. He puts that file on NFS and other users from "fornfs" group can open it and edit too.

BUT, if user A gets some file via Skype for example, and that file lands on user's machine with permission 600, and user A then puts that file on NFS, other users cant use that file at all because of the permission.

What I am looking for is, if there is some kind of umask or similar that will force default permission on file being copied to NFS. Which means, user puts that file on NFS, NFS sees that file permission has no read and write for group, and corrects it. Like umask sets for new created file.

I should mention also that you should assume that users are people that do not know / care to change permission, they just expect to put file on NFS and that should work automatically. So advicing users to chmod files before putting on mounted NFS is no go (nor I d like that system depends on users behavior).

Some might suggest cron, with which I am fine with as the last solution when nothing else works. But I d prefer a more elegant solution / suggestion, like umask was a good and elegant "fix" for just created files / folders.

If you need any more details, please ask.

Thank you in advance.
 
Old 11-24-2012, 12:13 PM   #2
linosaurusroot
Member
 
Registered: Oct 2012
Distribution: OpenSuSE,RHEL,Fedora,OpenBSD
Posts: 982
Blog Entries: 2

Rep: Reputation: 244Reputation: 244Reputation: 244
Are you interested in changing the code of the NFS daemon at the point it creates a file?
 
Old 11-24-2012, 12:24 PM   #3
shivaa
Senior Member
 
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,800
Blog Entries: 4

Rep: Reputation: 286Reputation: 286Reputation: 286
You can set SGID on user's home directory i.e. on /home/A, so any new file created or moved/copied inside it (for example from Skype), will get the same group assigned to it as what user's home directory has. Then if user A will share that file, user's group member will also have permissions to modify/edit that file. To do this:
Code:
chmod g+xs /home/A
So make a try and check.

Last edited by shivaa; 11-24-2012 at 12:27 PM.
 
Old 01-09-2013, 01:42 PM   #4
mk1234
LQ Newbie
 
Registered: Nov 2012
Posts: 8

Original Poster
Rep: Reputation: Disabled
Thanks but I didnt like to add a sticky bit.
In the end, I decided to switch everyone to use Samba instead NFS. It works there as expected.
 
Old 01-10-2013, 02:13 AM   #5
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,362

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
Actually, sgid != sticky bit ('t'); that's a different concept.
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
File Ownership/Permissions Issues on NFS fileshare snowweb Linux - Server 9 08-15-2011 02:16 AM
File permissions being stripped on new files via NFS science_gone_bad Linux - Server 3 02-03-2010 05:56 PM
Setting file/dir permissions on NFS mount different from rest of network? leepic Linux - Server 1 01-25-2010 01:18 PM
NFS Sever Shared Directory - File Permissions Problem LakeWind Linux - Server 1 06-12-2007 02:51 AM
NFS file permissions pembo13 Linux - Networking 7 08-18-2004 02:40 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:17 PM.

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