1 <?xml version="1.0" encoding="UTF-8"?>
2 <chapter id="configuration">
3 <title>Setting up Netatalk</title>
6 <title>File Services<indexterm>
7 <primary>File Services</primary>
9 <secondary>Netatalk's File Services</secondary>
12 <para>Netatalk supplies AFP<indexterm>
13 <primary>AFP</primary>
15 <secondary>Apple Filing Protocol</secondary>
16 </indexterm> services.</para>
19 <title>Setting up the AFP file server</title>
21 <para>AFP (the Apple Filing Protocol) is the protocol Apple Macintoshes
22 use for file services. The protocol has evolved over the years. The
23 latest changes to the protocol, called "AFP 3.3", were added with the
24 release of Snow Leopard<indexterm>
25 <primary>Snow Leopard</primary>
27 <secondary>Mac OS X 10.6</secondary>
28 </indexterm> (Mac OS X 10.6).</para>
30 <para>The afpd daemon offers the fileservices to Apple clients. The only
31 configuration file is <filename>afp.conf</filename>. It uses a ini style
32 configuration syntax.</para>
34 <para>Support for <link linkend="spotlight">Spotlight</link><indexterm>
35 <primary>Spotlight</primary>
36 </indexterm> has been added in Netatalk 3.1. See this <link
37 linkend="spotlight-compile">section</link> for information on how to
38 compile Netatalk with Spotlight support.</para>
40 <para>Mac OS X 10.5 (Leopard) added support for Time Machine backups
41 over AFP. Two new functions ensure that backups are written to spinning
42 disk, not just in the server's cache. Different host operating systems
43 honour this cache flushing differently. To make a volume a Time Machine
44 target use the volume option "<option>time machine =
47 <para>Starting with Netatalk 2.1 UNIX symlinks<indexterm>
48 <primary>symlink</primary>
50 <secondary>UNIX symlink</secondary>
51 </indexterm> can be used on the server. Semantics are the same as for
52 eg NFS, ie they are not resolved on the server side but instead it's
53 completely up to the client to resolve them, resulting in links that
54 point somewhere inside the clients filesystem view.</para>
57 <title>afp.conf</title>
59 <para><filename>afp.conf</filename> is the configuration file used by
60 afpd to determine the behaviour and configuration of the AFP file
61 serverand the AFP volume that it provides.</para>
63 <para>The <filename>afp.conf</filename> is divided into several
64 sections:<variablelist>
69 <para>The global section defines general server options</para>
77 <para>The homes section defines user home volumes</para>
80 </variablelist>Any section not called <option>Global</option> or
81 <option>Homes</option> is interpreted as an AFP volume.</para>
83 <para>For sharing user homes by defining a <option>Homes</option>
84 section you must specify the option <option>basedir regex</option>
85 which can be a simple string with the path to the parent directory of
86 all user homes or a regular expression.</para>
90 <para><programlisting>[Homes]
92 </programlisting></para>
94 <para>Now any user logging into the AFP server will have a user volume
95 available whos path is <filename>/home/NAME</filename>.</para>
97 <para>A more complex setup would be a server with a large amount of
98 user homes which are split across eg two different
99 filesystems:<itemizedlist>
101 <para>/RAID1/homes</para>
105 <para>/RAID2/morehomes</para>
107 </itemizedlist>The following configuration is
108 required:<programlisting>[Homes]
109 basedir regex = /RAID./.*homes
110 </programlisting></para>
112 <para>If <option>basedir regex</option> contains symlink, set the
113 canonicalized absolute path. When <filename>/home</filename> links to
114 <filename>/usr/home</filename>: <programlisting>[Homes]
115 basedir regex = /usr/home</programlisting></para>
117 <para>For a more detailed explanation of the available options, please
118 refer to the <citerefentry>
119 <refentrytitle>afp.conf</refentrytitle>
121 <manvolnum>5</manvolnum>
122 </citerefentry> man page.</para>
126 <sect2 id="CNID-backends">
127 <title>CNID<indexterm>
128 <primary>CNID</primary>
130 <secondary>Catalog Node ID</secondary>
131 </indexterm> backends<indexterm>
132 <primary>Backend</primary>
134 <secondary>CNID backend</secondary>
137 <para>Unlike other protocols like SMB or NFS, the AFP protocol mostly
138 refers to files and directories by ID and not by a path (the IDs are
139 also called CNID, that means Catalog Node ID). A typical AFP request
140 uses a directory ID<indexterm>
141 <primary>DID</primary>
143 <secondary>Directory ID</secondary>
144 </indexterm> and a filename, something like <phrase>"server, please
145 open the file named 'Test' in the directory with id 167"</phrase>. For
146 example "Aliases" on the Mac basically work by ID (with a fallback to
147 the absolute path in more recent AFP clients. But this applies only to
148 Finder, not to applications).</para>
150 <para>Every file in an AFP volume has to have a unique file ID<indexterm>
151 <primary>FID</primary>
153 <secondary>File ID</secondary>
154 </indexterm>, IDs must, according to the specs, never be reused, and
155 IDs are 32 bit numbers (Directory IDs use the same ID pool). So, after
156 ~4 billion files/folders have been written to an AFP volume, the ID pool
157 is depleted and no new file can be written to the volume. No whining
160 <para>Netatalk needs to map IDs to files and folders in the host
161 filesystem. To achieve this, several different CNID backends<indexterm>
162 <primary>CNID backend</primary>
163 </indexterm> are available and can be choosed by the <option>cnid
164 scheme</option><indexterm>
165 <primary>cnidscheme</primary>
167 <secondary>specifying a CNID backend</secondary>
168 </indexterm> option in the <citerefentry>
169 <refentrytitle>afp.conf</refentrytitle>
171 <manvolnum>5</manvolnum>
172 </citerefentry> configuration file. A CNID backend is basically a
173 database storing ID <-> name mappings.</para>
175 <para>The CNID Databases are by default located in
176 <filename>/var/netatalk/CNID</filename>.</para>
178 <para>There is a command line utility called <command>dbd</command>
179 available which can be used to verify, repair and rebuild the CNID
183 <para>There are some CNID related things you should keep in mind when
184 working with netatalk:</para>
188 <para>Don't nest volumes<indexterm>
189 <primary>Nested volumes</primary>
194 <para>CNID backends are databases, so they turn afpd into a file
195 server/database mix.</para>
199 <para>If there's no more space on the filesystem left, the
200 database will get corrupted. You can work around this by either
201 using the <option>vol dbpath</option> option and put the database
202 files into another location or, if you use quotas, make sure the
203 CNID database folder is owned by a user/group without a
205 <primary>Quotas</primary>
207 <secondary>Disk usage quotas</secondary>
212 <para>Be careful with CNID databases for volumes that are mounted
213 via NFS. That is a pretty audacious decision to make anyway, but
214 putting a database there as well is really asking for trouble,
215 i.e. database corruption. Use the <option>vol dbpath</option>
216 directive to put the databases onto a local disk if you must use
218 <primary>NFS</primary>
220 <secondary>Network File System</secondary>
221 </indexterm> mounted volumes.</para>
227 <title>cdb<indexterm>
228 <primary>CDB</primary>
230 <secondary>"cdb" CNID backend</secondary>
233 <para>The "concurrent database" backend is based on Berkeley DB. With
234 this backend, several afpd daemons access the CNID database directly.
235 Berkeley DB locking is used to synchronize access, if more than one
236 afpd process is active for a volume. The drawback is, that the crash
237 of a single afpd process might corrupt the database. cdb should only
238 be used when sharing home directories for a larger number of users
239 <emphasis>and</emphasis> it has been determined that a large number of
240 <command>cnid_dbd</command> processes is problematic.</para>
244 <title>dbd<indexterm>
245 <primary>DBD</primary>
247 <secondary>"dbd" CNID backend</secondary>
250 <para>Access to the CNID database is restricted to the cnid_dbd daemon
251 process. afpd processes communicate with the daemon for database reads
252 and updates. The probability for database corruption is practically
255 <para>This is the default backend since Netatalk 2.1.</para>
259 <title>tdb<indexterm>
260 <primary>tdb</primary>
262 <secondary>"tdb" CNID backend</secondary>
265 <para><abbrev>tdb</abbrev> is another persistent CNID database, it's
266 Samba's <emphasis>Trivial Database</emphasis>. It could be used
267 instead of <abbrev>cdb</abbrev> for user volumes.<important>
268 <para>Only ever use it for volumes that are
269 <emphasis>not</emphasis> shared and accessed by multiple clients
271 </important>This backend is also used internally (as in-memory CNID
272 database) as a fallback in case opening the primary database can't be
273 opened, because <abbrev>tdb</abbrev> can work as in-memory database.
274 This of course means upon restart the CNIDs are gone.</para>
278 <title>last<indexterm>
279 <primary>Last</primary>
281 <secondary>"last" CNID backend</secondary>
284 <para>The last backend is a in-memory tdb database. It is not
285 persistent. Starting with netatalk 3.0, it becomes the <emphasis> read
286 only mode</emphasis> automatically. This is useful e.g. for
291 <title>mysql<indexterm>
292 <primary>MySQL</primary>
294 <secondary>"mysql" CNID backend</secondary>
297 <para>CNID backend using a MySQL server.</para>
301 <sect2 id="charsets">
302 <title>Charsets<indexterm>
303 <primary>Charset</primary>
305 <secondary>character set</secondary>
306 </indexterm>/Unicode<indexterm>
307 <primary>Unicode</primary>
313 <title>Why Unicode?</title>
315 <para>Internally, computers don't know anything about characters and
316 texts, they only know numbers. Therefore, each letter is assigned a
317 number. A character set, often referred to as
318 <emphasis>charset</emphasis> or
319 <emphasis>codepage</emphasis><indexterm>
320 <primary>Codepage</primary>
321 </indexterm>, defines the mappings between numbers and
324 <para>If two or more computer systems need to communicate with each
325 other, the have to use the same character set. In the 1960s the
327 <primary>ASCII</primary>
329 <secondary>American Standard Code for Information
330 Interchange</secondary>
331 </indexterm> (American Standard Code for Information Interchange)
332 character set was defined by the American Standards Association. The
333 original form of ASCII represented 128 characters, more than enough to
334 cover the English alphabet and numerals. Up to date, ASCII has been
335 the normative character scheme used by computers.</para>
337 <para>Later versions defined 256 characters to produce a more
338 international fluency and to include some slightly esoteric graphical
339 characters. Using this mode of encoding each character takes exactly
340 one byte. Obviously, 256 characters still wasn't enough to map all the
341 characters used in the various languages into one character
344 <para>As a result localized character sets were defined later, e.g the
345 ISO-8859 character sets. Most operating system vendors introduced
346 their own characters sets to satisfy their needs, e.g. IBM defined the
347 <emphasis>codepage 437 (DOSLatinUS)</emphasis>, Apple introduced the
348 <emphasis>MacRoman</emphasis><indexterm>
349 <primary>MacRoman</primary>
351 <secondary>MacRoman charset</secondary>
352 </indexterm> codepage and so on. The characters that were assigned
353 number larger than 127 were referred to as
354 <emphasis>extended</emphasis> characters. These character sets
355 conflict with another, as they use the same number for different
356 characters, or vice versa.</para>
358 <para>Almost all of those characters sets defined 256 characters,
359 where the first 128 (0-127) character mappings are identical to ASCII.
360 As a result, communication between systems using different codepages
361 was effectively limited to the ASCII charset.</para>
363 <para>To solve this problem new, larger character sets were defined.
364 To make room for more character mappings, these character sets use at
365 least 2 bytes to store a character. They are therefore referred to as
366 <emphasis>multibyte</emphasis> character sets.</para>
368 <para>One standardized multibyte charset encoding scheme is known as
369 <ulink url="http://www.unicode.org/">unicode</ulink>. A big advantage
370 of using a multibyte charset is that you only need one. There is no
371 need to make sure two computers use the same charset when they are
372 communicating.</para>
376 <title>character sets used by Apple</title>
378 <para>In the past, Apple clients used single-byte charsets to
379 communicate over the network. Over the years Apple defined a number of
380 codepages, western users will most likely be using the
381 <emphasis>MacRoman</emphasis> codepage.</para>
383 <para>Codepages defined by Apple include:</para>
387 <para>MacArabic, MacFarsi</para>
391 <para>MacCentralEurope</para>
395 <para>MacChineseSimple</para>
399 <para>MacChineseTraditional</para>
403 <para>MacCroation</para>
407 <para>MacCyrillic</para>
411 <para>MacDevanagari</para>
415 <para>MacGreek</para>
419 <para>MacHebrew</para>
423 <para>MacIcelandic</para>
427 <para>MacJapanese</para>
431 <para>MacKorean</para>
435 <para>MacRoman</para>
439 <para>MacRomanian</para>
447 <para>MacTurkish</para>
451 <para>Starting with Mac OS X and AFP3, <ulink
452 url="http://www.utf-8.com/">UTF-8</ulink> is used. UTF-8 encodes
453 Unicode characters in an ASCII compatible way, each Unicode character
454 is encoded into 1-6 ASCII characters. UTF-8 is therefore not really a
455 charset itself, it's an encoding of the Unicode charset.</para>
457 <para>To complicate things, Unicode defines several <emphasis> <ulink
458 url="http://www.unicode.org/reports/tr15/index.html">normalization</ulink>
459 </emphasis> forms. While <ulink
460 url="http://www.samba.org">samba</ulink><indexterm>
461 <primary>Samba</primary>
462 </indexterm> uses <emphasis>precomposed</emphasis><indexterm>
463 <primary>Precomposed</primary>
465 <secondary>Precomposed Unicode normalization</secondary>
466 </indexterm> Unicode, which most Unix tools prefer as well, Apple
467 decided to use the <emphasis>decomposed</emphasis><indexterm>
468 <primary>Decomposed</primary>
470 <secondary>Decomposed Unicode normalization</secondary>
471 </indexterm> normalization.</para>
473 <para>For example lets take the German character
474 '<keycode>ä</keycode>'. Using the precomposed normalization, Unicode
475 maps this character to 0xE4. In decomposed normalization, 'ä' is
476 actually mapped to two characters, 0x61 and 0x308. 0x61 is the mapping
477 for an 'a', 0x308 is the mapping for a <emphasis>COMBINING
478 DIAERESIS</emphasis>.</para>
480 <para>Netatalk refers to precomposed UTF-8 as
481 <emphasis>UTF8</emphasis><indexterm>
482 <primary>UTF8</primary>
484 <secondary>Netatalk's precomposed UTF-8 encoding</secondary>
485 </indexterm> and to decomposed UTF-8 as
486 <emphasis>UTF8-MAC</emphasis><indexterm>
487 <primary>UTF8-MAC</primary>
489 <secondary>Netatalk's decomposed UTF-8 encoding</secondary>
494 <title>afpd and character sets</title>
496 <para>To support new AFP 3.x and older AFP 2.x clients at the same
497 time, afpd needs to be able to convert between the various charsets
498 used. AFP 3.x clients always use UTF8-MAC, AFP 2.x clients use one of
499 the Apple codepages.</para>
501 <para>At the time of this writing, netatalk supports the following
502 Apple codepages:</para>
506 <para>MAC_CENTRALEUROPE</para>
510 <para>MAC_CHINESE_SIMP</para>
514 <para>MAC_CHINESE_TRAD</para>
518 <para>MAC_CYRILLIC</para>
522 <para>MAC_GREEK</para>
526 <para>MAC_HEBREW</para>
530 <para>MAC_JAPANESE</para>
534 <para>MAC_KOREAN</para>
538 <para>MAC_ROMAN</para>
542 <para>MAC_TURKISH</para>
546 <para>afpd handles three different character set options:</para>
550 <term>unix charset<indexterm>
551 <primary>unix charset</primary>
553 <secondary>afpd's unix charset setting</secondary>
557 <para>This is the codepage used internally by your operating
558 system. If not specified, it defaults to <option>UTF8</option>.
559 If <option>LOCALE</option> is specified and your system support
560 Unix locales, afpd tries to detect the codepage. afpd uses this
561 codepage to read its configuration files, so you can use
562 extended characters for volume names, login messages, etc. see
564 <refentrytitle>afp.conf</refentrytitle>
566 <manvolnum>5</manvolnum>
567 </citerefentry>.</para>
572 <term>mac charset<indexterm>
573 <primary>mac charset</primary>
575 <secondary>afpd's mac charset setting</secondary>
579 <para>As already mentioned, older Mac OS clients (up to AFP 2.2)
580 use codepages to communicate with afpd. However, there is no
581 support for negotiating the codepage used by the client in the
582 AFP protocol. If not specified otherwise, afpd assumes the
583 <emphasis>MacRoman</emphasis> codepage is used. In case you're
584 clients use another codepage, e.g.
585 <emphasis>MacCyrillic</emphasis>, you'll <emphasis
586 role="bold">have</emphasis> to explicitly configure this. see
588 <refentrytitle>afp.conf</refentrytitle>
590 <manvolnum>5</manvolnum>
591 </citerefentry>.</para>
596 <term>vol charset<indexterm>
597 <primary>vol charset</primary>
599 <secondary>afpd's vol charset setting</secondary>
603 <para>This defines the charset afpd should use for filenames on
604 disk. By default, it is the same as <option>unix
605 charset</option>. If you have <ulink
606 url="http://www.gnu.org/software/libiconv/">iconv</ulink><indexterm>
607 <primary>Iconv</primary>
609 <secondary>iconv encoding conversion engine</secondary>
610 </indexterm> installed, you can use any iconv provided charset
613 <para>afpd needs a way to preserve extended macintosh
614 characters, or characters illegal in unix filenames, when saving
615 files on a unix filesystem. Earlier versions used the the so
616 called CAP encoding<indexterm>
617 <primary>CAP encoding</primary>
619 <secondary>CAP style character encoding</secondary>
620 </indexterm>. An extended character (>0x7F) would be
621 converted to a :xx hex sequence, e.g. the Apple Logo (MacRoman:
622 0xF0) was saved as :f0. Some special characters will be
623 converted as to :xx notation as well. '/' will be encoded to
624 :2f, if <option>usedots</option> was not specified, a leading
625 dot '.' will be encoded as :2e.</para>
627 <para>Even though this version now uses <option>UTF8</option> as
628 the default encoding for filenames, '/' will be converted to
629 ':'. For western users another useful setting could be
630 <option>vol charset = ISO-8859-15</option>.</para>
632 <para>If a character cannot be converted from the <option>mac
633 charset</option> to the selected <option>vol charset</option>,
634 afpd will save it as a CAP encoded character. For AFP3 clients,
635 afpd will convert the UTF8 character to <option>mac
636 charset</option> first. If this conversion fails, you'll receive
637 a -50 error on the mac. <emphasis>Note</emphasis>: Whenever you
638 can, please stick with the default UTF8 volume format. see
640 <refentrytitle>afp.conf</refentrytitle>
642 <manvolnum>5</manvolnum>
643 </citerefentry>.</para>
650 <sect2 id="authentication">
651 <title>Authentication<indexterm>
652 <primary>Authentication</primary>
654 <secondary>between AFP client and server</secondary>
658 <title>AFP authentication basics</title>
660 <para>Apple chose a flexible model called "User Authentication
662 <primary>UAM</primary>
664 <secondary>User Authentication Module</secondary>
665 </indexterm> (UAMs) for authentication purposes between AFP client
666 and server. An AFP client initially connecting to an AFP server will
667 ask for the list of UAMs which the server provides, and will choose
668 the one with strongest encryption that the client supports.</para>
670 <para>Several UAMs have been developed by Apple over the time, some by
671 3rd-party developers.</para>
675 <title>UAMs supported by Netatalk</title>
677 <para>Netatalk supports the following ones by default:</para>
681 <para>"No User Authent"<indexterm>
682 <primary>No User Authent</primary>
684 <secondary>"No User Authent" UAM (guest access)</secondary>
685 </indexterm> UAM (guest access without authentication)</para>
689 <para>"Cleartxt Passwrd"<indexterm>
690 <primary>Cleartxt Passwrd</primary>
692 <secondary>"Cleartxt Passwrd" UAM</secondary>
693 </indexterm> UAM (no password encryption)</para>
697 <para>"Randnum exchange"<indexterm>
698 <primary>Randnum exchange</primary>
700 <secondary>"Randnum exchange" UAM</secondary>
701 </indexterm>/"2-Way Randnum exchange"<indexterm>
702 <primary>2-Way Randnum exchange</primary>
704 <secondary>"2-Way Randnum exchange" UAM</secondary>
705 </indexterm> UAMs (weak password encryption, separate password
710 <para>"DHCAST128"<indexterm>
711 <primary>DHCAST128</primary>
713 <secondary>"DHCAST128" UAM</secondary>
714 </indexterm> UAM (stronger password encryption)</para>
718 <para>"DHX2"<indexterm>
719 <primary>DHX2</primary>
721 <secondary>"DHX2" UAM</secondary>
722 </indexterm> UAM (successor of DHCAST128)</para>
726 <para>There exist other optional UAMs as well:</para>
730 <para>"PGPuam 1.0"<indexterm>
731 <primary>PGPuam 1.0</primary>
733 <secondary>"PGPuam 1.0" UAM</secondary>
734 </indexterm><indexterm>
735 <primary>uams_pgp.so</primary>
737 <secondary>"PGPuam 1.0" UAM</secondary>
738 </indexterm> UAM (PGP-based authentication for pre-Mac OS X
739 clients. You'll also need the <ulink
740 url="http://www.vmeng.com/vinnie/papers/pgpuam.html">PGPuam
741 client</ulink> to let this work)</para>
743 <para>You'll have to add <filename>"--enable-pgp-uam"</filename>
744 to your configure switches to have this UAM available.</para>
748 <para>"Kerberos IV"<indexterm>
749 <primary>Kerberos IV</primary>
751 <secondary>"Kerberos IV" UAM</secondary>
752 </indexterm><indexterm>
753 <primary>uams_krb4.so</primary>
755 <secondary>"Kerberos IV" UAM</secondary>
756 </indexterm>/"AFS Kerberos"<indexterm>
757 <primary>AFS Kerberos</primary>
759 <secondary>"AFS Kerberos" UAM (Kerberos IV)</secondary>
760 </indexterm> UAMs (suitable to use <ulink
761 url="http://web.mit.edu/macdev/KfM/Common/Documentation/faq.html">Kerberos
762 v4 based authentication</ulink> and AFS file servers)</para>
764 <para>Use <filename>"--enable-krb4-uam"</filename> at compile time
765 to activate the build of this UAM.</para>
769 <para>"Client Krb v2"<indexterm>
770 <primary>Client Krb v2</primary>
772 <secondary>"Client Krb v2" UAM (Kerberos V)</secondary>
773 </indexterm> UAM (Kerberos V, suitable for "Single Sign On"
774 Scenarios with OS X clients -- see below)</para>
776 <para><filename>"--enable-krbV-uam"</filename> will provide you
777 with the ability to use this UAM.</para>
781 <para>You can configure which UAMs should be activated by defining
782 "<option>uam list</option>" in <option>Global</option> section.
783 <command>afpd</command> will log which UAMs it's using and if problems
784 occur while activating them in either
785 <filename>netatalk.log</filename> or syslog at startup time.
787 <refentrytitle>asip-status.pl</refentrytitle>
789 <manvolnum>1</manvolnum>
790 </citerefentry> can be used to query the available UAMs of AFP
791 servers as well.</para>
793 <para>Having a specific UAM available at the server does not
794 automatically mean that a client can use it. Client-side support is
795 also necessary. For older Macintoshes running Mac OS < X DHCAST128
796 support exists since AppleShare client 3.8.x.</para>
798 <para>On OS X, there exist some client-side techniques to make the
799 AFP-client more verbose, so one can have a look what's happening while
800 negotiating the UAMs to use. Compare with this <ulink
801 url="http://article.gmane.org/gmane.network.netatalk.devel/7383/">hint</ulink>.</para>
805 <title>Which UAMs to activate?</title>
807 <para>It depends primarily on your needs and on the kind of Mac OS
808 versions you have to support. Basically one should try to use
809 DHCAST128 and DHX2 where possible because of its strength of password
814 <para>Unless you really have to supply guest access to your
815 server's volumes ensure that you disable "No User Authent" since
816 it might lead accidentally to unauthorized access. In case you
817 must enable guest access take care that you enforce this on a per
818 volume base using the access controls.</para>
822 <para>The "ClearTxt Passwrd" UAM is as bad as it sounds since
823 passwords go unencrypted over the wire. Try to avoid it at both
824 the server's side as well as on the client's. Note: If you want to
825 provide Mac OS 8/9 clients with NetBoot-services then you need
826 uams_cleartext.so since the AFP-client integrated into the Mac's
827 firmware can only deal with this basic form of
828 authentication.</para>
832 <para>Since "Randnum exchange"/"2-Way Randnum exchange" uses only
833 56 bit DES for encryption it should be avoided as well. Another
834 disadvantage is the fact that the passwords have to be stored in
835 cleartext on the server and that it doesn't integrate into both
836 PAM scenarios or classic /etc/shadow (you have to administrate
837 passwords separately by using the <citerefentry>
838 <refentrytitle>afppasswd</refentrytitle>
840 <manvolnum>1</manvolnum>
841 </citerefentry> utility, if clients should use these
846 <para>"DHCAST128" or "DHX2" should be a good compromise for most
847 people since it combines stronger encryption with PAM
852 <para>Using the Kerberos V<indexterm>
853 <primary>Kerberos V</primary>
855 <secondary>"Client Krb v2" UAM</secondary>
856 </indexterm> ("Client Krb v2") UAM, it's possible to implement
857 real single sign on scenarios using Kerberos tickets. The password
858 is not sent over the network. Instead, the user password is used
859 to decrypt a service ticket for the appleshare server. The service
860 ticket contains an encryption key for the client and some
861 encrypted data (which only the appleshare server can decrypt). The
862 encrypted portion of the service ticket is sent to the server and
863 used to authenticate the user. Because of the way that the afpd
864 service principal detection is implemented, this authentication
865 method is vulnerable to man-in-the-middle attacks.</para>
869 <para>For a more detailed overview over the technical implications of
870 the different UAMs, please have a look at Apple's <ulink
871 url="http://developer.apple.com/library/mac/#documentation/Networking/Conceptual/AFP/AFPSecurity/AFPSecurity.html#//apple_ref/doc/uid/TP40000854-CH232-SW1">File
872 Server Security</ulink> pages.</para>
876 <title>Using different authentication sources with specific
879 <para>Some UAMs provide the ability to use different authentication
880 "backends", namely <filename>uams_cleartext.so</filename>,
881 <filename>uams_dhx.so</filename> and
882 <filename>uams_dhx2.so</filename>. They can use either classic Unix
883 passwords from <filename>/etc/passwd</filename>
884 (<filename>/etc/shadow</filename>) or PAM if the system supports that.
885 <filename>uams_cleartext.so</filename> can be symlinked to either
886 <filename>uams_passwd.so</filename> or
887 <filename>uams_pam.so</filename>, <filename>uams_dhx.so</filename> to
888 <filename>uams_dhx_passwd.so</filename> or
889 <filename>uams_dhx_pam.so</filename> and
890 <filename>uams_dhx2.so</filename> to
891 <filename>uams_dhx2_passwd.so</filename> or
892 <filename>uams_dhx2_pam.so</filename>.</para>
894 <para>So, if it looks like this in Netatalk's UAMs folder (per default
895 <filename>/etc/netatalk/uams/</filename>):<programlisting>uams_clrtxt.so -> uams_pam.so
896 uams_dhx.so -> uams_dhx_pam.so
897 uams_dhx2.so -> uams_dhx2_pam.so</programlisting> then you're using PAM,
898 otherwise classic Unix passwords. The main advantage of using PAM is
899 that one can integrate Netatalk in centralized authentication
900 scenarios, eg. via LDAP, NIS and the like. Please always keep in mind
901 that the protection of your user's login credentials in such scenarios
902 also depends on the strength of encryption that the UAM in question
903 supplies. So think about eliminating weak UAMs like "ClearTxt Passwrd"
904 and "Randnum exchange" completely from your network.</para>
908 <title>Netatalk UAM overview table</title>
910 <para>A small overview of the most common used UAMs.</para>
912 <table orient="land">
913 <title>Netatalk UAM overview</title>
915 <tgroup align="center" cols="7">
916 <colspec colname="col1" colnum="1" colwidth="0.5*" />
918 <colspec colname="uam_guest" colnum="2" colwidth="1*" />
920 <colspec colname="uam_clrtxt" colnum="3" colwidth="1*" />
922 <colspec colname="uam_randnum" colnum="4" colwidth="1*" />
924 <colspec colname="uam_dhx" colnum="5" colwidth="1*" />
926 <colspec colname="uam_dhx2" colnum="6" colwidth="1*" />
928 <colspec colname="uam_gss" colnum="7" colwidth="1*" />
932 <entry align="center" rotate="0" valign="middle">UAM</entry>
934 <entry>No User Authent<indexterm>
935 <primary>uams_guest.so</primary>
937 <secondary>"No User Authent" UAM (guest
941 <entry>Cleartxt Passwrd<indexterm>
942 <primary>uams_cleartxt.so</primary>
944 <secondary>"Cleartxt Passwrd" UAM</secondary>
947 <entry>(2-Way) Randnum exchange<indexterm>
948 <primary>uams_randnum.so</primary>
950 <secondary>"(2-Way) Randnum exchange" UAM</secondary>
953 <entry>DHCAST128<indexterm>
954 <primary>uams_dhx.so</primary>
956 <secondary>"DHCAST128" UAM</secondary>
959 <entry>DHX2<indexterm>
960 <primary>uams_dhx2.so</primary>
962 <secondary>"DHX2" UAM</secondary>
965 <entry>Client Krb v2<indexterm>
966 <primary>uams_gss.so</primary>
968 <secondary>"Client Krb v2" UAM (Kerberos V)</secondary>
973 <entry align="center" rotate="0" valign="middle">pssword
976 <entry>guest access</entry>
978 <entry>max. 8 characters</entry>
980 <entry>max. 8 characters</entry>
982 <entry>max. 64 characters</entry>
984 <entry>max. 256 characters</entry>
986 <entry>Kerberos tickets</entry>
990 <entry align="center" rotate="0" valign="middle">Client
993 <entry>built-in into all Mac OS versions</entry>
995 <entry>built-in in all Mac OS versions except 10.0. Has to be
996 activated explicitly in recent Mac OS X versions</entry>
998 <entry>built-in into almost all Mac OS versions</entry>
1000 <entry>built-in since AppleShare client 3.8.4, available as a
1001 plug-in for 3.8.3, integrated in Mac OS X' AFP client</entry>
1003 <entry>built-in since Mac OS X 10.2</entry>
1005 <entry>built-in since Mac OS X 10.2</entry>
1009 <entry align="center" rotate="0"
1010 valign="middle">Encryption</entry>
1012 <entry>Enables guest access without authentication between
1013 client and server.</entry>
1015 <entry>Password will be sent in cleartext over the wire. Just
1016 as bad as it sounds, therefore avoid at all if possible (note:
1017 providing NetBoot services requires the ClearTxt UAM)</entry>
1019 <entry>8-byte random numbers are sent over the wire,
1020 comparable with DES, 56 bits. Vulnerable to offline dictionary
1021 attack. Requires passwords in clear on the server.</entry>
1023 <entry>Password will be encrypted with 128 bit SSL, user will
1024 be authenticated against the server but not vice versa.
1025 Therefor weak against man-in-the-middle attacks.</entry>
1027 <entry>Password will be encrypted using libgcrypt with CAST
1028 128 in CBC mode. User will be authenticated against the server
1029 but not vice versa. Therefor weak against man-in-the-middle
1032 <entry>Password is not sent over the network. Due to the
1033 service principal detection method, this authentication method
1034 is vulnerable to man-in-the-middle attacks.</entry>
1038 <entry align="center" rotate="0" valign="middle">Server
1041 <entry align="center" valign="middle">uams_guest.so</entry>
1043 <entry align="center" valign="middle">uams_cleartxt.so</entry>
1045 <entry align="center" valign="middle">uams_randnum.so</entry>
1047 <entry align="center" valign="middle">uams_dhx.so</entry>
1049 <entry align="center" valign="middle">uams_dhx2.so</entry>
1051 <entry align="center" valign="middle">uams_gss.so</entry>
1055 <entry align="center" rotate="0" valign="middle">Password
1056 storage method</entry>
1058 <entry align="center" valign="middle">None</entry>
1060 <entry align="center" valign="middle">Either /etc/passwd
1061 (/etc/shadow) or PAM</entry>
1063 <entry align="center" valign="middle">Passwords stored in
1064 clear text in a separate text file</entry>
1066 <entry align="center" valign="middle">Either /etc/passwd
1067 (/etc/shadow) or PAM</entry>
1069 <entry align="center" valign="middle">Either /etc/passwd
1070 (/etc/shadow) or PAM</entry>
1072 <entry align="center" valign="middle">At the Kerberos Key
1073 Distribution Center*</entry>
1079 <para>* Have a look at this <ulink
1080 url="http://cryptnet.net/fdp/admin/kerby-infra/en/kerby-infra.html">Kerberos
1081 overview</ulink></para>
1084 <sect3 id="sshtunnel">
1085 <title>SSH tunneling</title>
1087 <para>Tunneling and all sort of VPN stuff has nothing to do with AFP
1088 authentication and UAMs in general. But since Apple introduced an
1089 option called "Allow Secure Connections Using SSH" and many people
1090 tend to confuse both things, we'll speak about that here too.</para>
1092 <sect4 id="manualsshtunnel">
1093 <title>Manually tunneling an AFP session</title>
1095 <para>This works since the first AFP servers that spoke "AFP over
1096 TCP" appeared in networks. One simply tunnels the remote server's
1097 AFP port to a local port different than 548 and connects locally to
1098 this port afterwards. On OS X this can be done by</para>
1100 <programlisting>ssh -l $USER $SERVER -L 10548:127.0.0.1:548 sleep 3000</programlisting>
1102 <para>After establishing the tunnel one will use
1103 <filename>"afp://127.0.0.1:10548"</filename> in the "Connect to
1104 server" dialog. All AFP traffic including the initial connection
1105 attempts will be sent encrypted over the wire since the local AFP
1106 client will connect to the Mac's local port 10548 which will be
1107 forwarded to the remote server's AFP port (we used the default 548)
1110 <para>These sorts of tunnels are an ideal solution if you've to
1111 access an AFP server providing weak authentications mechanisms
1112 through the Internet without having the ability to use a "real" VPN.
1113 Note that you can let <command>ssh</command> compress the data by
1114 using its "-C" switch and that the tunnel endpoints can be different
1115 from both AFP client and server (compare with the SSH documentation
1116 for details).</para>
1119 <sect4 id="autosshtunnel">
1120 <title>Automatically establishing a tunneled AFP connection</title>
1122 <para>From Mac OS X 10.2 to 10.4, Apple added an "Allow Secure
1123 Connections Using SSH" checkbox to the "Connect to Server" dialog.
1124 The idea behind: When the server signals that it can be contacted by
1125 SSH then Mac OS X' AFP client tries to establish the tunnel and
1126 automagically sends all AFP traffic through it.</para>
1128 <para>But it took until the release of Mac OS X 10.3 that this
1129 feature worked the first time... partly. In case, the SSH tunnel
1130 can't be established the AFP client <emphasis
1131 role="strong">silently</emphasis> fell back to an unencrypted AFP
1132 connection attempt.</para>
1134 <para>Netatalk's afpd will report that it is capable of handling SSH
1135 tunneled AFP requests, when both "<option>advertise ssh</option>"
1136 and "<option>fqdn</option>" options are set in
1137 <option>Global</option> section (double check with <citerefentry>
1138 <refentrytitle>asip-status.pl</refentrytitle>
1140 <manvolnum>1</manvolnum>
1141 </citerefentry> after you restarted afpd when you made changes to
1142 the settings). But there are a couple of reasons why you don't want
1143 to use this option at all:</para>
1147 <para>Tunneling TCP over TCP (as SSH does) is not the best idea.
1148 There exist better solutions like VPNs based on the IP
1153 <para>Since this SSH kludge isn't a normal UAM that integrates
1154 directly into the AFP authentication mechanisms but instead uses
1155 a single flag signalling clients whether they can <emphasis
1156 role="strong">try</emphasis> to establish a tunnel or not, it
1157 makes life harder to see what's happening when things go
1162 <para>You cannot control which machines are logged on by
1163 Netatalk tools like a <command>macusers</command> since all
1164 connection attempts seem to be made from localhost.</para>
1168 <para>On the other side you've to limit access to afpd to
1169 localhost only (TCP wrappers) when you want to ensure that all
1170 AFP sessions are SSH encrypted or...</para>
1174 <para>...when you're using 10.2 - 10.3.3 then you get the
1175 opposite of what you'd expect: potentially unencrypted AFP
1176 communication (including logon credentials) on the network
1177 without a single notification that establishing the tunnel
1178 failed. Apple fixed that not until Mac OS X 10.3.4.</para>
1182 <para>Encrypting all AFP sessions via SSH can lead to a
1183 significantly higher load on the Netatalk server</para>
1191 <title>ACL Support<indexterm>
1192 <primary>ACLs</primary>
1193 </indexterm></title>
1195 <para>ACL support for AFP is implemented for ZFS ACLs on Solaris and
1196 derived platforms and for POSIX 1e ACLs on Linux.</para>
1199 <title>Configuration</title>
1201 <para>For a basic mode of operation there's nothing to configure.
1202 Netatalk reads ACLs on the fly and calculates effective permissions
1203 which are then send to the AFP client via the so called
1205 <primary>UARights</primary>
1206 </indexterm> permission bits. On a Mac, the Finder uses these bits
1207 to adjust permission in Finder windows. For example folder whos UNIX
1208 mode would only result in in read-only permissions for a user will not
1209 be displayed with a read-only icon and the user will be able to write
1210 to the folder given the folder has an ACL giving the user write
1213 <para>By default, the effective permission of the authenticated user
1214 are only mapped to the mentioned UARights<indexterm>
1215 <primary>UARights</primary>
1216 </indexterm>permission structure, not the UNIX mode. You can adjust
1217 this behaviour with the configuration option <link
1218 linkend="map_acls">map acls</link>.</para>
1220 <para>However, neither in Finder "Get Info" windows nor in Terminal
1221 will you be able to see the ACLs, that's a result of how ACLs in OS X
1222 are designed. If you want to be able to display ACLs on the client,
1223 things get more involved as you must then setup both client and server
1224 to be part on a authentication domain (directory service, eg LDAP,
1225 OpenDirectory). The reason is, that in OS X ACLs are bound to UUIDs,
1226 not just uid's or gid's. Therefor afpd must be able to map every
1227 filesystem uid and gid to a UUID so that it can return the server side
1228 ACLs which are bound to UNIX uid and gid mapped to OS X UUIDs.</para>
1230 <para>Netatalk can query a directory server using LDAP queries. Either
1231 the directory server already provides an UUID attribute for user and
1232 groups (Active Directory, Open Directory) or you reuse an unused
1233 attribute (or add a new one) to you directory server (eg
1236 <para>In detail:</para>
1240 <para>For Solaris/ZFS: ZFS Volumes</para>
1242 <para>You should configure a ZFS ACL know for any volume you want
1243 to use with Netatalk:</para>
1245 <screen>aclinherit = passthrough
1246 aclmode = passthrough</screen>
1248 <para>For an explanation of what this knob does and how to apply
1249 it, check your hosts ZFS documentation (eg man zfs).</para>
1253 <para>Authentication Domain</para>
1255 <para>Your server and the clients must be part of a security
1256 association where identity data is coming from a common source.
1257 ACLs in Darwin are based on UUIDs and so is the ACL specification
1258 in AFP 3.2. Therefor your source of identity data has to provide
1259 an attribute for every user and group where a UUID is stored as a
1260 ASCII string. In other words:</para>
1264 <para>you need an Open Directory Server or an LDAP server
1265 where you store UUIDs in some attribute</para>
1269 <para>your clients must be configured to use this
1274 <para>your server should be configured to use this server via
1275 nsswitch and PAM</para>
1279 <para>configure Netatalk via the special <link
1280 linkend="acl_options">LDAP options for ACLs</link> in <link
1281 linkend="afp.conf.5">afp.conf</link> so that Netatalk is able
1282 to retrieve the UUID for users and groups via LDAP search
1291 <title>OS X ACLs</title>
1293 <para>With Access Control Lists (ACLs) Mac OS X offers a powerful
1294 extension of the traditional UNIX permissions model. An ACL is an
1295 ordered list of Access Control Entries (ACEs) explicitly granting or
1296 denying a set of permissions to a given user or group.</para>
1298 <para>Unlike UNIX permissions, which are bound to user or group IDs,
1299 ACLs are tied to UUIDs. For this reason accessing an object's ACL
1300 requires server and client to use a common directory service which
1301 translates between UUIDs and user/group IDs.</para>
1303 <para>ACLs and UNIX permissions interact in a rather simple way. As
1304 ACLs are optional UNIX permissions act as a default mechanism for
1305 access control. Changing an objects's UNIX permissions will leave it's
1306 ACL intact and modifying an ACL will never change the object's UNIX
1307 permissions. While doing access checks, OS X first examines an
1308 object's ACL evaluating ACEs in order until all requested rights have
1309 been granted, a requested right has been explicitly denied by an ACE
1310 or the end of the list has been reached. In case there is no ACL or
1311 the permissions granted by the ACL are not sufficient to fulfill the
1312 request, OS X next evaluates the object's UNIX permissions. Therefore
1313 ACLs always have precedence over UNIX permissions.</para>
1317 <title>ZFS ACLs</title>
1319 <para>ZFS ACLs closely match OS X ACLs. Both offer mostly identical
1320 fine grained permissions and inheritance settings.</para>
1324 <title>POSIX ACLs</title>
1327 <title>Overview</title>
1329 <para>Compared to OS X or NFSv4 ACLs, Posix ACLs represent a
1330 different, less versatile approach to overcome the limitations of
1331 the traditional UNIX permissions. Implementations are based on the
1332 withdrawn Posix 1003.1e standard.</para>
1334 <para>The standard defines two types of ACLs. Files and directories
1335 can have access ACLs which are consulted for access checks.
1336 Directories can also have default ACLs irrelevant to access checks.
1337 When a new object is created inside a directory with a default ACL,
1338 the default ACL is applied to the new object as it's access ACL.
1339 Subdirectories inherit default ACLs from their parent. There are no
1340 further mechanisms of inheritance control.</para>
1342 <para>Architectural differences between Posix ACLs and OS X ACLs
1343 especially involve:</para>
1345 <para><itemizedlist>
1347 <para>No fine-granular permissions model. Like UNIX
1348 permissions Posix ACLs only differentiate between read, write
1349 and execute permissions.</para>
1353 <para>Entries within an ACL are unordered.</para>
1357 <para>Posix ACLs can only grant rights. There is no way to
1358 explicitly deny rights by an entry.</para>
1362 <para>UNIX permissions are integrated into an ACL as special
1365 </itemizedlist></para>
1367 <para>Posix 1003.1e defines 6 different types of ACL entries. The
1368 first three types are used to integrate standard UNIX permissions.
1369 They form a minimal ACL, their presence is mandatory and only one
1370 entry of each type is allowed within an ACL.</para>
1372 <para><itemizedlist>
1374 <para>ACL_USER_OBJ: the owner's access rights.</para>
1378 <para>ACL_GROUP_OBJ: the owning group's access rights.</para>
1382 <para>ACL_OTHER: everybody's access rights.</para>
1384 </itemizedlist></para>
1386 <para>The remaining entry types expand the traditional permissions
1389 <para><itemizedlist>
1391 <para>ACL_USER: grants access rights to a certain user.</para>
1395 <para>ACL_GROUP: grants access rights to a certain
1400 <para>ACL_MASK: limits the maximum access rights which can be
1401 granted by entries of type ACL_GROUP_OBJ, ACL_USER and
1402 ACL_GROUP. As the name suggests, this entry acts as a mask.
1403 Only one ACL_MASK entry is allowed per ACL. If an ACL contains
1404 ACL_USER or ACL_GROUP entries, an ACL_MASK entry must be
1405 present too, otherwise it is optional.</para>
1407 </itemizedlist></para>
1409 <para>In order to maintain compatibility with applications not aware
1410 of ACLs, Posix 1003.1e changes the semantics of system calls and
1411 utilities which retrieve or manipulate an objects UNIX permissions.
1412 In case an object only has a minimal ACL, the group permissions bits
1413 of the UNIX permissions correspond to the value of the ACL_GROUP_OBJ
1416 <para>However, if the ACL also contains an ACL_MASK entry, the
1417 behavior of those system calls and utilities is different. The group
1418 permissions bits of the UNIX permissions correspond to the value of
1419 the ACL_MASK entry, i. e. calling "chmod g-w" will not only revoke
1420 write access for the group, but for all entities which have been
1421 granted write access by ACL_USER or ACL_GROUP entries.</para>
1425 <title>Mapping POSIX ACLs to OS X ACLs</title>
1427 <para>When a client wants to read an object's ACL, afpd maps it's
1428 Posix ACL onto an equivalent OS X ACL. Writing an object's ACL
1429 requires afpd to map an OS X ACL onto a Posix ACL. Due to
1430 architectural restrictions of Posix ACLs, it is usually impossible
1431 to find an exact mapping so that the result of the mapping process
1432 will be an approximation of the original ACL's semantic.</para>
1434 <para><itemizedlist>
1436 <para>afpd silently discard entries which deny a set of
1437 permissions because they they can't be represented within the
1438 Posix architecture.</para>
1442 <para>As entries within Posix ACLs are unordered, it is
1443 impossible to preserve order.</para>
1447 <para>Inheritance control is subject to severe limitations as
1450 <para>Entries with the only_inherit flag set will only
1451 become part of the directory's default ACL.</para>
1455 <para>Entries with at least one of the flags
1456 file_inherit, directory_inherit or limit_inherit set,
1457 will become part of the directory's access and default
1458 ACL, but the restrictions they impose on inheritance
1459 will be ignored.</para>
1461 </itemizedlist></para>
1465 <para>The lack of a fine-granular permission model on the
1466 Posix side will normally result in an increase of granted
1469 </itemizedlist></para>
1471 <para>As OS X clients aren't aware of the Posix 1003.1e specific
1472 relationship between UNIX permissions and ACL_MASK, afpd does not
1473 expose this feature to the client to avoid compatibility issues and
1474 handles *unix permissions and ACLs the same way as Apple's reference
1475 implementation of AFP does. When an object's UNIX permissions are
1476 requested, afpd calculates proper group rights and returns the
1477 result together with the owner's and everybody's access rights to
1478 the caller via "permissions" and "ua_permissions" members of the
1479 FPUnixPrivs structure (see Apple Filing Protocol Reference, page
1480 181). Changing an object's permissions, afpd always updates
1481 ACL_USER_OBJ, ACL_GROUP_OBJ and ACL_OTHERS. If an ACL_MASK entry is
1482 present too, afpd recalculates it's value so that the new group
1483 rights become effective and existing entries of type ACL_USER or
1484 ACL_GROUP stay intact.</para>
1490 <title>Filesystem Change Events<indexterm>
1491 <primary>FCE</primary>
1492 </indexterm></title>
1494 <para>Netatalk includes a nifty filesystem change event mechanism where
1495 afpd processes notfiy interested listeners about certain filesystem
1496 event by UDP network datagrams.</para>
1498 <para>For the format of the UDP packets and for an example C application
1499 that demonstrates how to use these in a listener, take a look at the
1500 Netatalk sourcefile <filename>bin/misc/fce.c</filename>.</para>
1502 <para>The currently supported FCE events are<itemizedlist>
1504 <para>file modification (fmod)</para>
1508 <para>file deletion (fdel)</para>
1512 <para>directory deletion (ddel)</para>
1516 <para>file creation (fcre)</para>
1520 <para>directory deletion (ddel)</para>
1522 </itemizedlist></para>
1524 <para>For details on the available simple configuration options take a
1525 look at <filename><link
1526 linkend="fceconf">afp.conf</link></filename>.</para>
1531 <title id="spotlight">Spotlight<indexterm>
1532 <primary>Spotlight</primary>
1533 </indexterm></title>
1535 <para>Starting with version 3.1 Netatalk supports Spotlight searching.
1536 Netatalk uses Gnome <ulink url="https://projects.gnome.org/tracker/">Tracker</ulink> as metadata store,
1537 indexer and search engine.</para>
1540 <title>Configuration</title>
1542 <para>You can enable Spotlight and indexing either globally or on a per
1543 volume basis with the <option>spotlight</option> option.</para>
1546 <para>Once Spotlight is enable for a single volume, all other volumes
1547 for which spotlight is disabled won't be searchable at all.</para>
1550 <para>In case the <command>dbus-daemon</command> binary is not installed
1551 at the path <filename>/bin/dbus-daemon</filename>, you must use the
1552 global option <option>dbus daemon</option> to point to the path, eg for
1553 Solaris with Tracker from OpenCSW: <screen>dbus daemon = /opt/csw/bin/dbus-daemon</screen></para>
1557 <title>Limitations and notes</title>
1561 <para>Large filesystems</para>
1563 <para>Tracker on Linux uses the inotify Kernel filesystem change
1564 event API for tracking filesystem changes. On large filesystems this
1565 may be problematic since the inotify API doesn't offer recursive
1566 directory watches but instead requires that for every subdirectoy
1567 watches must be added individually.</para>
1569 <para>On Solaris the FEN file event notification system is used. It
1570 is unkown which limitations and ressource consumption this Solaris
1571 subsystem may have.</para>
1573 <para>We therefor recommend to disable live filesystem monitoring
1574 and let Tracker periodically scan filesystems for changes instead,
1575 see the Tracker configuration options <link
1576 linkend="enable-monitors">enable-monitors</link> and <link
1577 linkend="crawling-interval">crawling-interval</link> below.</para>
1583 <title>Using Tracker commandline tools on the server</title>
1585 <para>Netatalk must be running, commands must be executed as root and
1586 some environent variables must be set up (adjust PREFIX to point to
1587 the base directory Netatalk in installed to):<screen>$ su
1588 # cat .tracker_profile
1590 export XDG_DATA_HOME="$PREFIX/var/netatalk/"
1591 export XDG_CACHE_HOME="$PREFIX/var/netatalk/"
1592 export DBUS_SESSION_BUS_ADDRESS="unix:path=$PREFIX/var/netatalk/spotlight.ipc"
1593 # . .tracker_profile
1597 <para>When using Tracker from OpenCSW you must also update your
1598 PATH:<screen># export PATH=/opt/csw/bin:$PATH</screen></para>
1601 <title>Starting and stopping Tracker</title>
1605 <term>Querying Tracker status</term>
1608 <screen># tracker-control -S</screen>
1613 <term>Stop Tracker</term>
1616 <screen># tracker-control -t</screen>
1621 <term>Start Tracker status</term>
1624 <screen># tracker-control -s</screen>
1631 <title>Reindex directory</title>
1633 <screen># tracker-control -f PATH</screen>
1637 <title>Query Tracker for information about a file or directory</title>
1639 <screen># tracker-info PATH</screen>
1643 <title>Search Tracker</title>
1645 <screen># tracker-search QUERY</screen>
1650 <title>Advanced Tracker command line configuration</title>
1652 <para>Tracker stores its configuration via Gnome dconf backend which can
1653 be modified with the command <command>gsettings</command>.</para>
1655 <para>Gnome dconf settings are per-user settings, so, as Netatalk runs
1656 the Tracker processes as root, the settings are stored in the root user
1657 context and reading or changing these settings must be perfomed as root
1658 and Netatalk must be running (and again the enviroment must be set up
1659 as shown above).</para>
1661 <para><screen># gsettings list-recursively | grep Tracker
1662 org.freedesktop.Tracker.Writeback verbosity 'debug'
1665 <para>The following list describes some important Tracker options and
1666 their default settings.</para>
1670 <term>org.freedesktop.Tracker.Miner.Files
1671 index-recursive-directories</term>
1674 <para>This option controls which directories Tracker will index.
1675 Don't change this option manually as it is automatically set by
1676 Netatalk reflecting the setting of the <option>Spotlight</option>
1677 option of Netatalk volumes.</para>
1682 <term id="enable-monitors">org.freedesktop.Tracker.Miner.Files
1683 enable-monitors <parameter> true</parameter></term>
1686 <para>The value controls whether Tracker watches all configured
1687 paths for modification. Depending on the filesystem modification
1688 backend (FAM on Linux, FEN on Solaris), this feature may not work
1689 as reliable as one might wish, so it may be safer to disable it
1690 and instead rely on periodic crawling of Tracker itself. See aslo
1691 the option <option>crawling-interval </option>.</para>
1696 <term id="crawling-interval">org.freedesktop.Tracker.Miner.Files
1697 crawling-interval <parameter>-1</parameter></term>
1700 <para>Interval in days to check the filesystem is up to date in
1701 the database, maximum is 365, default is -1. -2 = crawling is
1702 disabled entirely, -1 = crawling *may* occur on startup (if not
1703 cleanly shutdown), 0 = crawling is forced</para>
1710 <title>Supported metadata attributes</title>
1712 <para>The following table lists the supported Spotlight metadata
1716 <title>Supported Spotlight metadata attributes</title>
1721 <entry align="center">Description</entry>
1723 <entry align="center">Spotlight Key</entry>
1731 <entry>kMDItemDisplayName, kMDItemFSName</entry>
1735 <entry>Document content (full text search)</entry>
1737 <entry>kMDItemTextContent</entry>
1741 <entry>File type</entry>
1743 <entry>_kMDItemGroupId, kMDItemContentTypeTree</entry>
1747 <entry>File modification date</entry>
1749 <entry>kMDItemFSContentChangeDate,
1750 kMDItemContentModificationDate,
1751 kMDItemAttributeChangeDate</entry>
1755 <entry>Content Creation date</entry>
1757 <entry>kMDItemContentCreationDate</entry>
1761 <entry>The author, or authors, of the contents of the
1764 <entry>kMDItemAuthors, kMDItemCreator</entry>
1768 <entry>The name of the country where the item was
1771 <entry>kMDItemCountry</entry>
1775 <entry>Duration</entry>
1777 <entry>kMDItemDurationSeconds</entry>
1781 <entry>Number of pages</entry>
1783 <entry>kMDItemNumberOfPages</entry>
1787 <entry>Document title</entry>
1789 <entry>kMDItemTitle</entry>
1793 <entry>The width, in pixels, of the contents. For example, the
1794 image width or the video frame width</entry>
1796 <entry>kMDItemPixelWidth</entry>
1800 <entry>The height, in pixels, of the contents. For example, the
1801 image height or the video frame height</entry>
1803 <entry>kMDItemPixelHeight</entry>
1807 <entry>The color space model used by the document
1810 <entry>kMDItemColorSpace</entry>
1814 <entry>The number of bits per sample</entry>
1816 <entry>kMDItemBitsPerSample</entry>
1820 <entry>Focal length of the lens, in millimeters</entry>
1822 <entry>kMDItemFocalLength</entry>
1826 <entry>ISO speed</entry>
1828 <entry>kMDItemISOSpeed</entry>
1832 <entry>Orientation of the document. Possible values are 0
1833 (landscape) and 1 (portrait)</entry>
1835 <entry>kMDItemOrientation</entry>
1839 <entry>Resolution width, in DPI</entry>
1841 <entry>kMDItemResolutionWidthDPI</entry>
1845 <entry>Resolution height, in DPI</entry>
1847 <entry>kMDItemResolutionHeightDPI</entry>
1851 <entry>Exposure time, in seconds</entry>
1853 <entry>kMDItemExposureTimeSeconds</entry>
1857 <entry>The composer of the music contained in the audio
1860 <entry>kMDItemComposer</entry>
1864 <entry>The musical genre of the song or composition</entry>
1866 <entry>kMDItemMusicalGenre</entry>
1875 <title>References</title>
1880 url="https://developer.apple.com/library/mac/#documentation/Carbon/Reference/MDItemRef/Reference/reference.html">MDItem</ulink></para>
1885 url="https://live.gnome.org/Tracker/Documentation">Tracker</ulink></para>
1892 <title>Starting and stopping Netatalk</title>
1894 <para>The Netatalk distribution comes with several operating system
1895 specific startup script templates that are tailored according to the
1896 options given to the "configure" script before compiling. Currently,
1897 templates are provided for RedHat (sysv style), RedHat (systemd style),
1898 SUSE (sysv style), SUSE (systemd style), Gentoo, NetBSD, Debian and
1899 Solaris. You can select to install the generated startup script(s)
1901 <primary>Startscript</primary>
1903 <secondary>startup script</secondary>
1904 </indexterm> by specifying a system type to "configure". To
1905 automatically install startup scripts give one of the available
1906 <option>--with-init-style</option> option to "configure".</para>
1908 <para>Since new releases of Linux distributions appear all the time and
1909 the startup procedure for the other systems mentioned above might change
1910 as well, it is probably a good idea to not blindly install a startup
1911 script but to look at it first to see if it will work on your system. If
1912 you use Netatalk as part of a fixed setup, like a Linux distribution, an
1913 RPM or a BSD package, things will probably have been arranged properly for
1914 you. The following therefore applies mostly for people who have compiled
1915 Netatalk themselves.</para>
1917 <para>The following daemon need to be started by whatever startup script
1918 mechanism is used:</para>
1922 <para>netatalk<indexterm>
1923 <primary>netatalk</primary>
1928 <para>Additionally, make sure that the configuration file
1929 <filename>afp.conf</filename> is in the right place.</para>