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 - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-15-2009, 01:56 PM   #1
deibertine
Member
 
Registered: Mar 2009
Posts: 222

Rep: Reputation: 30
Talking NFS Share Separate Permissions


Hi there,

I was wondering if there's a way to create an nfs share with separate permissions per user?

userro: read only priv.
userrw: read/write priv.

This way when user "userro" mounts that share, he/she can only read but when user userrw will be able to read/write to it.

I have included this in the /etc/exports:
/sharednfs *(rw,no_root_squash,sync)

Can someone please advise?

Thanks!
DB
 
Old 06-15-2009, 02:04 PM   #2
jamescondron
Member
 
Registered: Jul 2007
Location: Scunthorpe, UK
Distribution: Ubuntu 8.10; Gentoo; Debian Lenny
Posts: 961

Rep: Reputation: 70
Change the ownership of the directory its self, off the top of my head. What does the NFS documentation tell you?
 
Old 06-15-2009, 04:44 PM   #3
deibertine
Member
 
Registered: Mar 2009
Posts: 222

Original Poster
Rep: Reputation: 30
NFS Share

Quote:
Originally Posted by jamescondron View Post
Change the ownership of the directory its self, off the top of my head. What does the NFS documentation tell you?
Hi James!

I appreciate your response. At any the only option I can think of is to really create each separate users that will be designed for a RW and a RO option then will depend on who you provide these user creden to then set permissions.

Please kindly advise.

Thanks!
DB
 
Old 06-15-2009, 05:01 PM   #4
jamescondron
Member
 
Registered: Jul 2007
Location: Scunthorpe, UK
Distribution: Ubuntu 8.10; Gentoo; Debian Lenny
Posts: 961

Rep: Reputation: 70
How about a 'nfs-rw' group so you don't have to mess about with lots of rules?

Is there nothing in the docs about this then?
 
Old 06-15-2009, 05:36 PM   #5
deibertine
Member
 
Registered: Mar 2009
Posts: 222

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by jamescondron View Post
How about a 'nfs-rw' group so you don't have to mess about with lots of rules?

Is there nothing in the docs about this then?
I'm not sure which docs you were referring to, i did manual entry on this and didnt really find it.

I am trying to learn how to configure NFS with user permissions and I could not find useful sites and docs.

Please advise.

Thanks.
 
Old 06-15-2009, 05:38 PM   #6
jamescondron
Member
 
Registered: Jul 2007
Location: Scunthorpe, UK
Distribution: Ubuntu 8.10; Gentoo; Debian Lenny
Posts: 961

Rep: Reputation: 70
http://www.google.co.uk/search?clien...utf-8&oe=utf-8

There are plenty of pieces of documentation around, even a few threads on this forum
 
Old 06-15-2009, 06:32 PM   #7
deibertine
Member
 
Registered: Mar 2009
Posts: 222

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by jamescondron View Post
http://www.google.co.uk/search?clien...utf-8&oe=utf-8

There are plenty of pieces of documentation around, even a few threads on this forum
Ok found some. One of the suggestions was to input the following to /etc/exports:
/sharednfs *(ro,no_subtree_check)
/sharednfs dev34.csaa.com(rw,no_root_squash,sync)

However when I do mount it in ro machine, im only getting some of the files within the nfs share:

total 4
0 drwxr-xr-x 2 root root 0 2009-06-15 16:20 .
4 drwxr-xr-x 6 root root 4096 2009-06-15 16:20 ..
0 --w------- 1 root root 0 2009-06-15 16:20 .add
0 --w------- 1 root root 0 2009-06-15 16:20 .del
0 --w------- 1 root root 0 2009-06-15 16:20 .export
0 -r--r--r-- 1 root root 0 2009-06-15 16:20 exports
0 -rw------- 1 root root 0 2009-06-15 16:20 filehandle
0 -rw------- 1 root root 0 2009-06-15 16:20 .getfd
0 -rw------- 1 root root 0 2009-06-15 16:20 .getfs
0 -rw-r--r-- 1 root root 0 2009-06-15 16:20 max
0 -rw------- 1 root root 0 2009-06-15 16:20 nfsv4
0 -rw------- 1 root root 0 2009-06-15 16:20 nfsv4
0 -rw------- 1 root root 0 2009-06-15 16:20 pool
0 -rw-r--r-- 1 root root 0 2009-06-15 16:20 portlist
0 --w------- 1 root root 0 2009-06-15 16:20 .svc
0 -rw------- 1 root root 0 2009-06-15 16:20 mainthreads
0 --w------- 1 root root 0 2009-06-15 16:20 .export
0 -rw------- 1 root root 0 2009-06-15 16:20 subversions


For rw machine, I'm seeing all directories I wanted in full:

4 drwxrwxr-x 8 root root 4096 Jun 11 15:49 .
8 drwxr-xr-x 7 root root 4096 Jun 15 15:59 ..
4 drwxrwxr-x 2 root root 4096 Jun 11 15:43 Vendors
4 drwxrwxr-x 2 root root 4096 Jun 11 15:44 Disclosure
4 drwxrwxr-x 3 root root 4096 Jun 11 15:44 Destination
4 drwxrwxr-x 9 root root 4096 Jun 11 15:48 Distros
4 drwxrwxr-x 2 root root 4096 Jun 11 15:49 Dropoff
4 drwxrwxr-x 30 root root 4096 Jun 11 16:28 XEntOS


Basically I want both of them to see all directories but ro will only have read only rights to the nfs mount.

Any suggestions?

Thanks!
 
Old 06-17-2009, 12:06 PM   #8
deibertine
Member
 
Registered: Mar 2009
Posts: 222

Original Poster
Rep: Reputation: 30
Ok I did change the permissions to nobody (own/grp) and chmod to 777 on the nfs share.
Also added few strokes in /etc/exports: /sharednfs *(rw,all_squash,sync,anonuid=501,anongid=501)
However doing so will grant ALL users mounting this drive r/w access to the share, is this true?

If so, how can I have one user have all RW rights and others only READ access?

Need expert advise please.

I'd appreciate it.

Thanks!
DB
 
Old 06-17-2009, 06:30 PM   #9
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
Try reversing that logic. Make the wildcard ro, then put in a specific entry for one user, rw.
 
Old 06-17-2009, 11:31 PM   #10
deibertine
Member
 
Registered: Mar 2009
Posts: 222

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by chrism01 View Post
Try reversing that logic. Make the wildcard ro, then put in a specific entry for one user, rw.
Cool, that worked!

Thanks Chrism01!
 
  


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
Mounting NFS share on client changes permissions to read-only GATTACA Linux - Server 1 12-03-2008 01:19 PM
NFS share not mounting with read/write permissions syphoncode.32 Linux - Software 1 06-15-2007 02:46 AM
permissions problem in nfs share Falafel Linux - Networking 1 03-14-2007 02:15 PM
Permissions on NFS Share IwantLINUX Linux - Newbie 2 03-09-2007 05:03 AM
NFS share permissions problem imjustabill Linux - Server 1 03-04-2007 01:01 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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