Where NFS_SERVER is the NFS server’s address, and MOUNT_POINT is the local mount point on the client side for the NFS directory. You may also consider using autofs on top of NFS as described in Unified Linux Login and Home Directory Using OpenLDAP and NFS/automount. NFS (Network File System) is basically developed for sharing of files and folders between Linux/Unix systems by Sun Microsystems in 1980.It allows you to mount your local file systems over a network and remote hosts to interact with them as they are mounted locally on the same system.

Active9 years ago

I'm trying to connect to an NFS drive shared from my Debian Squeeze box from my OSX 10.6 laptop, and try as I might I can't get it to let me write to the disk from the mac. I have the following in /etc/exports:

making all requests come from UID/GID 1000/1000, my user, who owns the whole drive. However, when I mount the drive on the Mac, everything is owned by 1000/1000 as well, so I can never write to the disk:

I've seen a few other people having this problem, but the only solution I've seen is to chmod the whole disk 777, which I'd rather avoid. Unfortunately I can't use nfs-user-server on my system so I can't use UID/GID mapping.

Colin Fleming

2 Answers

Rather than assign all files to uid 1000, assign all files to your uid on the Mac (run id -u in a terminal to see your uid). While you're at it, do the same for the gid (id -g).

GillesShareGilles
8,4361 gold badge27 silver badges44 bronze badges

One solution: Create a group with the same group id on both platforms and make the user on both platforms a member of it, and then change the anongid parameter to this group id.

SvenSven
89.6k10 gold badges156 silver badges205 bronze badges
Setup Linux Nfs Share For Mac Client
Active9 years, 1 month ago

I have a local Ubuntu development web server and a Mac client which I use to access and edit the files on.

I'm attempting to setup NFS on my Ubuntu server so that I can access the virtual server directories from my OS X client.

I'm having issue with getting the permissions right so that my Mac user can write to a virtual servers' public_html directories.

I've done a bit of reading and it seems you have to match the GUI and UID of the files on the server with that of the logged in user on the Mac to be able to read / write. This kind of make sense and it means that the Unix server thinks I'm the same user as the original owner.

For this to work I think need every virtual server to have the same owner and/or same group otherwise I guess I would have to setup a new user on my Mac client every time I wanted to edit a new site.

What I was think was that I could assign all virtual servers to the same owner and group. Then all I have to do is make sure that user's UID and GID matches that of my Mac user.

To be honest I've never really understood unix permissions so it might be getting this completely wrong. But I really need to be able to read/write to ALL the virtual servers via NFS on my Mac client.

Any help would be greatly appreciated.

CamsoftCamsoft
3713 gold badges8 silver badges20 bronze badges

1 Answer

You can use the options all_squash, anonuid and anongid in the exports entry. all_squash will redirect all requests on that exported dir to the anonymous user, and the two other options map who are those users on the local machine. Example (from the exports man page):

Solaris Nfs Share

/home/joe pc001(rw,all_squash,anonuid=150,anongid=100)

All requests on /home/joe will be executed as uid 150 and gid 100. So on each server export the home (or just the public_html) dir using the uid and gid of your local user in the server and the requests coming from your mac client will end on the right permissions.

Linux Nfs Share

coredumpcoredump

Setup Nfs On Linux

11.4k2 gold badges27 silver badges49 bronze badges

Cifs Share

Not the answer you're looking for? Browse other questions tagged linuxubuntupermissionsnfsfile-permissions or ask your own question.