AFP.CONF(5) | 3.1.12 | AFP.CONF(5) |
afp.conf - Netatalk configuration file
The afp.conf file is the configuration file for the Netatalk AFP file server.
All AFP specific configuration and AFP volume definitions are done via this file.
The file consists of sections and parameters. A section begins with the name of the section in square brackets and continues until the next section begins. Sections contain parameters of the form:
name = value
The file is line-based - that is, each newline-terminated line represents either a comment, a section name or a parameter.
Section and parameter names are case sensitive.
Only the first equals sign in a parameter is significant. Whitespace before or after the first equals sign is discarded. Leading, trailing and internal whitespace in section and parameter names is irrelevant. Leading and trailing whitespace in a parameter value is discarded. Internal whitespace within a parameter value is retained verbatim.
Any line beginning with a semicolon (“;”) or a hash (“#”) character is ignored, as are lines containing only whitespace.
Any line ending in a “ \ ” is continued on the next line in the customary UNIX fashion.
The values following the equals sign in parameters are all either a string (no quotes needed) or a boolean, which may be given as yes/no, 1/0 or true/false. Case is not significant in boolean values, but is preserved in string values. Some items such as "file perm"s are numeric.
The parameter include = path allows you to include one config file inside another. The file is included literally, as though typed in place. Nested includes are not supported.
Each section in the configuration file (except for the [Global] section) describes a shared resource (known as a “volume”). The section name is the name of the volume and the parameters within the section define the volume attributes and options.
There are two special sections, [Global] and [Homes], which are described under special sections. The following notes apply to ordinary section descriptions.
A volume consists of a directory to which access is being given plus a description of the access rights which are granted to the user of the service. For volumes the path option must specify the directory to share.
Any volume section without path option is considered a vol preset which can be selected in other volume sections via the vol preset option and constitutes defaults for the volume. For any option specified both in a preset and in a volume section the volume section setting completely substitutes the preset option.
The access rights granted by the server are masked by the access rights granted to the specified or guest UNIX user by the host system. The server does not grant more access than the host system grants.
The following sample section defines an AFP volume. The user has full access to the path /foo/bar. The share is accessed via the share name baz:
[baz]
path = /foo/bar
Parameters in this section apply to the server as a whole. Parameters denoted by a (G) below are must be set in this section.
This section enable sharing of the UNIX server user home directories. Specifying an optional path parameter means that not the whole user home will be shared but the subdirectory path. It is necessary to define the basedir regex option. It should be a regex which matches the parent directory of the user homes. Parameters denoted by a (H) belong to volume sections. The optional parameter home name can be used to change the AFP volume name which $u's home by default. See below under VARIABLE SUBSTITUTIONS.
The following example illustrates this. Given all user home directories are stored under /home:
[Homes]
path = afp-data
basedir regex = /home
For a user john this results in an AFP home volume with a path of /home/john/afp-data.
If basedir regex contains symlink, set the canonicalized absolute path. When /home links to /usr/home:
[Homes]
basedir regex = /usr/home
Parameters define the specific attributes of sections.
Some parameters are specific to the [Global] section (e.g., log type). All others are permissible only in volume sections. The letter G in parentheses indicates that a parameter is specific to the [Global] section. The letter V indicates that a parameter can be specified in a volume specific section.
You can use variables in volume names. The use of variables in paths is limited to $u.
The variables which can be used for substitutions are:
$b
$c
$d
$f
$g
$h
$i
$s
$u
$v
$$
ad domain = DOMAIN (G)
admin auth user = user (G)
admin group = group (G)
force user = USER (G)
force group = GROUP (G)
k5 keytab = path (G), k5 service = service (G), k5 realm = realm (G)
nt domain = DOMAIN (G), nt separator = SEPARATOR (G)
save password = BOOLEAN (default: yes) (G)
set password = BOOLEAN (default: no) (G)
uam list = uam list (G)
The most commonly used UAMs are:
uams_guest.so
uams_clrtxt.so
uams_randnum.so
uams_dhx.so
uams_dhx2.so
uam_gss.so
uam path = path (G)
With OS X Apple introduced the AFP3 protocol. One of the big changes was, that AFP3 uses Unicode names encoded as Decomposed UTF-8 (UTF8-MAC). Previous AFP/OS versions used charsets like MacRoman, MacCentralEurope, etc.
To be able to serve AFP3 and older clients at the same time, afpd needs to be able to convert between UTF-8 and Mac charsets. Even OS X clients partly still rely on the mac charset. As there's no way, afpd can detect the codepage a pre AFP3 client uses, you have to specify it using the mac charset option. The default is MacRoman, which should be fine for most western users.
As afpd needs to interact with UNIX operating system as well, it needs to be able to convert from UTF8-MAC / Mac charset to the UNIX charset. By default afpd uses UTF8. You can set the UNIX charset using the unix charset option. If you're using extended characters in the configuration files for afpd, make sure your terminal matches the unix charset.
mac charset = CHARSET (G)/(V)
unix charset = CHARSET (G)
vol charset = CHARSET (G)/(V)
passwd file = path (G)
passwd minlen = number (G)
advertise ssh = BOOLEAN (default: no) (G)
afp interfaces = name [name ...] (G)
afp listen = ip address[:port] [ip address[:port] ...] (G)
IPv6 address + port combination must use URL the format using square brackets [IPv6]:port
afp port = port number (G)
cnid listen = ip address[:port] [ip address[:port] ...] (G)
disconnect time = number (G)
dsireadbuf = number (G)
fqdn = name[:port] (G)
hostname = name (G)
max connections = number (G)
server quantum = number (G)
sleep time = number (G)
tcprcvbuf = number (G)
tcpsndbuf = number (G)
recvfile = BOOLEAN (default: no) (G)
splice size = number (default: 64k) (G)
use sendfile = BOOLEAN (default: yes) (G)
zeroconf = BOOLEAN (default: yes) (G)
afp read locks = BOOLEAN (default: no) (G)
afpstats = BOOLEAN (default: no) (G)
basedir regex = regex (H)
chmod request = preserve (default) | ignore | simple (G)/(V)
close vol = BOOLEAN (default: no) (G)
cnid mysql host = MySQL server address (G)
cnid mysql user = MySQL user (G)
cnid mysql pw = password (G)
cnid mysql db = database name (G)
cnid server = ipaddress[:port] (G)/(V)
dbus daemon = path (G)
dircachesize = number (G)
Default size is 8192, maximum size is 131072. Given value is rounded up to nearest power of 2. Each entry takes about 100 bytes, which is not much, but remember that every afpd child process for every connected user has its cache.
extmap file = path (G)
force xattr with sticky bit = BOOLEAN (default: no) (G/V)
By enabling this option Netatalk will write the metadata xattr as root.
guest account = name (G)
home name = name (H)
ignored attributes = all | nowrite | nodelete | norename (G)/(V)
In OS X when the Finder sets a lock on a file/directory or you set the BSD uchg flag in the Terminal, all three attributes are used. Thus in order to ignore the Finder lock/BSD uchg flag, add set ignored attributes = all.
login message = message (G)/(V)
mimic model = model (G)
signature = <text> (G)
solaris share reservations = BOOLEAN (default: yes) (G)
sparql results limit = NUMBER (default: UNLIMITED) (G)
spotlight = BOOLEAN (default: no) (G)/(V)
spotlight attributes = COMMA SEPARATED STRING (default: EMPTY) (G)
spotlight attributes = *,kMDItemTextContent
spotlight expr = BOOLEAN (default: yes) (G)
start dbus = BOOLEAN (default: yes) (G)
start tracker = BOOLEAN (default: yes) (G)
veto message = BOOLEAN (default: no) (G)
vol dbpath = path (G)/(V)
vol dbnest = BOOLEAN (default: no) (G)
volnamelen = number (G)
73: limit of Mac OS X 10.1 80: limit of Mac OS X 10.4/10.5 (default) 255: limit of recent Mac OS X
Mac OS 9 and earlier are not influenced by this, because Maccharset volume name is always limited to 27 bytes.
vol preset = name (G)/(V)
zeroconf name = name (G)
log file = logfile (G)
log level = type:level [type:level ...] (G), log level = type:level,[type:level, ...] (G)
By default afpd logs to syslog with a default logging setup equivalent to default:note
logtypes: default, afpdaemon, logger, uamsdaemon
loglevels: severe, error, warn, note, info, debug, debug6, debug7, debug8, debug9, maxdebug
Netatalk includes a nifty filesystem change event mechanism where afpd processes notify interested listeners about certain filesystem event by UDP network datagrams.
The following FCE events are defined:
fce listener = host[:port] (G)
fce version = 1|2 (G)
fce events = fmod,fdel,ddel,fcre,dcre,fmov,dmov,login,logout (G)
fce coalesce = all|delete|create (G)
fce holdfmod = seconds (G)
fce ignore names = NAME[/NAME2/...] (G)
fce notify script = PATH (G)
These options are useful for debugging only.
tickleval = number (G)
timeout = number (G)
client polling = BOOLEAN (default: no) (G)
Do not use this option any longer as present Netatalk correctly supports server notifications, allowing connected clients to update folder listings in case another client changed the contents.
By default, the effective permission of the authenticated user are only mapped to the mentioned UARights permission structure, not the UNIX mode. You can adjust this behaviour with the configuration option map acls:
map acls = none|rights|mode (G)
none
rights
mode
If you want to be able to display ACLs on the client, you must setup both client and server as part on a authentication domain (directory service, e.g. LDAP, Open Directory, Active Directory). The reason is, in OS X ACLs are bound to UUIDs, not just uid's or gid's. Therefor Netatalk must be able to map every filesystem uid and gid to a UUID so that it can return the server side ACLs which are bound to UNIX uid and gid mapped to OS X UUIDs.
Netatalk can query a directory server using LDAP queries. Either the directory server already provides an UUID attribute for user and groups (Active Directory, Open Directory) or you reuse an unused attribute (or add a new one) to you directory server (eg OpenLDAP).
The following LDAP options must be configured for Netatalk:
ldap auth method = none|simple|sasl (G)
none
simple
sasl
ldap auth dn = dn (G)
ldap auth pw = password (G)
ldap server = host (G)
You can use afpldaptest(1) to syntactically check your config.
ldap userbase = base dn (G)
ldap userscope = scope (G)
ldap groupbase = base dn (G)
ldap groupscope = scope (G)
ldap uuid attr = dn (G)
Note: this is used both for users and groups.
ldap name attr = dn (G)
ldap group attr = dn (G)
ldap uuid string = STRING (G)
Default: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
ldap uuid encoding = string | ms-guid (default: string) (G)
See also the options ldap user filter and ldap group filter.
string
ms-guid
ldap user filter = STRING (default: unused) (G)
Recommended setting for Active Directory: objectClass=user.
ldap group filter = STRING (default: unused) (G)
Recommended setting for Active Directory: objectClass=group.
The section name defines the volume name. No two volumes may have the same name. The volume name cannot contain the ':' character. The volume name is mangled if it is very long. Mac charset volume name is limited to 27 characters. UTF8-MAC volume name is limited to volnamelen parameter.
path = PATH (V)
appledouble = ea|v2 (V)
vol size limit = size in MiB (V)
valid users = user @group (V)
valid users = user "user 2" @group “@group 2"
invalid users = users/groups (V)
hosts allow = IP host address/IP netmask bits [ ... ] (V)
Example: hosts allow = 10.1.0.0/16 10.2.1.100 2001:0db8:1234::/48
hosts deny = IP host address/IP netmask bits [ ... ] (V)
Example: hosts deny = 192.168.100/24 10.1.1.1 2001:db8::1428:57ab
cnid scheme = backend (V)
ea = none|auto|sys|ad|samba (V)
auto
sys
samba
ad
none
mac charset = CHARSET (V)
casefold = option (V)
tolower - Lowercases names in both directions.
toupper - Uppercases names in both directions.
xlatelower - Client sees lowercase, server sees uppercase.
xlateupper - Client sees uppercase, server sees lowercase.
password = password (V)
file perm = mode (V), directory perm = mode (V)
Example. Volume for a collaborative workgroup
file perm = 0660 directory perm =
0770
umask = mode (V)
preexec = command (V)
postexec = command (V)
root preexec = command (V)
root postexec = command (V)
rolist = users/groups (V)
rwlist = users/groups (V)
veto files = vetoed names (V)
Boolean volume options.
acls = BOOLEAN (default: yes) (V)
case sensitive = BOOLEAN (default: yes) (V)
cnid dev = BOOLEAN (default: yes) (V)
convert appledouble = BOOLEAN (default: yes) (V)
delete veto files = BOOLEAN (default: no) (V)
If this option is set to yes, then Netatalk will attempt to recursively delete any files and directories within the vetoed directory.
follow symlinks = BOOLEAN (default: no) (V)
invisible dots = BOOLEAN (default: no) (V)
network ids = BOOLEAN (default: yes) (V)
preexec close = BOOLEAN (default: no) (V)
read only = BOOLEAN (default: no) (V)
root preexec close= BOOLEAN (default: no) (V)
search db = BOOLEAN (default: no) (V)
stat vol = BOOLEAN (default: yes) (V)
time machine = BOOLEAN (default: no) (V)
unix priv = BOOLEAN (default: yes) (V)
The AFP protocol mostly refers to files and directories by ID and not by name. Netatalk needs a way to store these ID's in a persistent way, to achieve this several different CNID backends are available. The CNID Databases are by default located in the /var/lib/netatalk/CNID/(volumename)/.AppleDB/ directory.
cdb
dbd
last
Warning: It is NOT recommended to use this backend for volumes anymore, as afpd now relies heavily on a persistent ID database. Aliases will likely not work and filename mangling is not supported.
Even though ./configure --help might show that there are other CNID backends available, be warned those are likely broken or mainly used for testing. Don't use them unless you know what you're doing, they may be removed without further notice from future versions.
With OS X Apple introduced the AFP3 protocol. One of the most important changes was that AFP3 uses unicode names encoded as UTF-8 decomposed. Previous AFP/OS versions used codepages, like MacRoman, MacCentralEurope, etc.
afpd needs a way to preserve extended Macintosh characters, or characters illegal in unix filenames, when saving files on a unix filesystem. This version now uses UTF-8 as the default encoding for names. '/' will be converted to ':'.
Earlier versions used the the so called CAP encoding. An extended character (>0x7F) would be converted to a :xx sequence, e.g. the Apple Logo (MacRoman: 0xF0) was saved as :f0. Some special characters would be converted as to :xx notation as well. '/' would be encoded to :2f, a leading dot '.' might be encoded as :2e.
The vol charset option will allow you to select another volume encoding. afpd will accept any iconv(1) provided charset. It is highly recommended to stick to the default UTF-8.
afpd(8), afppasswd(5), afp_signature.conf(5), extmap.conf(5), cnid_metad(8)
27 Dec 2016 | 3.1.12 |