The kernel NFS server is called rpc.nfsd, so its options are documented in the rpc.nfsd(8) man page. To turn off specific versions of NFS, pass the
--no-nfs-versionargument to this daemon, as well as the rpc.mountd daemon. The accepted config file to do this is
For Ubuntu 12.04, there is a rather obviously-named variable,
RPCNFSDARGS, that can be set to pass arguments to rpc.nfsd. Here's one for turning off NFSv2:
On Ubuntu 10.04, there is no such variable, and creating it does nothing, since the init script (/etc/init.d/nfs-kernel-server) does not reference it. Instead, the
RPCNFSDCOUNTvariable can be used, since it is passed to the rpc.nfsd as well. Here's how to do the same thing on 10.04:
RPCNFSDCOUNT="-N 2 8"
Remember to keep the "8" (or whatever you choose to set it to).
For both versions, setting the
RPCMOUNTDOPTSvariable the same way is recommended, so that clients don't mount the wrong version of your exports:
RPCMOUNTDOPTS="-N 2 --manage-gids"