# NetFS

## Client

To run the client, execute the following at the command line:

    $ netfs_mount

A "Network" icon will appear on your desktop, containing remote servers identified by host name. Inside the folder for each server are the shares on that server.

You can also run the steps individually:

    $ /system/servers/authentication_server &
    $ mkdir /network
    $ mount -t userlandfs -p "netfs" /network

## Server

To run the server:

    $ netfs_server_prefs launch

You can also start the server directly if you prefer.

    $ /system/servers/netfs_server &

The server will then run until you shut down your computer, but it is also possible to stop it manually.

    $ netfs_server_prefs terminate

Once the server is running, you can define shared folders. The first step is to create a user who can access those folders, optionally with a password.

    $ netfs_server_prefs add user <name> [<password>]

Next create a shared folder and assign a user some permissions on it.

    $ netfs_server_prefs add share <name> <path>
    $ netfs_server_prefs permissions <user> <share>

name is the name that will appear to clients when they connect to your server. flags is one or more of: m = mount, r = read, w = write, q = query.

Don't forget to save your settings.

    $ netfs_server_prefs save

The netfs_server_prefs tool can also list and remove users and shares. See the help for details.

    $ netfs_server_prefs --help

## Fallback Settings File

The settings file is stored in a binary format, but if it is missing or damaged, the server will use a fallback settings file, which has a text-based format. This file must be located at /boot/home/config/settings/netfs/netfs_server_fallback. (If neither the main settings file nor the fallback settings file can be loaded, the server will have no users or shares defined.)

Here is an example of a fallback settings file.

    # users
    user bonefish {
    	password	password
    }

    # user without a password
    user anonymous

    # shares
    share ttttt {
    	path /boot/home/Desktop/ttttt
    	user bonefish {
    		permissions	mount query read write
    	}
    }

    share sub-ttttt {
    	path /boot/home/Desktop/ttttt/rmessage
    	user bonefish {
    		permissions	mount query read write
    	}
    	user anonymous {
    		permissions	mount query read
    	}
    }