1

I'm trying to set up an NFS server to browse files from a remote Ubuntu server on a Mac client.

I'm having trouble finding out what to put as my client hostname/address in the /etc/exports entry. I assume it is supposed to be the client's IP address, but I seem to be running into permissions issue. The only thing that seems to work is using the wildcard * as the hostname/address.

On the Mac client, I execute the following:

$ ifconfig | grep "inet " | grep -v 127.0.0.1
inet 192.168.1.112 netmask 0xffffff00 broadcast 192.168.1.255

I use that IP address in Ubuntu server's /etc/exports file like this:

/home/user 192.168.1.112(insecure,rw,all_squash,anonuid=1000,anongid=1000,no_subtree_check)

The Mac /etc/auto_master looks like this:

/net            -hosts      -nobrowse,nosuid,locallocks,nfc,actimeo=1

After running sudo exportfs -vra on the server and sudo automount -vc on my Mac client, I still get "Permission denied" when I try run:

$ ls /net/<REMOTE IP>/home/user
ls: /net/<REMOTE IP>/home/user: Permission denied

However, when I change the server's /etc/exports to just a wildcard, I can run the ls command successfully:

/home/user *(insecure,rw,all_squash,anonuid=1000,anongid=1000,no_subtree_check)

However, I know that this is not optimal from a security standpoint.

I've tried a few different variations of my Mac's IP address, but I can't seem to get around the permissions issue unless I use the wildcard to specify, which leads me to believe that my other settings are fine except for the address.

How can I find the correct address to put in this /etc/exports entry?

0

After the client has mounted the filesystem, run showmount on the server. That will show you the server's understanding of the address of the client. (If the server shows a name but you want the address then use the host command or something similar on the server to get the address from the name.) Then you can narrow your filesystem export to just that address.

It's possible that the address seen by the server could change from time to time. If that happens then you'll have to repeat this exercise.

If the server is on the Internet then you can probably find the external address that your client has been assigned by using an incognito/private page in your web browser to visit a site like https://www.ipaddress.com/ or https://whatismyipaddress.com/ or https://showip.net/ . That will be safer and easier than continually opening your NFS export to the world, mounting the filesystem and then running showmount.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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