The goal of this article is setting up a nfs-server for sharing files over a network. We'll keep it simple here, so everything should be pretty much understandable.
Required packages for both the server and the client are minimal.
You'll only need to install:
Setting up the server
You need to have installed the nfs-utils package by now.
You can now start the daemons and start editing some files.
You should a few daemons (as root) to start the nfs-server:
/etc/rc.d/portmap start /etc/rc.d/nfslock start /etc/rc.d/nfsd start
You could add these daemons to the daemon-array in /etc/rc.conf to make them start on system-boot.
This file (/etc/exports) contains the various shares and their permissions of the nfs-server.
A few examples:
/files *(ro,sync) ; Read-only access to anyone /files 192.168.0.100(rw,sync) ; Read-write access to a client on 192.168.0.100 /files 192.168.1.1/24(rw,sync) ; Read-write access to all clients from 192.168.1.1 to 192.168.1.255
To make changes effective you should issue the following commando (again as root):
To allow network access to the nfs server you should add the following to /etc/hosts.allow (as root). This puts these services open to anyone, so you should probably read up on security :p
nfsd: ALL portmap: ALL