How to configure NFS to resolve symbolic links on the server side?

Solution 1:

The symlinks are always resolved by the client. There are several reasons for that. First of all, the NFS protocol has a concept of a file handle. Each handle points to a file system object that can be a directory, a file or a symlink (and some others). Moreover, NFSv4.1 spec is clearly says:

Whether created by an NFS client or created locally on the server, the data in a symbolic link is not interpreted when created, but is simply stored.

Second, by processing the symlink on the server side additional permission rules have to be taken into account, as symlink might point to outside on the exported filesystem.

Indeed, SAMBA servers have no option to follow symlinks. This is due to (a) original MS file systems didn't have a concept of a symlinks and (b) symbolic link as file system object type are added in SMB2. The behavior, BTW, matches NFS interpretation:

Symbolic links MUST NOT be evaluated by the server.

There are couple of user-space NFS server that allow custom file system implementations, if needed:

  • nfs-ganescha
  • nfs4j (I am one of the developers)

If there is a good reason to resolve symlinks on the server side, this can be added.