Skip to content

bensmrs/fuse-nfs

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

87 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fuse-nfs
========

This is a fuse module that implements the NFS protocol.

Building
========

$ sudo apt-get install libfuse3-dev libnfs14 libnfs-dev libtool m4 automake xsltproc
$ ./setup.sh
$ ./configure
$ make
$ sudo make install

FUSE OPTIONS
============

usage: fuse-nfs [options] share mountpoint

	 [-?|-h|--help]

fuse-nfs options:

	 share
		 The server export to be mounted
	 mountpoint
		 The directory to mount the nfs share on

	 [-U NFS_UID|-o fusenfs_uid=NFS_UID]
		 The uid passed within the rpc credentials within the mount point
		 This is the same as passing the uid within the url, however if both are defined then the url's one is used
	 [-G NFS_GID|-o fusenfs_gid=NFS_GID]
		 The gid passed within the rpc credentials within the mount point
		 This is the same as passing the gid within the url, however if both are defined then the url's one is used
	 [-A|-o fusenfs_allow_other_own_ids]
		 Allow fuse-nfs with allow_user activated to update the rpc credentials with the current (other) user credentials instead
		 of using the mount user credentials or (if defined) the custom credentials defined with -U/-G / url
		 This option activate allow_other, note that allow_other need user_allow_other to be defined in fuse.conf

fuse options: See man mount.fuse for those options.

ROOT vs NON-ROOT
================
By default, most NFS servers will only allow access from clients that are
using a system port (i.e. a port < 1024).
Since these ports by default can only be used by the root user this will
prevent non-root users from conencting to the NFS server or mounting the
filesystem.

There are two ways to solve this:
1, cap_net_bind_service
-----------------------
On Linux, when this capability is set the kernel will allow that program
to use system ports for any user that runs that program.

  sudo setcap 'cap_net_bind_service=+ep' ./fuse/fuse-nfs

Setting this capability will allow normal non-root users to access the NFS
server.

2, insecure
-----------
Alternatively you can often disable the "chack that the client connects from
a system port" in the NFS server itself.
On Linux NFS servers this is done by adding the "insecure" keyword to
the /etc/exports file.


LIBNFS URL-FORMAT:
===========
Libnfs uses RFC2224 style URLs extended with libnfs specific url arguments some minor extensions.
The basic syntax of these URLs is :

nfs://<server|ipv4|ipv6>/path[?arg=val[&arg=val]*]

Arguments supported by libnfs are :
 tcp-syncnt=<int>  : Number of SYNs to send during the session establish
                     before failing setting up the tcp connection to the
                     server.
 uid=<int>         : UID value to use when talking to the server.
                     default it 65534 on Windows and getuid() on unixen.
 gid=<int>         : GID value to use when talking to the server.
                     default it 65534 on Windows and getgid() on unixen.
 readahead=<int>   : Enable readahead for files and set the maximum amount
                     of readahead to <int>.
 auto-traverse-mounts=<0|1>
                   : Should libnfs try to traverse across nested mounts
					automatically or not. Default is 1 == enabled.
 dircache=<0|1>    : Disable/enable directory caching. Enabled by default.
 if=<interface>    : Interface name (e.g., eth1) to bind; requires `root`
 version=<3|4>     : NFS version to use. Version 3 is the default.


To mount a filesystem:
======================
fuse-nfs -n nfs://127.0.0.1/data/tmp -m /my/mountpoint


To unmount a filesystem:
========================
fusermount -u /my/mountpoint


NFSv4 support:
==============
NFSv4 is supported when used with a recent enough version of libnfs.
To enable NFSv4 support you need to specify version=4 as an URL argument:
fuse-nfs -n nfs://127.0.0.1/data/tmp?version=4 -m /my/mountpoint


Windows
=======
The following are ports to windows:

* Daniel Abrech (https://github.com/Daniel-Abrecht) has ported this fuse module
  to windows using the dokany filesystem/fuse wrapper.

  Windows builds for this module can be downloaded from :
  https://github.com/Daniel-Abrecht/fuse-nfs-crossbuild-scripts/releases

* Bill Zissimopoulos (https://github.com/billziss-gh) has ported this fuse
  module to windows using WinFsp.

  The NFS-Win port (including MSI installers) can be found here:
  https://github.com/billziss-gh/nfs-win

About

A FUSE module for NFSv3/4

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 90.7%
  • M4 8.1%
  • Other 1.2%