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 - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 12-28-2010, 08:14 AM   #1
mahmoodn
Member
 
Registered: May 2010
Posts: 427

Rep: Reputation: 16
write permission for users on NFS folder


I have setup a NFS server and this the content of /etc/exports at the server with IP A.B.C.D1 is:
/home/shared A.B.C.D2(rw,no_root_squash)

Problem is, only the root at A.B.C.D1 and A.B.C.D2 can write to that folder. How can I make that possible for other users?
 
Old 12-28-2010, 10:44 PM   #2
kforbus
Member
 
Registered: Sep 2009
Location: Maryland
Distribution: Slackware
Posts: 68

Rep: Reputation: 29
You could make the permissions on the directory you are exporting world readable/writable.

You could also create a group on both machines and add the users you want to have read/write access. Then set that group as the group owner on the directory with chgrp and apply the appropriate permissions using chmod. Just make sure the GID of the group is the same on both the NFS server and client machines.

If the UID of the user you're trying to write as doesn't have local permissions to the folder, then I don't think they will be able to write to it regardless of the rw option in the NFS exports file.
 
Old 12-29-2010, 01:09 AM   #3
mahmoodn
Member
 
Registered: May 2010
Posts: 427

Original Poster
Rep: Reputation: 16
What commands should I use? Also I have set rw for that folder in /etc/exports. Isn't enough?
 
Old 12-29-2010, 01:18 AM   #4
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Gurgaon, India
Distribution: Cent OS 6/7
Posts: 4,631

Rep: Reputation: Disabled
No making rw in NFS will allow writable bit set in NFS but if the file system permissions are not set to allow write permissions to certain users, it will not allow writing to the folder. On the NFS server from where you have exported the share, use chmod 755 or whatever permissions you want on the folder.
 
Old 12-29-2010, 01:25 AM   #5
mahmoodn
Member
 
Registered: May 2010
Posts: 427

Original Poster
Rep: Reputation: 16
Currently it is set to 755 (server is A.B.C.D1)
Code:
mahmood@A.B.C.D1:home$ ls -l shared
total 4
drwxr-xr-x 2 root root 4096 2010-12-27 17:40 a
So what should I do next?
 
Old 12-29-2010, 01:48 AM   #6
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Gurgaon, India
Distribution: Cent OS 6/7
Posts: 4,631

Rep: Reputation: Disabled
If the only user from client is root, you should have no problems. But there are other users than root, one way is to synchronise the user ids on both, client and server and set the permissions accordingly. Else you could make the folder world writable by changing the permissions to 777. Its your take on it but I would not prefer to make it world writable if I do not know what I am doing. But synchronising users would also take a lot of time if you do not have centralised user management and to make it easy you could make the folder world writable.

Just change the permissions to 777 for the folder.
 
Old 12-29-2010, 02:30 AM   #7
mahmoodn
Member
 
Registered: May 2010
Posts: 427

Original Poster
Rep: Reputation: 16
so if I can do chmod 777, what was the purpose of /etc/exports? Shall I ignore that?
 
Old 12-29-2010, 03:07 AM   #8
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Gurgaon, India
Distribution: Cent OS 6/7
Posts: 4,631

Rep: Reputation: Disabled
No. Both are independent. exports file is used to export the share over the network for clients over NFS. And file system permissions are guided by the host operating system. Both are needed. Unless you used exports file, clients would not see the shares.
 
Old 12-29-2010, 03:17 AM   #9
mahmoodn
Member
 
Registered: May 2010
Posts: 427

Original Poster
Rep: Reputation: 16
Thanks for your help.
 
Old 12-29-2010, 04:32 AM   #10
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Gurgaon, India
Distribution: Cent OS 6/7
Posts: 4,631

Rep: Reputation: Disabled
And if there are any more doubts, you can google first. It should give you more information than what you need. And if you feel issue has been resolved, you should mark the thread solved.
 
  


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
Changing permission on a folder so group users can Read and Write maginotjr Linux - Server 7 03-27-2009 03:22 PM
NFS: folder permission inheritance Swakoo Linux - General 5 06-25-2007 04:29 AM
NFS Write Permission louisb Linux - Enterprise 2 02-20-2006 07:16 AM
want to avoid 777 permission, but want to write on folder suruchiparimu Linux - Newbie 10 02-09-2006 03:25 AM
Permission to write to folder Garoth Linux - Software 1 10-09-2004 11:41 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 07:38 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