LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 09-25-2011, 03:37 PM   #1
Blackhole
LQ Newbie
 
Registered: May 2007
Location: Black Forest or West Sussex
Distribution: Xubuntu @ DELL Latitude D620
Posts: 15

Rep: Reputation: 0
How to configure NFS properly without using no_root_squash?


Hi guys,

I have two home computers with Ubuntu 11.04 on it. My desktop PC (let's call it "server") and my laptop (let's call it "client").

What I'd like to do now is export a directory on the server via NFS and mount it as a network share on the client using "mount" and NFS. So far so good. Now comes the problem.

In order to use "mount" on the client I have to do a lovely "sudo". However, when I do that, I merely get read-only access to the exported directory and each time I want to copy a file to the directory the client tells me "no permission". I do have exported the directory with the "rw"-option, though.

The problem seems to be that whenever you mount a NFS directory as client-user "root" (which I can't avoid when using "sudo"), the server automatically maps that to the server-user "nobody" for security purposes. There seems to be a "no_root_squash"-option for the NFS server to prevent that, but it's not recommended - again due to security issues.

So what's the proper way to export a directory? Should the exported directory be owned by the server-user "root" or by some other user? How does the client get write permission in the exported directory when using sudo? Or is there a way without using sudo?

Here's my server's /etc/exports:
========
/exports/data_pool 192.168.3.0/255.255.255.0(rw,sync)
========

TIA for all your help,
Blackhole
 
Old 09-25-2011, 05:06 PM   #2
eSelix
Senior Member
 
Registered: Oct 2009
Location: Wroclaw, Poland
Distribution: Arch, Kubuntu
Posts: 1,281

Rep: Reputation: 320Reputation: 320Reputation: 320Reputation: 320
Mounting user has nothing to permissions in NFS, important is user who get access to resources. There are few methods to restrict permissions in NFS, depending on needs. For example if you want the same users on server and client, use IDMAP daemon or give them the same uids, and use chmod/chown on the server to set permissions for that user. If you other side want a host IP based permissions, as I have, you can use all_squash and anonuid/anongid arguments in exports list to redirect all access from some IP to specified user and group. Look also on the "sec" argument.
 
  


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
no_root_squash zfs nfs export brianmcgee *BSD 5 05-25-2011 05:33 AM
How to properly configure Xorg 7.4 and higher? 10110111 Linux - Software 3 10-28-2009 05:40 PM
Help - How can I configure my touchpad properly ? Christof999 Linux - Laptop and Netbook 4 05-12-2007 04:02 PM
Need help getting NFS running properly... nbcohen Linux - Networking 2 07-03-2006 08:16 AM
Can't get NFS working properly Scruff Linux - Networking 8 02-08-2004 10:55 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

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