1833476 Members
2607 Online
110052 Solutions
New Discussion

Re: NFS access

 
Abhijeet_3
Frequent Advisor

NFS access

I need help to restrict nfs mount access to specific users only.

Suppose, I have two hp-ux server ( SRV1 and SRV2 ).

On SRV1 server , I have exported folder /share as rw , and given access to SRV2.
/share -rw,access=SRV2

From SRV2 server I have mounted this /share folder on /mynfs.
mount -F nfs SRV1:/share /mynfs

Suppose I have a user1, user2,..usern on SRV2 server .Now I need to give access /mynfs to user1 and user2 only.

How shall do this configuration.
4 REPLIES 4
Sridhar Bhaskarla
Honored Contributor

Re: NFS access

Hi,

'exportfs' doesn't have any option to specify individual users (except root). So, if there are directories belonging to usern in that filesystem, then they will be accessable to usern on the NFS client (SRV2) if usern exists on it. Either you have to export only those directories that belong to user1 and user2 or manage the permissions on /share on such that others will not have access to it.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Ashwani Kashyap
Honored Contributor

Re: NFS access

As of yet user management on an nfs share , excpet for root is not possible .
The only way to do is to manage your permissions rule or access rules accordingly on the NFS server prior to exporting it .
KapilRaj
Honored Contributor

Re: NFS access

The best way is to have passwd file copied across to the second machine. So that the user id's match

Kaps
Nothing is impossible
Jan Sladky
Trusted Contributor

Re: NFS access

I agree with Kapil, best way is same /etc/passwd.

The worse way is use CIFS/SAMBA package instead of nfs, becasuse it is a little bit difficult and time consumig to install and configure this package and also reliability and performance is less then NFS V3 (I guess it is like NFS V2 ;-).
On SVR1 you have to install samba server and on SVR2 the client and after some configuration steps (smb.conf) on sever side, you will be able to restrict privileges on mounted disk for example on certain group only, simply you can add following into your fstab:
//svr1/share /mynfs smbfs fmask=777,dmask=777,gid=1001,username=xxx,password=yyy,workgroup=zzz 0 0

br Jan
GSM, Intelligent Networks, UNIX