Overview
Although SMB is the prefered protocol for connecting Macs to shares, in multi-operating system environments, there are times when you need to connect to an NFS share instead. This tutorial covers guiding you through it on network that does not have central user identity infrastructure, like NIS or LDAP.
Prepare the NFS Share on the Server
We need to create an account for you on the NFS server and then map your OS X user and group ids to it’s. Without this, and unless you have NIS or some other central user database, you will not be able to access the share.
- Log onto the NFS server.
- Create your user account. We’re going set the User and Group IDs to 5000.
useradd -u 5000 macusers
- Set a password for our NFS user account. Make sure it’s complex.
passwd macuser
- Open the exports file into a text editor, like VI or Nano.
nano /etc/exports
- Add the following line, replacing the highlighted values to match your environment.
/srv/exports/dept 192.168.1.0/255.255.255.0(rw,all_squash,insecure,anonuid=6000,anongid=6000)
- Save your changes and exit the text editor.
- Make sure your export has the appropriate permissions. In our example, we need to make macuser the owner and group for it.
chown -R macuser:macuser /srv/exports/dept
Enable NFS on OS X
Before we can connect to our NFS server we need to enable the NFS service on OS X. Oddly enough, the service doesn’t automatically start when you attempt to make a connection.
- Open a Terminal window.
- Start the NFS service.
sudo nfs start
- When prompted, enter your password.
- Close the Terminal window.
Launch Connect to Server
- From the Finder menu, click Go
- Click Connect to Server from Go’s drop down menu.
- Alternatively, you can also press Command+K to launch Connect to Server.
Connect an NFS Share
- In the Server Address field, enter nfs:// to define the network protocol for CIFS, and then enter either the IP address or the hostname of the file server with the export path.
- To add the server to your Favorite Servers list, click the ‘+’ button.
- Click Connect to connect to the share.