AFP.CONF(5)

๐Ÿ’– NAME ๐Ÿ’–

Okay so like, afp.conf is THE configuration file for the Netatalk AFP file server. That's it, that's the name. Slay.

๐ŸŒ€ SYNOPSIS ๐ŸŒ€

The afp.conf file is where all the configuration for the Netatalk AFP file server lives. Every AFP-specific setting and every AFP volume definition happens through this one file. No cap.

๐Ÿ“„ FILE FORMAT ๐Ÿ“„

The file is built from sections and parameters. A section starts with its name in square brackets [like this] and keeps going until the next section shows up. Inside a section you'll find parameters that look like:

option = value

The file is line-based, meaning each line that ends with a newline is either a comment, a section name, or a parameter. Periodt.

Parameter names are case sensitive, but section names are not. So [Global] and [global] are the same vibe, but path and Path are different besties.

Only the first equals sign in a parameter matters. Whitespace before or after that first = gets yeeted. Leading, trailing, and internal whitespace in section and parameter names? Doesn't matter, ignored. Leading and trailing whitespace in a parameter value? Also discarded. But internal whitespace inside a parameter value is kept exactly as you wrote it, verbatim, no touchy.

Any line starting with a semicolon (;) or a hash (#) is ignored, just like lines that are only whitespace. Ghosted.

Any line ending in a backslash (\) gets continued on the next line, the classic UNIX way. Iconic.

The values after the equals sign are either a string (no quotes needed, bestie) or a boolean. Booleans can be written as yes/no, 1/0, or true/false. Case doesn't matter for booleans, but it's preserved for strings. Some options, like file perm, take numeric values.

๐Ÿงฉ SECTION DESCRIPTIONS ๐Ÿงฉ

Every section in the config file (except for [Global]) describes a shared resource, also known as a volume. The parameters inside that section define the volume's attributes and options.

There are two special sections: [Global] and [Homes]. They're described under special sections (below, bestie). The notes that follow apply to ordinary section descriptions.

A volume is a directory you're giving access to, plus a description of the access rights granted to the user of the service. For volumes, the path option must specify the directory to share. Mandatory, no skips.

The name of the volume is set by the volume name option. If you don't set it, the volume name is just the section name, expressed in lowercase.

Any volume section without a path option is considered a vol preset. You can select it in other volume sections via the vol preset option, and it acts as 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. No blending, it's a full takeover.

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. So don't expect magic, the host is the final boss.

Here's a sample section that defines an AFP volume. The user has full access to the path /foo/bar. The share is accessed via the share name Baz:

[baz]
    volume name = Baz
    path = /foo/bar

๐ŸŒŸ SPECIAL SECTIONS ๐ŸŒŸ

๐Ÿ  The [Global] section

Parameters in this section apply to the server as a whole. Parameters denoted by a (G) below must be set in this section. It's giving main character energy.

๐Ÿก The [Homes] section

This section enables sharing of the UNIX server user home directories. The one mandatory option is basedir regex. It should be set to a path that matches the parent directory of the user homes.

Specifying the optional path parameter makes it so that only the subdirectory path is shared, rather than the entire home directory. Here's an example: suppose 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. Love that for him.

If basedir regex contains a symlink, set the canonicalized absolute path. When /home links to /usr/home:

[Homes]
    basedir regex = /usr/home

The optional parameter home name can be used to change the Homes volume name, which is $u's home by default. See below for more info on VARIABLE SUBSTITUTIONS.

[Homes]
    home name = The home of $u
    basedir regex = /home

For the same user john, this results in an AFP home volume called The home of john. Adorable.

Any parameter denoted by a (H) below can be used in the Homes section.

๐ŸŽ›๏ธ PARAMETERS ๐ŸŽ›๏ธ

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 means the parameter is specific to the [Global] section. The letter V means the parameter can be specified in a volume-specific section.

๐Ÿ”ค VARIABLE SUBSTITUTIONS ๐Ÿ”ค

You can use variables in volume names. The use of variables in paths is limited to $u. That's the only one allowed there, bestie.

  1. If you specify an unknown variable, it will not get converted. It just sits there, confused.
  2. If you specify a known variable, but that variable doesn't have a value, it will get ignored. Bye.

The variables you can use for substitutions are:

  • $b โ€” basename
  • $c โ€” client's ip address
  • $d โ€” volume pathname on server
  • $f โ€” full name (contents of the gecos field in the passwd file)
  • $g โ€” group name
  • $h โ€” hostname
  • $i โ€” client's ip, without port
  • $s โ€” server name (this can be the hostname)
  • $u โ€” user name (if guest, it is the user that guest is running as)
  • $v โ€” volume name
  • $$ โ€” prints dollar sign ($)

๐ŸŒ EXPLANATION OF GLOBAL PARAMETERS ๐ŸŒ

๐Ÿ” Authentication Options

  • ad domain = domain (G) โ€” Append @DOMAIN to username when authenticating. Useful in Active Directory environments that otherwise would require the user to enter the full user@domain string. So handy.
  • admin group = group (G) โ€” Allows users of a certain group to be seen as the superuser when they log in. This option is disabled by default. Fancy.
  • force user = user (G) โ€” Specifies a UNIX user name that will be assigned as the default user for all users connecting to this server. Useful for sharing files. You should also use it carefully, because using it incorrectly can cause security problems. Be safe, bestie.
  • force group = group (G) โ€” Specifies a UNIX group name that will be assigned as the default primary group for all users connecting to this server.
  • guest account = name (G) โ€” Specifies the user that guests should use (default is nobody). The name must be a valid user on the host system. No random names.
  • k5 keytab = path (G); k5 service = service (G); k5 realm = realm (G) โ€” These are required if the server supports the Kerberos 5 authentication UAM. All three, together.
  • nt domain = domain (G); nt separator = SEPARATOR (G) โ€” Use for e.g. winbind authentication. Prepends both strings before the username from login and then tries to authenticate with the result through the available and active UAM authentication modules.
  • uam list = uam list (default: uams_dhx2.so) (G) โ€” Space or comma separated list of User Authentication Methods.

Available UAMs are:

  • uams_dhx2.so โ€” (uams_dhx2_pam.so or uams_dhx2_passwd.so) Allow Diffie-Hellman eXchange 2 (DHX2) for authentication.
  • uams_srp.so โ€” Allow SRP ("Secure Remote Password") for authentication. Requires a separate file containing the SRP salts and verifiers, either the default afppasswd.srp file or the one specified via "srp passwd file". See afppasswd(1) for details.
  • uam_gss.so โ€” Allow Kerberos V for authentication. Requires Kerberos support to be enabled at compile time and a properly configured Kerberos environment.
  • uams_guest.so โ€” Allows guest logins. (INSECURE!)
  • uams_clrtxt.so โ€” (uams_pam.so or uams_passwd.so) Allow logins with passwords transmitted in the clear. Compatible with Mac OS 9 and earlier. (INSECURE!)
  • uams_randnum.so โ€” Allows Random Number and Two-Way Random Number Exchange for authentication (requires a separate file containing the passwords, either the default afppasswd file or the one specified via "passwd file"). See afppasswd(1) for details. (INSECURE!)
  • uams_dhx.so โ€” (uams_dhx_pam.so or uams_dhx_passwd.so) Allow Diffie-Hellman eXchange (DHX) for authentication. (INSECURE!)
  • uam path = path (G) โ€” Sets the default path for UAMs for this server.
  • valid shellcheck = BOOLEAN (default: yes) (G) โ€” Whether to check if the user's login shell is valid (i.e. listed in /etc/shells). If the user's shell is not valid, authentication will fail. This is a security feature to prevent users with nologin shells from logging in. Disable this option to allow users with nologin shells to log in. Your call.

๐Ÿ”  Charset Options

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 the 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)

So yeah โ€” this one sets the Mac client's charset, like MAC_ROMAN. It's what converts strings and filenames over to the client's codepage for OS9 and Classic, meaning for authentication and AFP messages (the SIGUSR2 messaging situation ๐Ÿ’Œ). It's also the default for the volume's mac charset. Defaults to MAC_ROMAN.

  • unix charset = charset (G) โ€” this is your server's unix charset, bestie, like ISO-8859-15 or EUC-JP. It converts strings to/from the system's locale, so: authentication, server messages, volume names, the whole lineup. If LOCALE is set, the system's locale gets used instead. Defaults to UTF8. โœจ
  • vol charset = charset (G)/(V) โ€” sets the encoding of the volume's filesystem. By default it's the same as unix charset.
NOTE: it is highly recommended to stick to the default UTF-8 encoding. Like, genuinely. Leave it alone. ๐Ÿ™ˆ

๐Ÿ’– Password Options ๐Ÿ’–

  • passwd file = path (G) โ€” sets the path to the Randnum UAM password file for this server. ๐Ÿ—๏ธ
  • passwd minlen = number (G) โ€” sets the minimum password length, if the UAM supports it.
  • save password = BOOLEAN (default: yes) (G) โ€” turns on/off whether clients are allowed to save passwords locally. Setting this to no sends the hint to clients, but ngl, it's entirely up to the client whether it actually honors it. ๐Ÿ’…
  • set password = BOOLEAN (default: no) (G) โ€” turns on/off whether clients can change their passwords. Setting it to yes lets clients change their passwords if the UAM in use supports the feature.
  • srp passwd file = path (G) โ€” sets the path to the SRP UAM verifier file for this server.

๐ŸŒ Network Options ๐ŸŒ

  • advertise ssh = BOOLEAN (default: no) (G) โ€” lets old Mac OS X clients (10.3.3โ€“10.4) automatically set up a tunneled AFP connection through SSH. If this is set, the server's answers to the client's FPGetSrvrInfo requests carry an extra entry. Whether it actually works depends on both the client's settings and a correctly configured, running sshd(8) on the server. Teamwork, fr fr. ๐Ÿค
NOTE: setting this option is not recommended, because globally encrypting AFP connections via SSH will crank the server's load up significantly. And also โ€” Apple's client-side implementation of this feature in Mac OS X versions before 10.3.4 had a security flaw. ๐Ÿ’€
  • afp interfaces = name [name โ€ฆ] (G) โ€” picks which network interfaces the server listens on. Default behaviour is to advertise the first IP address of the system while listening for any incoming request.
NOTE: do not use this at the same time as the afp listen option. Pick a lane, bestie. ๐Ÿ™…โ€โ™€๏ธ
  • afp listen = ip address[:port] [ip address[:port] โ€ฆ] (G) โ€” picks the IP address the server advertises and listens to. Default is to advertise the first IP address of the system, but to listen for any incoming request. The network address can be in dotted-decimal format for IPv4, or hexadecimal format for IPv6.

An IPv6 address + port combination has to use the URL format with square brackets: [IPv6]:port

NOTE: do not use this at the same time as the afp interfaces option. Same energy as above. ๐ŸŒธ
  • afp port = port number (G) โ€” lets you use a different TCP port for AFP. Default is 548. It also sets the default port applied whenever no port is specified in an afp listen option.
  • afp read locks = BOOLEAN (default: no) (G) โ€” whether to apply locks to the byte region read in FPRead calls. The AFP spec mandates it, but it's not really in line with UNIX semantics and it's a performance hog. ๐Ÿ™ƒ
  • disconnect time = number (G) โ€” keeps disconnected AFP sessions around for number hours before dropping them. Default is 24 hours. ๐Ÿ˜ด
  • dsireadbuf = number (G) โ€” a scale factor that decides the size of the DSI/TCP readahead buffer; default is 12. It gets multiplied by the DSI server quantum (default 1MiB) to give the buffer size. Bumping this value might increase throughput on fast local networks for volume-to-volume copies. โœจ
NOTE: this buffer is allocated per afpd child process, so specifying large values will eat up a large amount of memory (buffer size * number of clients). Do the math first, babe. ๐Ÿงฎ
  • fqdn = name[:port] (G) โ€” specifies a fully-qualified domain name, with an optional port. It gets discarded if the server can't resolve it. Not honored by AppleShare clients <= 3.8.3. Disabled by default. Use with caution, because it involves a second name resolution step on the client side. Also note that afpd will advertise this name:port combination but won't automatically listen to it. ๐Ÿ‘€
  • hostname = name (G) โ€” use this instead of the result from calling hostname when determining which IP address to advertise. So the hostname gets resolved to an IP, and that's what's advertised. This is NOT used for listening, and it can be overridden by afp listen. ๐Ÿ™ˆ
  • max connections = number (G) โ€” sets the maximum number of clients that can simultaneously connect to the server (default is 200).
  • server quantum = number (G) โ€” specifies the DSI server quantum. Default value is 0x100000 (1 MiB). Maximum value is 0xFFFFFFFF, minimum is 32000. If you specify a value that's out of range, the default value gets set instead. Do not change this value unless you're absolutely sure, what you're doing. ๐Ÿ”ฅ
  • sleep time = number (G) โ€” keeps sleeping AFP sessions for number hours before disconnecting clients in sleep mode. Default is 10 hours. ๐Ÿ’ค
  • tcprcvbuf = number (G) โ€” tries to set the TCP receive buffer using setsockopt(). Often OSes impose restrictions on the application's ability to set this value, so, y'know. Set your expectations accordingly. ๐Ÿซถ
  • tcpsndbuf = number (G) โ€” tries to set the TCP send buffer using setsockopt(). Same deal: often OSes impose restrictions on the application's ability to set this value.
  • recvfile = BOOLEAN (default: no) (G) โ€” whether to use splice() on Linux for receiving data.
  • splice size = number (default: 64k) (G) โ€” maximum number of bytes spliced.
  • use sendfile = BOOLEAN (default: yes) (G) โ€” whether to use the sendfile syscall for sending file data to clients. ๐Ÿš€
  • zeroconf = BOOLEAN (default: yes) (G) โ€” whether to use automatic Zeroconf service registration, if Avahi or mDNSResponder were compiled in.

๐Ÿ—„๏ธ CNID Database Backend Options ๐Ÿ—„๏ธ

Global configurations specific to the CNID database backends, which control how the database is stored and accessed. This is the lore, bestie. ๐Ÿ“š

  • cnid listen = host[:port] (G) โ€” specifies the hostname or IP address and port that the CNID server should listen on. The host has to resolve to a local address that cnid_metad can bind. For most deployments this should match the address and port of the cnid server option. Default is localhost:4700. When only a hostname or IP address is specified, the default port 4700 is used.
  • cnid mysql host = MySQL server address (G) โ€” name or address of a MySQL server for use with the mysql CNID backend.

On Unix systems, setting this to localhost (or leaving it unset) causes the MySQL client library to prefer Unix socket connections, which gives better performance for a local database. Setting it to 127.0.0.1 forces a TCP connection to the loopback interface. ๐Ÿ’…

  • cnid mysql user = MySQL user (G) โ€” MySQL user for authentication with the server.
  • cnid mysql pw = password (G) โ€” password for the MySQL server.
  • cnid mysql db = database name (G) โ€” name of the database to use for CNID storage. If the database doesn't exist, Netatalk will attempt to create it automatically (which requires the specified user to have CREATE DATABASE privileges).
  • cnid scheme = dbd | mysql | sqlite (G)/(V) โ€” sets the CNID backend used for the volumes. Not all backends may be available with your netatalk installation. Run afpd -v to see a list of available backends, plus which one is the default. ๐Ÿ‘‘
    • dbd: uses Berkeley DB, with database reads and writes managed through the cnid_dbd daemon. It is deprecated and not recommended for new deployments. ๐Ÿ˜ญ
    • mysql: connects to a MySQL (or MariaDB) database instance that has been provisioned for use with Netatalk. Requires database administration, which gives you full control over how the CNID data is stored.
    • sqlite: uses the SQLite embedded database library. It's performant and lean, requiring no external database or daemon. The low-maintenance icon. ๐ŸŒˆ
  • cnid server = host[:port] (G)/(V) โ€” specifies the hostname or IP address and port of a cnid_metad server, required for the CNID dbd backend. For most deployments this should match the address and port of the cnid listen option. Defaults to localhost:4700. When only a hostname or IP address is specified, the default port 4700 is used.

Hostnames and IPv4 addresses are accepted. Hostnames may resolve to IPv4 or IPv6 addresses.

  • vol dbpath = path (G)/(V) โ€” sets the path where the database information will be stored. You have to specify a writable location, even if the volume is read only. Yes really. ๐Ÿซ 
  • vol dbnest = BOOLEAN (default: no) (G) โ€” setting this option to true brings back the Netatalk 2 behaviour of storing the CNID database in a folder called .AppleDB inside the volume root of each share. Retro vibes, on purpose. ๐ŸŽ€

๐Ÿงš Directory Cache Tuning ๐Ÿงš

  • dircache size = number (G) โ€” maximum entries in the directory cache. Stores directories and optionally files. Minimum: 1024 (1K). Default: 65536 (64K). Maximum: 1048576 (1M). Higher values improve hit ratios but use more memory. Pick your fighter. ๐Ÿ’ญ
  • dircache validation freq = number (G) โ€” directory cache validation frequency for external change detection. A value of 1 means validate on every access (default, for backward compatibility), while higher values validate less frequently. If Netatalk is the only process accessing the volume you can safely set a value of 100 for maximum performance. โšก
  • dircache mode = lru | arc (default: lru) (G)

Cache replacement algorithm ๐Ÿ’ซ lru = Least Recently Used, which is stable and memory-efficient. arc = Adaptive Replacement Cache, which is self-tuning, gets 10-50% better hit ratios, and is 2ร— better on sequential scans. ARC uses approximately 2ร— memory (~100% overhead) because of ghost entries: evicted entries that get tracked for learning, which is literally what lets ARC adapt. Example: a 64K cache uses ~24 MB (ARC) vs ~12 MB (LRU).

Recommendation, bestie: use arc for servers with 8GB+ RAM. Use lru for constrained systems. And increase dircache size (max entries) for best results โœจ

  • dircache rfork budget = number (default: 0) (G) โ€” the total memory budget, in KB, for caching resource fork data inside the directory cache. When it's 0 (the default) resource fork caching is just off. When it's on, it stores small resource fork contents in memory so you don't have to keep re-reading the disk during FPGetFileDirParams and FPEnumerate operations ๐ŸŽ€

Maximum: 10485760 (that's 10 GB in KB) total.

  • dircache rfork maxsize = number (default: 1024) (G) โ€” the max size, in KB, of a single resource fork entry that will get cached. Resource forks bigger than this value won't be cached at all, even if the total budget still has room left over ๐Ÿ’…

Maximum: 10240 (10 MB in KB) per entry.

Note: See Configuration chapter in the manual for more information


๐Ÿฆ‹ Miscellaneous Options ๐Ÿฆ‹

  • afpstats = BOOLEAN (default: no) (G) โ€” whether to expose AFP runtime statistics (connected users, open volumes) over a Unix socket.
  • afpstats group = group (G) โ€” sets the group owner of the afpstats Unix socket. The socket gets created with mode 0660, so only root and members of this group can read the runtime statistics. If you don't set it, the socket just keeps whatever group the operating system hands it when afpd creates it ๐Ÿ™ˆ
  • close vol = BOOLEAN (default: no) (G) โ€” whether to close volumes that clients may have opened when those volumes get removed from the config and the config is reloaded.
  • extmap file = path (G) โ€” sets the path to the file that defines file extension type/creator mappings.
  • force xattr with sticky bit = BOOLEAN (default: no) (G)/(V) โ€” writing metadata xattr on directories that have the sticky bit set may fail even when we do have write access to the directory, because when the sticky bit is set only the owner is allowed to write xattrs ๐Ÿ˜ญ

By enabling this option Netatalk will write the metadata xattr as root. Main character energy, honestly ๐Ÿ‘‘

  • ignored attributes = all | nowrite | nodelete | norename (G)/(V) โ€” name a set of file and directory attributes that the server shall ignore. all includes all the other options.

In OS X, when the<|place_holder_mm_span_0442|> Finder locks a file/directory or you set the BSD uchg flag in the Terminal, all three attributes get used. So to ignore the Finder lock/BSD uchg flag, add set ignored attributes = all โœจ

  • mimic model = model (G) โ€” picks a custom icon for the mounted AFP volume on macOS (Mac OS X) clients. The default is to let macOS choose for itself. Requires netatalk to be built with Zeroconf. Examples:
    • Laptop
    • RackMount
    • Tower

You can find a complete set of supported model codes for a macOS client by inspecting system properties files, like /System/Library/CoreServices/CoreTypes.bundle/Contents/Info.plist on macOS 15 Sequoia ๐Ÿ”

  • server name = name (G) โ€” a human-readable name that uniquely describes the AFP server. Defaults to the value of hostname up until the first period. When netatalk is built with Zeroconf support, this also gets registered as the service name and advertised as UTF-8, up to 63 octets (bytes) in length.
  • signature = STRING (G) โ€” specify a server signature. The max length is 16 characters. This one is useful for clustered environments, to provide fault isolation etc. By default, afpd generates a signature and saves it automatically to a file called afp_signature.conf (based on random numbers). See also asip-status(1) ๐Ÿ‘€
  • solaris share reservations = BOOLEAN (default: yes) (G) โ€” use share reservations on Solaris. The Solaris CIFS server uses this too, so this makes you a lock-coherent multi protocol server ๐ŸŒˆ
  • veto message = BOOLEAN (default: no) (G) โ€” send optional AFP messages for vetoed files. Then whenever a client tries to access any file or directory with a vetoed name, it gets sent an AFP message indicating the name and the directory ๐Ÿ’Œ
  • volnamelen = number (G) โ€” max length of the UTF8-MAC volume name for Mac OS X. Note that Hangul is especially sensitive to this ๐Ÿ˜ณ
    • 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 aren't influenced by this at all, because the Maccharset volume name is always limited to 27 bytes.

  • vol preset = name (G)/(V) โ€” use section name as the option preset for all volumes (when set in the [Global] section) or for one volume (when set in that volume's section).

๐Ÿ”Ž Search Options ๐Ÿ”Ž

Configure Netatalk's file search capabilities, covering Spotlight and Catalog Search.

  • dbus daemon = path (G) โ€” sets the path to the dbus-daemon binary used to launch a private D-Bus for the LocalSearch backend. Handy when the compile-time default path doesn't match your runtime environment ๐Ÿ› ๏ธ

If support is compiled into Netatalk, you can alternatively use the localsearch backend which unlocks more advanced search capabilities, including full text search and file metadata search โญ

  • search db = BOOLEAN (default: yes) (V) โ€” use the fast CNID database namesearch instead of the slow recursive filesystem search, for Classic Mac OS - Mac OS X 10.3 clients.
NOTE: This relies on a consistent CNID database for accurate search results. Interacting with the AFP volume using other file sharing protocols, or doing local filesystem access on the host without using nad(1), will lead to an inaccurate CNID database that has to be repaired with dbd(1) ๐Ÿ’€
  • sparql results limit = NUMBER (default: UNLIMITED) (G) โ€” impose a limit on the number of results queried from Tracker or LocalSearch via SPARQL queries.

The xapian backend also uses this value as its per-query result limit, despite the historical option name. When set to 0, LocalSearch queries are unlimited, while the xapian backend applies an internal safety cap of 10000 candidate results. Set a larger nonzero value to raise the xapian cap. The cnid backend doesn't use this option at all and is limited by its fixed CNID search reply cap ๐Ÿ”ฅ

  • spotlight = BOOLEAN (default: yes) (G)/(V) โ€” whether to enable Spotlight-compatible searches. As a global option, this sets the default for volumes. As a volume option, it overrides the global default for that volume ๐ŸŒธ

A volume is searchable only when its effective spotlight setting is enabled and a supported spotlight backend is available for that volume.

  • spotlight attributes = COMMA SEPARATED STRING (default: EMPTY) (G) โ€” a list of Spotlight query attributes accepted by the localsearch backend. By default, all attributes known to the LocalSearch SPARQL mapper can be searched; passing a string limits the searchable attributes to elements of the string. Example:
spotlight attributes = *,kMDItemTextContent

This option does not affect the cnid or xapian backends ๐Ÿ™…

  • spotlight backend = backend (default: cnid) (G)/(V) โ€” the search backend used by the Spotlight feature.

Depending on your Netatalk configuration, the available backends may include: cnid, localsearch, xapian.

Run netatalk -v to see which backends are available in your installation ๐Ÿ‘‘

NOTE: The xapian backend is considered EXPERIMENTAL and is not recommended for production use at this time. Fr fr, don't ship it ๐Ÿšจ
  • spotlight expr = BOOLEAN (default: yes) (G) โ€” whether the localsearch backend allows Spotlight logic expressions when translating Spotlight RAW queries to SPARQL.

This option does not affect the cnid or xapian backends.


๐Ÿ“ Logging Options ๐Ÿ“

Control what kinds of messages are logged, and where they are logged.

  • log file = logfile (G) โ€” write logs to logfile on the file system. If you don't specify it, Netatalk logs to the syslog daemon facility.
  • log level = type:level [type:level โ€ฆ]; log level = type:level,[type:level, โ€ฆ] (G) โ€” a space or comma separated list of one or more log type and log level pairs.

The default log level and severity is default:note ๐ŸŒŸ

For each pair, the log level specifies the minimum severity of messages of the given log type that will be logged. Only messages of that log type with severity equal to or higher than the specified log level get logged, while messages of that log type with lower severity get ignored ๐Ÿ’ค

The default log type is a special log type that applies to all messages. If no log level is specified for default, then only log types with explicitly specified log levels will be logged, and all other log types get ignored.

For example, if you specify log level = default:warn, then all messages with severity warn or higher (i.e. warn, error, severe) will be logged, and anything below warn (note, info, debug etc.) will be ignored.

By chaining multiple log type and log level pairs together, you get fine-grained control over which messages are logged based on their type and severity. Obsessed with the precision, honestly ๐ŸŽ€

Available logtypes: default, logger, cnid, afpdaemon, dsi, atalkdaemon, papdaemon, uams, fce, ad, spotlight

Available loglevels (by falling order of severity): severe, error, warn, note, info, debug, debug6, debug7, debug8, debug9, maxdebug

NOTE: Both logtype and loglevels are case insensitive โœจ
  • log microseconds = BOOLEAN (default: yes) (G) โ€” log timestamps with accuracy down to microseconds. If disabled, the timestamps record only whole seconds. Only takes effect when used in tandem with the log file option โฑ๏ธ

๐Ÿงš Filesystem Change Events (FCE) ๐Ÿงš

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:

  • file modification (fmod)
  • file deletion (fdel)
  • directory deletion (ddel)
  • file creation (fcre)
  • directory creation (dcre)
  • file move or rename (fmov)
  • directory move or rename (dmov)
  • login (login)
  • logout (logout)
  • fce listener = host[:port] (G) โ€” okay so this one lets you send FCE events to a specific host, and if you don't give a port it just defaults to 12250, periodt. Want multiple listeners? Just drop this option once for each one bestie, it stacks.
  • fce version = 1 | 2 (G) โ€” this is the FCE protocol version and it defaults to 1. Heads up tho: you need version 2 if you want the fmov, dmov, login or logout events. no version 2, no fancy events ๐Ÿ’…
  • fce events = fmod,fdel,ddel,fcre,dcre,fmov,dmov,login,logout (G) โ€” here's where you pick which FCE events are actually active. Default is fmod,fdel,ddel,fcre,dcre.
  • fce coalesce = all | delete | create (G) โ€” coalesce FCE events. that's it, that's the vibe.
  • fce holdfmod = seconds (G) โ€” this sets the time delay in seconds that's always waited if another file modification hits for the same file from a client before it sends an FCE file modification event (fmod). Lowkey relatable example: saving a file in Photoshop generates a whole bunch of events by itself because the app opens, modifies and closes a file like multiple times for every single "save". Default is 60 seconds.
  • fce sendwait = milliseconds (G) โ€” sets a delay in milliseconds between each FCE event being emitted. Use this if you're out here losing FCE events when you create or delete a genuinely unhinged number of files at once ๐Ÿ˜ญ. The deluge of events from an operation like that can cause UDP buffer overflow and then packet loss, which is not the moment. Gotta be a number between 0 and 999. Default is 0 milliseconds.
  • fce ignore names = NAME[,NAME2,โ€ฆ] (G) โ€” a comma-delimited list of filenames that FCE events will not be generated for. Default is .DS_Store (of course it is).
  • fce ignore directories = PATH[,PATH2,โ€ฆ] (G) โ€” comma-delimited list of paths to directories where FCE events won't be generated. Gotta be an absolute path on the host file system, and it must not end with a slash. Default is empty.
  • fce notify script = path (G) โ€” a script that runs for every single FCE event. Peep contrib/scripts/fce_ev_script.sh in the Netatalk source tree for an example script bestie ๐Ÿซถ

Options for ACL handling

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:

  • chmod request = preserve (default) | ignore | simple (G)/(V) โ€” advanced permission control that deals with ACLs, and honestly it's giving choices:
    • ignore โ€” UNIX chmod() requests are completely ignored. Use this one if you want the parent directory's ACL inheritance to have full control over new items.
    • preserve โ€” preserve ZFS ACEs for named users and groups or POSIX ACL group mask
    • simple โ€” just do a chmod() as requested, no extra steps, no drama
  • map acls = none | rights | mode (G) โ€” the mapping moment ๐Ÿ’ซ
    • none โ€” no mapping of ACLs at all.
    • rights โ€” effective permissions are mapped to UARights structure. This is the default.
    • mode โ€” ACLs are additionally mapped to the UNIX mode of the filesystem object.

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. So Netatalk has to be able to map every filesystem uid and gid to a UUID so it can return the server side ACLs that are bound to UNIX uid and gid mapped to OS X UUIDs. It's a whole thing, but it slays when it works โœจ

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 (G) โ€” pick your auth vibe:
    • none โ€” anonymous LDAP bind
    • simple โ€” simple LDAP bind
  • ldap auth dn = dn (G) โ€” Distinguished Name of the user for simple bind.
  • ldap auth pw = password (G) โ€” password for simple bind. keep it secret, keep it safe ๐Ÿ”’
  • ldap uri = ldap://somehost:1234/ (G) โ€” specifies the LDAP URI of the server to connect to. The URI scheme may be ldap, ldapi or ldaps, specifying LDAP over TCP, ICP or TLS respectively (if supported by the LDAP library). This is only needed for explicit ACL support in order to be able to query LDAP for UUIDs.

You can use afpldaptest(1) to syntactically check your config. very handy bestie.

  • ldap userbase = base dn (G) โ€” DN of the user container in LDAP.
  • ldap userscope = scope (G) โ€” search scope for user search: base | one | sub
  • ldap groupbase = base dn (G) โ€” DN of the group container in LDAP.
  • ldap groupscope = scope (G) โ€” search scope for group search: base | one | sub
  • ldap uuid attr = dn (G) โ€” name of the LDAP attribute with the UUIDs.
NOTE: this is used both for users and groups. one attr to rule them all fr.
  • ldap name attr = dn (G) โ€” name of the LDAP attribute with the users short name.
  • ldap group attr = dn (G) โ€” name of the LDAP attribute with the groups short name.
  • ldap uuid string = STRING (G) โ€” format of the uuid string in the directory. It's a series of x and -, where every x denotes a value 0-9a-f and every - is a separator.

Default: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

  • ldap uuid encoding = string (default) | ms-guid (G) โ€” format of the UUID of the LDAP attribute, and it allows usage of the binary objectGUID fields from Active Directory. If left unspecified, string is the default, which passes through the ASCII UUID returned by most other LDAP stores. If set to ms-guid, the internal UUID representation is converted to and from the binary format used in the objectGUID attribute found on objects in Active Directory when interacting with the server.

See also the options ldap user filter and ldap group filter.

  • string โ€” UUID is a string, use with e.g. OpenDirectory.
  • ms-guid โ€” binary objectGUID from Active Directory
  • ldap user filter = STRING (default: unused) (G) โ€” optional LDAP filter that matches user objects. This is necessary for Active Directory environments where users and groups are stored in the same directory subtree.

Recommended setting for Active Directory: objectClass=user.

  • ldap group filter = STRING (default: unused) (G) โ€” optional LDAP filter that matches group objects. This is necessary for Active Directory environments where users and groups are stored in the same directory subtree.

Recommended setting for Active Directory: objectClass=group.

Classic Options

Enable Netatalk features that are only relevant for Classic Mac OS or Apple II clients. See also the Charset options elsewhere in this manual. yes this is the retro corner and we respect it ๐Ÿ’พ

  • appletalk = BOOLEAN (default: no) (G) โ€” enables support for AFP-over-AppleTalk. This option requires that your operating system supports the AppleTalk networking protocol, and that Netatalk was built with AppleTalk support. two conditions, no shortcuts.
  • ddp address = ddp address (G) โ€” specifies the DDP address of the server. The default is to auto-assign an address (0.0). This is only useful if you are running AppleTalk on more than one interface.
  • ddp zone = ddp zone (G) โ€” specifies the AppleTalk zone to register the server in. The default is to register the server in the default zone of the last interface configured by the system.
  • legacy icon = icon (G)/(V) โ€” sets the shared volume icon displayed in the Finder in Classic Mac OS. If a custom icon is already associated with the volume, this option is ignored. Available icon styles:
    • daemon
    • declogo
    • fileserver
    • globe
    • nas
    • sdcard
    • sunlogo
    • viking
  • legacy volume size = BOOLEAN (default: no) (V) โ€” limit disk size reporting to 2GB for legacy clients. This can be used for older Macintoshes running System 7.1 or earlier and using newer AppleShare clients.
  • login message = message (G)/(V) โ€” sets a message to be displayed when Classic Mac OS clients log on to the server. The message should be in unix charset. Extended characters are allowed. cute.
  • prodos = BOOLEAN (default: no) (V) โ€” enable ProDOS support. This option should only be enabled for volumes you expect to netboot an Apple II from. In addition to setting the boot flag on the volume, it restricts the volume free space reported to the client to 32MB.

Debug Parameters

These options are useful for debugging only. Do NOT enable them in production environments! I'm so serious rn, this is the one warning that gets the caps lock ๐Ÿ˜ค

  • tickleval = number (G) โ€” sets the tickle timeout interval (in seconds). Defaults to 30.
  • timeout = number (G) โ€” specify the number of tickles to send before timing out a connection. The default is 4, therefore a connection will timeout after 2 minutes.
  • client polling = BOOLEAN (default: no) (G) โ€” with this option enabled, afpd won't advertise that it is capable of server notifications, so that connected clients poll the server every 10 seconds to detect changes in opened server windows.

๐Ÿ‘‘ Explanation of Volume Parameters ๐Ÿ‘‘

Home Section Parameters

Special parameters that only apply to the home volume. home sweet home ๐Ÿ 

  • basedir regex = regex (H) โ€” regular expression which matches the parent directory of the user homes. If basedir regex contains symlink, you must set the canonicalized absolute path. In the simple case this is just a path i.e. basedir regex = /home
  • home name = name (H) โ€” AFP user home volume name. The default is $u's home. The name must contain "$u". lowercase u, don't forget her.

Volume Sections Parameters

Each volume should at least define path and volume name.

  • path = path (V) โ€” the path name must be a fully qualified path name.
  • volume name = STRING (default: section name in lowercase) (V)

This one sets the name of your shared AFP volume (volume name). If you don't set it, it defaults to the name of the ini file section where the volume is defined, converted to lowercase. ๐Ÿ’…

No two volumes may have the same name, periodt. And the volume name cannot contain the : character. If it's very long it gets mangled. Mac charset volume name is limited to 27 characters. UTF8-MAC volume name is limited to the volnamelen parameter.

  • vol size limit = size in MiB (V) โ€” lowkey iconic for Time Machine: it limits the reported volume size, so Time Machine doesn't eat your whole real disk space for backup. Example: vol size limit = 1000 would limit the reported disk space to 1 GB.
IMPORTANT: This is an approximated calculation taking into account the contents of Time Machine sparsebundle images. Therefore you MUST NOT use this volume to store other content when using this option, because it would NOT be accounted for. The calculation works by reading the band size from the Info.plist XML file of the sparsebundle, reading the bands/ directory counting the number of band files, and then multiplying one with the other.
  • valid users = user / @group (V) โ€” the allow option, bestie. It lets you specify which users and groups get access to a share. Users and groups are delimited by spaces or commas, and groups get a @ prefix, okay?
valid users = user @group
  • invalid users = user / @group (V) โ€” the deny option. Specifies users and groups who are not allowed access to the share. Same format as the โ€œvalid usersโ€ option, fr fr.
  • hosts allow = IP host address/IP netmask bits [ โ€ฆ ] (V) โ€” only the hosts and networks you list here are allowed, everything else gets rejected. ๐Ÿ˜ค The network address may be specified either in dotted-decimal format for IPv4 or in hexadecimal format for IPv6.
hosts allow = 10.1.0.0/16 10.2.1.100 2001:0db8:1234::/48
  • hosts deny = IP host address/IP netmask bits [ โ€ฆ ] (V) โ€” the flip side: listed hosts and nets are rejected, all others are allowed.
hosts deny = 192.168.100/24 10.1.1.1 2001:db8::1428:57ab
  • ea = sys | samba | ad | none (default: auto detect) (V) โ€” this is the one that says how Extended Attributes and Mac OS Resource Forks are stored. By default, we attempt to enable sys with a fallback to none. For the auto detection to work, the volume needs to be writable, because we attempt to set an EA on the shared directory itself. For read-only volumes, set this option explicitly!
    • sys โ€” Use filesystem Extended Attributes.
    • samba โ€” Use filesystem Extended Attributes, but append a 0 byte to each xattr in order to be compatible with Samba's vfs_streams_xattr.
    • ad โ€” Use AppleDouble v2 metadata stored as files in .AppleDouble directories. This should only be used when the host's filesystem does not support Extended Attributes.
    • none โ€” No Extended Attributes support.
WARNING: The samba option should not be used on a volume that was previously set to sys. This may lead to data loss (client copy between shares to convert). ๐Ÿ’€
  • mac charset = charset (V) โ€” Specifies the Mac client charset for this Volume, e.g. MAC_ROMAN, MAC_CYRILLIC. If not specified the global setting is applied. This setting is only required if you need volumes where the Mac charset differs from the one globally set in the [Global] section.
  • casefold = option (V) โ€” the casefold option handles whether the case of filenames should be changed. The available options are:
    • 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) โ€” lets you set a volume password, which can be a maximum of 8 characters long (using ASCII strongly recommended at the time of this writing).
  • file perm = mode (V); directory perm = mode (V) โ€” Add(or) with the client requested permissions: file perm is for files only, directory perm is for directories only. Don't use with โ€œunix priv = noโ€. Example: Volume for a collaborative workgroup
file perm = 0660
directory perm = 0770
  • umask = mode (V) โ€” Set perm mask. Don't use with โ€œunix priv = noโ€.
  • preexec = command (V) โ€” Command to be run when the volume is mounted.
  • postexec = command (V) โ€” Command to be run when the volume is closed.
  • rolist = users/groups (V) โ€” Allows certain users and groups to have read-only access to a share. This follows the allow option format.
  • rwlist = users/groups (V) โ€” Allows certain users and groups to have read/write access to a share. This follows the allow option format.
  • veto files = vetoed names (V) โ€” Hide files and directories where the path matches one of the / delimited vetoed names. The veto string must always be terminated with a /, e.g. veto files = veto1/, veto files = veto1/veto2/. ๐Ÿซฃ
  • volume uuid = UUID (V) โ€” Specify a custom UUID for the volume. The UUID must be in the standard format, e.g. 550E8400-E29B-41D4-A716-446655440000. If not specified, a random UUID is generated for the volume at startup and saved in the file afp_voluuid.conf in the shared state directory.

In most circumstances, you should not need to set this option, but rather let netatalk manage it for you. One reason to set it manually is when you want to run afpd as a non-privileged user who does not have write access to the shared state directory.

๐ŸŽ€ Volume options ๐ŸŽ€

Boolean volume options, babes. Every single one of them.

  • acls = BOOLEAN (default: yes) (V) โ€” Whether to flag volumes as supporting ACLs. If ACL support is compiled in, this is yes by default.
  • case sensitive = BOOLEAN (default: yes) (V) โ€” Whether to advertise volumes as supporting case-sensitive filenames. If the host filesystem is case-insensitive, set to no.
  • cnid dev = BOOLEAN (default: yes) (V) โ€” Whether to store the unique device number for each file or directory in the CNID backend. This is used to detect when a file is moved across devices, which allows Netatalk to update the CNID database accordingly.

When using this option, make sure that the device number of the volume is consistent across reboots, which can be achieved by using persistent device naming (e.g. by UUID) in /etc/fstab or equivalent. Otherwise, the CNID database will get constantly rebuilt on every reboot, which is not ideal. ๐Ÿ˜ญ

  • convert appledouble = BOOLEAN (default: no) (V) โ€” Perform automatic conversion of AppleDouble v2 metadata files to filesystem Extended Attributes dynamically when accessing filesystems from clients.

This is useful when upgrading from Netatalk v2 to a later version, but incurs a small performance cost for every filesystem access. If you run dbd(1) on the volumes to convert after upgrading Netatalk, you don't need to enable this option, as the conversion is done by dbd(1) and not on the fly.

  • delete veto files = BOOLEAN (default: no) (V) โ€” This option is used when Netatalk is attempting to delete a directory that contains one or more vetoed files or directories (see the veto files option). If this option is set to no (the default) then if a directory contains any non-vetoed files or directories then the directory delete will fail. This is usually what you want.

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) โ€” The default setting is false, thus symlinks are not followed on the server. This is the same behaviour as Mac OS X's AFP server. Setting the option to true causes afpd to follow symlinks on the server.

When a client creates a symlink via AFP, the target is validated: absolute paths, paths containing .. components, relative paths that resolve outside the volume root, and targets on a different filesystem device than the volume are rejected.

NOTE: This option is security-sensitive, and should only be enabled if you understand the security implications of allowing clients to follow symlinks on the server. ๐Ÿ”ฅ
  • invisible dots = BOOLEAN (default: no) (V) โ€” Make dot files invisible.
WARNING: Enabling this option will lead to unwanted side effects where OS X applications, when saving files to a temporary file starting with a dot first, then renaming the temp file to its final name, result in the saved file being invisible. The only thing this option is useful for is making files that start with a dot invisible on Mac OS 9. It's completely useless on Mac OS X, as both in Finder and in Terminal files starting with a dot are hidden anyway. ๐Ÿ’€
  • network ids = BOOLEAN (default: yes) (V) โ€” Whether the server support network ids. Setting this to no will result in the client not using ACL AFP functions.
  • preexec close = BOOLEAN (default: no) (V) โ€” A non-zero return code from preexec close the volume being immediately, preventing clients to mount/see the volume in question.
  • read only = BOOLEAN (default: no) (V) โ€” Specifies the share as being read only for all users. Forces ea = sys.
  • stat vol = BOOLEAN (default: yes) (V) โ€” Whether to stat volume path when enumerating volumes list, useful for automounting or volumes created by a preexec script.
  • time machine = BOOLEAN (default: no) (V) โ€” Whether to enable Time Machine support for this volume.
  • unix priv = BOOLEAN (default: yes) (V) โ€” Whether to use AFP3 UNIX privileges. This should be set for OS X clients. See also: file perm, directory perm, and umask.

๐Ÿ’– EXAMPLES ๐Ÿ’–

bestie get comfy, here come the glow-up configs that actually do stuff โœจ

๐ŸŽ Example: Modern Mac clients โœจ

This one turns on Spotlight and AFP stats โ€” but only if Netatalk was built with Spotlight and AFP stats support, so check that first, no cap ๐Ÿ”. The mimic model option is what makes the server cosplay as an Xserve ๐Ÿ’….

Oh and the home directory gets mounted on /home/{user}/afp-data ๐Ÿ .

[Global]
afpstats = yes
afpstats group = netatalk
spotlight = yes
mimic model = RackMac

[Home]
basedir regex = /home
path = afp-data

๐Ÿง“ Example: Classic Mac clients ๐ŸŒˆ

This one enables AppleTalk โ€” again, only if Netatalk was built with AppleTalk support, okay? ๐Ÿซถ The Random Number and ClearTxt authentication modules are the ones doing the work here, since they're what keeps the old-school Mac clients able to log in. And legacy icon is the option giving the volume a cute custom icon moment when it's mounted on Classic Mac OS clients ๐ŸŽ€.

Now listen: with legacy volume size, the reported volume size gets limited to 2 GB for those very very old Macs. Meanwhile prodos is doing two things at once โ€” it enables Apple II ProDOS boot flags on the volume, and limits the reported free space on the volume to 32 MB. Double duty, iconic ๐Ÿ‘‘.

[Global]
appletalk = yes
uam list = uams_dhx.so uams_dhx2.so uams_randnum.so uams_clrtxt.so
legacy icon = daemon

[mac]
volume name = Mac Files
path = /srv/mac
legacy volume size = yes

[apple2]
volume name = Apple II Files
path = /srv/apple2
prodos = yes

๐Ÿ‘€ SEE ALSO ๐Ÿ‘€


๐Ÿซถ AUTHOR ๐Ÿซถ

Contributors to the Netatalk Project (https://netatalk.io/contributors) โ€” yeah, it's a whole crew, and they ate ๐Ÿ’…


okay that's literally the whole page, you made it to the end bestie, I'm so proud of you ๐Ÿ˜ญ๐Ÿ’– this was Netatalk 4.5.1, stamped with the date 2025-vibes in the AFP.CONF(5) footer, so if you're reading this on some other version just know the source line said Netatalk 4.5.1 and the manpage is filed under AFP.CONF(5). go forth and configure, queen ๐Ÿ‘‘โœจ

๐Ÿ“ฆ where this page comes from