U9FS(8)

NAME
u9fs - serve 9P from Unix

SYNOPSIS
u9fs [-Dnz ] [ -a authtype ] [ -A autharg ] [ -l logfile ] [ -m msize ] [ -u onlyuser ] [ rootpath ]

DESCRIPTION
u9fs is a program that serves Unix files to Plan 9 and Unix machines using the 9P protocol. It is typically invoked on a Unix machine by xinetd with its standard input and output connected to a network connection, typically TCP on an Ethernet. It typically runs as user root and multiplexes access to multiple clients over a single wire. It assumes uids from multiple systems match, and changes to the corresponding Unix effective uid when processing requests. u9fs serves both 9P2000 and 9P2000.u.

9P2000.u is a 9P variant with extensions to better support Unix type systems. It includes fields for numeric uid and gid, and extended mode support for suid, sgid, and Unix special files (devices, symlinks, links, and named pipes).

The rootpath argument specifies the root of the tree to be exported. By default this is the standard root ("/").

The options are:

-D  Write very chatty debugging output to the log file (see -l option below).

-n  Signals that u9fs is not being invoked with a network connection on standard input and output, and thus should not try to determine the remote address of the connection. This is useful when u9fs is not invoked from xinetd.

-z  Truncate the log file on startup. This is useful mainly when debugging with -D.

-a authtype
    Sets the authentication method to be used. Authtype should be rhosts, none, or p9any. The default is rhosts, which uses the ruserok library call to authenticate users by entries in /etc/hosts.equiv or $HOME/.rhosts. This default is discouraged for all but the most controlled networks. Specifying none turns off authentication altogether. This is useful when u9fs is not invoked from xinetd. p9any uses the fourth edition Plan 9 authentication mechanisms. The file /etc/u9fs.key, or autharg if specified (see the -A option), is consulted for the authentication data. The file must contain exactly three lines: the plaintext password, the user id, and the authentication domain.

-A autharg
    Used to specify an argument to the authentication method. See the authentication descriptions above.

-l logfile
    Specifies the file which should contain debugging output and other messages. The out-of-the-box compile-time default is /tmp/u9fs.log.

-m msize
    Set msize (maximum block size) for 9P2000.

-u user
    Treat all attaches as coming from user. This is useful in some cases when running without inetd; see the examples.

EXAMPLES

Plan 9 calls 9P file service 9fs with TCP port number 564. Set up this way on a machine called, say, kremvax, u9fs may be connected to the name space of a Plan 9 process by

        9fs kremvax

On Linux systems with the v9fs module, users may connect to u9fs using the typical mount command, but must provide the IP address instead of the hostname (unfortunately, mount is somewhat bias in providing DNS lookup support for NFS, but no other network file system).

        mount -t 9P 192.168.1.5 /mnt/kremvax

u9fs serves the entire file system of the Unix machine.

The original source to u9fs is in the Plan 9 directory /sys/src/cmd/unix/u9fs. Updated versions of the source with the 9P2000.u support are available from http://v9fs.sourceforge.net. To install u9fs on a Unix system with an ANSI C compiler, obtain the source and run make. Then install the binary in /usr/sbin/u9fs. Add the file 9fs to /etc/xinetd.d:

        service u9fs
        {
        	disable         = no
        	socket_type     = stream
        	wait            = no
        	user            = root
        	group           = root
        	protocol        = tcp
        	port            = 564
        	server          = /usr/sbin/u9fs
        	server_args     = -m 65560
        }

and this to services:

        u9fs     564/tcp       9fs  # Plan 9 fs

Additional installation instructions can be found in the INSTALL document bundled with the u9fs source.

DIAGNOSTICS
Problems are reported to the log file specified with the -l option (default /tmp/u9fs.log). The -D flag enables chatty debugging.

SEE ALSO
inetd(8), mount(8), services(5), xinet(8),
http://v9fs.sourceforge.net

BUGS
The implementation of devices is unsatisfactory.

Semantics like remove-on-close or the atomicity of wstat are hard to provide exactly.

Security model is unsatisfactory.

Single threaded solution is less than satisfactory.