Imported Upstream version 3.2.0
[debian/amanda] / man / xml-source / amanda-auth.7.xml
1 <?xml version="1.0" encoding="ISO-8859-1"?>
2 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
3                    "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd"
4 [
5   <!-- entities files to use -->
6   <!ENTITY % global_entities SYSTEM 'global.entities'>
7   %global_entities;
8 ]>
9
10 <refentry id='amanda-auth.7'>
11
12 <refmeta>
13   <refentrytitle>amanda-auth</refentrytitle>
14   <manvolnum>7</manvolnum>
15 &rmi.source;
16 &rmi.version;
17 &rmi.manual.7;
18 </refmeta>
19 <refnamediv>
20   <refname>amanda-auth</refname>
21   <refpurpose>Communication/Authentication methods between Amanda server and client</refpurpose>
22 </refnamediv>
23 <refentryinfo>
24   &author.jlm;
25   &author.dustin;
26   &author.pby;
27 </refentryinfo>
28
29 <!-- body begins here -->
30
31 <refsect1><title>DESCRIPTION</title>
32 <para>Amanda offers 7 methods of communication between Amanda server (sometimes also called the tape server) and clients, each with its own authentication method.  The desired communication method is specified by the <emphasis remap='I'>auth</emphasis> parameter in the amanda.conf file (&amconf;) commonly as a dumptype.  Valid values to the <emphasis remap='I'>auth</emphasis> parameter are <emphasis remap='B'>bsd</emphasis>, <emphasis remap='B'>bsdudp</emphasis>, <emphasis remap='B'>bsdtcp</emphasis>, <emphasis remap='B'>krb5</emphasis>, <emphasis remap='B'>local</emphasis>, <emphasis remap='B'>rsh</emphasis>, and <emphasis remap='B'>ssh</emphasis>. The authentication and communication method is used during the backup process &amdump; (amdump(8)) as well as the recovery process &amrecover; (amrecover(8)).</para>
33 </refsect1>
34
35 <refsect1><title>COMPILATION AND GENERAL INFORMATION</title>
36   <para>The communication method and thus type of authentication that will be used by the Amanda server is specified by the <emphasis remap='I'>auth</emphasis> parameter in the dumptype for each disklist entry (DLE).  The <emphasis remap='I'>auth</emphasis> parameter thus may be easily and globally specified in the "global" dumptype.  If <emphasis remap='I'>auth</emphasis> is not specified, the <emphasis remap='B'>bsd</emphasis> communication method is used.  See &amconf; for more information on Amanda configuration and dumptypes, and &disklist; for more information on disklists.</para>
37
38 <para>On the client side, the Amanda daemon &amandad; validates the connection depending on the value of the <emphasis remap='B'>auth</emphasis> argument passed to it (see Amanda(8)).  Also, when it comes to recovery, the <emphasis remap='B'>auth</emphasis> parameter can be specified in the &amclientconf; file to specify the communication method to be used by the client to the server.</para>
39
40   <para>When Amanda is being built from source code, desired communication and thus authentication methods (shown as "Authentication") must be specified as configure options at compilation time.
41 <programlisting>
42 Authentication    Configure option(s)
43  bsd                    --with-bsd-security      --with-amandahosts (pre-2.6)
44  bsdtcp         --with-bsdtcp-security   --with-amandahosts (pre-2.6)
45  bsdudp         --with-bsdudp-security   --with-amandahosts (pre-2.6)
46  krb5           --with-krb5-security
47  local           (always included)
48  rsh                    --with-rsh-security
49  ssh                    --with-ssh-security
50 </programlisting>
51   </para>
52  
53 <para>There are additional configure options for <emphasis remap='B'>bsd</emphasis>, <emphasis remap='B'>bsdudp</emphasis>, and <emphasis remap='B'>bsdtcp</emphasis> to allow for specifying explicit UDP and TCP port ranges.
54
55 <programlisting>
56    --with-udpportrange
57    --with-tcpportrange
58    --with-low-tcpportrange
59 </programlisting>
60 </para>
61
62 <para>See <emphasis remap='B'>PORT USAGE</emphasis> below for more information.</para>
63
64 <para>There are additional configure options for Kerberos if you so desire.  All but the last option are for Kerberos 4.  Defaults shown in square brackets.
65
66 <programlisting>
67    --with-server-principal=ARG    server host principal  [amanda]
68    --with-server-instance=ARG     server host instance   []
69    --with-server-keyfile=ARG      server host key file   [/.amanda]
70    --with-client-principal=ARG    client host principal  [rcmd]
71    --with-client-instance=ARG     client host instance   [HOSTNAME_INSTANCE]
72    --with-client-keyfile=ARG      client host key file   [KEYFILE]
73    --with-ticket-lifetime=ARG     ticket lifetime        [128]
74    --with-krb5-security=DIR       where libkrb.a lives   [see below]
75 </programlisting>
76 </para>
77
78 <para>If configuring with --with-krb5-security, the configure script will search under /usr/kerberos/lib, /usr/cygnus/lib, /usr/lib, and /opt/kerberos/lib for the kerberos bits, libkrb.a, in this order.  Kerberos support will not be added if it does not find them.  If the kerberos bits are found under some other hierarchy, you can specify this via --with-krb5-security=DIR where DIR is where the kerberos bits live.  The configure script will then look in the 'lib' directory under this hierarchy for libkrb.a.</para>
79
80 <para>The <emphasis remap='B'>auth</emphasis> parameter selects a communication/authentication method to use between the client and the backup server. These methods are described each in their own section below.</para>
81
82 <refsect2><title>Usernames</title>
83
84 <para>When Amanda is built, a username is specified with the
85 <option>--with-user</option> option.  Most Amanda processes run under
86 this user's identity, to minimize security risks.  In binary
87 distributions, this username is usually one of 'amanda',
88 'amandabackup', or 'backup'.  The examples below use 'amandabackup'
89 since it is unambiguous. You may need to adjust accordingly for your
90 system.</para>
91
92 </refsect2>
93
94 <refsect2><title>Authenticated Peer Hostnames</title>
95
96 <para>Amanda's authentication mechanisms provide an authenticated hostname of
97 the system on the other end of the connection, which is used to restrict
98 access to only particular hosts.  The degree of "authentication" performed
99 on this hostname varies with the authentication mechanism, and is discussed
100 below.</para>
101
102 </refsect2>
103
104 </refsect1>
105
106 <refsect1><title>BSD, BSDUDP, AND BSDTCP COMMUNICATION AND AUTHENTICATION</title>
107 <para>For additional information including example configurations, see http://wiki.zmanda.com/index.php/Configuring_bsd/bsdudp/bsdtcp_authentication.</para>
108
109   <para>The <emphasis remap='B'>bsd</emphasis>, <emphasis remap='B'>bsdudp</emphasis>, and <emphasis remap='B'>bsdtcp</emphasis> communication methods use either UDP, TCP, or both protocols operating as a network service to authenticate and exchange data between server and clients.</para>
110
111   <para>The authentication proceeds as follows: for a new, incoming connection,
112   Amanda verifies that the source port is in the reserved range (less than
113   1024), which for UNIX hosts suggests that the remote user has root
114   privileges.  Amanda then verifies that the reverse DNS for the remote
115   address matches the forward DNS; that is, that the address maps to a
116   hostname which maps back to the same address.  Finally, the remote system
117   must provide a username that matches the username in .amandahosts.</para>
118
119   <para>In addition to compilation and general configuration (see <emphasis remap='B'>COMPILATION AND GENERAL INFORMATION</emphasis> above), the authentication method that the client is configured to receive is specified by the <emphasis remap='B'>auth</emphasis> parameter in the network service configuration for Amanda. The authentication method used by an Amanda client to reach the server during recovery is the authentication method specified by the <emphasis remap='I'>auth</emphasis> parameter in the client's Amanda network service configuration or in its amanda-client.conf file (see amanda-client.conf(5)).</para>
120
121   <para>By default, Amanda use the "amanda" service name and associated port set in /etc/services. It can be changed by setting the dumptype <emphasis remap='I'>client-port</emphasis> option to a different port number or a different service name.
122   All examples are for the service name "amanda" that uses the default port 10080.</para>
123
124
125   <refsect2><title>.amandahosts file</title>
126     <para> Servers and clients using the bsd, bsdudp, and bsdtcp authentication methods refer to the .amandahosts file to control access.  Amanda should be compiled for this access control if one of these methods will be used and is the default compilation option for Amanda 2.6 (use --with-amandahosts when compiling pre-2.6 versions of Amanda).</para>
127
128     <para>Amanda looks for the .amandahosts file in the Amanda user's home directory, commonly /var/lib/amanda.</para>
129
130     <para>Each authorization is on its own line in the following format</para>
131
132 <para><emphasis remap='I'>hostname</emphasis> [ <emphasis remap='I'>username</emphasis> [ <emphasis remap='I'>service...</emphasis> ] ]</para>
133
134 <para>If <emphasis remap='I'>username</emphasis> is ommitted, it defaults to the user running <emphasis remap='B'>amandad</emphasis>, i.e. the user listed in the <emphasis remap='B'>inetd</emphasis> or <emphasis remap='B'>xinetd</emphasis>
135 configuration file.</para>
136
137 <para><emphasis remap='I'>service...</emphasis> is a space-delimited list of services the client is authorized to execute:
138
139 <emphasis remap='B'>noop</emphasis>,
140 <emphasis remap='B'>selfcheck</emphasis>,
141 <emphasis remap='B'>sendsize</emphasis>,
142
143 <emphasis remap='B'>sendbackup</emphasis>,
144 <emphasis remap='B'>amdump</emphasis> (a shortcut for the previous four services which are required on clients),
145 <emphasis remap='B'>amindexd</emphasis>, and
146 <emphasis remap='B'>amidxtaped</emphasis>.  The last two services are required on a server for clients to connect to it using <emphasis remap='B'>amrecover</emphasis>.</para>
147
148 <para>If service is omitted, it defaults to <emphasis remap='B'>noop selfcheck sendsize sendbackup</emphasis> (which is equivalent to <emphasis remap='B'>amdump</emphasis>).</para>
149
150     <para>Example of the .amandahosts file on an Amanda client, where 'amandabackup' is the Amanda dumpuser.
151
152 <programlisting>
153     <emphasis remap='B'>amandaserver.example.com   amandabackup   amdump</emphasis>
154 </programlisting>
155     </para>
156
157     <para>Example of the .amandahosts file on an Amanda server
158
159 <programlisting>
160     <emphasis remap='B'>amandaclient1.example.com   root   amindexd amidxtaped</emphasis>
161 </programlisting>
162     </para>
163   </refsect2>
164
165   <refsect2><title>bsd communication and authentication</title>
166     <para>The authentication is done using .amandahosts file in the Amanda user's home directory. The protocol between Amanda server and client is UDP. The number of disk list entries (DLEs)--number of Amanda clients--is limited by the UDP packet size. This authentication protocol will use a different port for each data stream (see PORT USAGE below)</para>
167   </refsect2>
168
169   <refsect2><title>bsdudp communication and authentication</title>
170      <para>The authentication is done using .amandahosts files in the Amanda user's home directory. It uses UDP protocol between Amanda server and client for data and hence the number of DLEs is limited by the UDP packet size. It uses one TCP port to establish the connection and multiplexes all data streams using one port on the server (see PORT USAGE below).</para>
171   </refsect2>
172
173   <refsect2><title>bsdtcp communication and authentication</title>
174     <para>The authentication is done using .amandahosts files in the backup user's (for example: amandabackup) home directory. It uses TCP protocol between Amanda server and client. On the client, two reserved ports are used. On the server, all data streams are multiplexed to one port (see PORT USAGE below).</para>
175   </refsect2>
176
177   <refsect2><title>USING INETD SERVER</title>
178     <para>Template for Amanda client inetd service entry
179
180 <programlisting>
181 <emphasis remap='I'>   service_name</emphasis> <emphasis remap='I'>socket_type</emphasis> <emphasis remap='I'>protocol</emphasis> <emphasis remap='I'>wait/nowait</emphasis> <emphasis remap='I'>amanda_backup_user</emphasis> <emphasis remap='I'>absolute_path_to_amandad</emphasis> amandad <emphasis remap='I'>server_args</emphasis>
182 </programlisting>
183     </para>
184     <para>Client example of using <emphasis remap='B'>bsd</emphasis> authorization for inetd server given Amanda user is "amandabackup":
185
186 <programlisting>
187 <emphasis remap='B'>   amanda dgram udp wait amandabackup /path/to/amandad amandad -auth=bsd amdump</emphasis>
188 </programlisting>
189     </para>
190     <para>The same could be used for <emphasis remap='B'>bsdudp</emphasis> if specifying -auth=bsdudp instead of -auth=bsd.</para>
191     <para>Client example of using <emphasis remap='B'>bsdtcp</emphasis> authorization for inetd server given Amanda user is "amandabackup":
192
193 <programlisting>
194 <emphasis remap='B'>   amanda stream tcp nowait amandabackup /path/to/amandad amandad -auth=bsdtcp amdump</emphasis>
195 </programlisting>
196     </para>
197     <para><emphasis remap='B'>amindexd</emphasis> and <emphasis remap='B'>amidxtaped</emphasis> would typically be added at the end of the line as &amandad; server arguments for an Amanda server.</para>
198     <para>Server example of using <emphasis remap='B'>bsdtcp</emphasis> authorization for inetd server given Amanda user is "amandabackup":
199
200 <programlisting>
201 <emphasis remap='B'>   amanda stream tcp nowait amandabackup /path/to/amandad amandad -auth=bsdtcp amdump amindexd amidxtaped</emphasis>
202 </programlisting>
203     </para>
204     <para>For Amanda version 2.5.0 and earlier, remember that neither <emphasis remap='B'>bsdudp</emphasis> nor <emphasis remap='B'>bsdtcp</emphasis> are supported and the Amanda daemon &amandad; accepts no arguments.  Because of the latter, &amrecover; as of Amanda version 2.5.1  is not compatible with 2.5.0 and earlier servers.  Thus, servers that are 2.5.0 or earlier must, in addition to the <emphasis remap='I'>amanda</emphasis> service, run <emphasis remap='I'>amindexd</emphasis> and <emphasis remap='I'>amidxtaped</emphasis> Amanda services as their own network services, amandaidx and amidxtape, respectively (see below).</para>
205
206 <para>There are no compatibility issues if server and clients are all 2.5.0 or earlier.  If your server is 2.5.1 or later, you can still have clients that are 2.5.0 and earlier although you must then use <emphasis remap='B'>bsd</emphasis> communication/authentication with these clients and must also run <emphasis remap='I'>amindexd</emphasis> and <emphasis remap='I'>amidxtaped</emphasis> Amanda services on the server as their own network services, amandaidx and amidxtape, respectively (see below).  If you have a server that is 2.5.0 and earlier, clients of a later version on which you wish to run &amrecover; must use <emphasis remap='B'>amoldrecover</emphasis> instead and, again, the server must be running the amandaidx and amidxtape network services.</para>
207
208 <para>Example of amindexd and amidxtaped Amanda daemon services configured as their own network services for a 2.5.0 or earlier server or a newer server having 2.5.0 or earlier clients
209
210 <programlisting>
211 <emphasis remap='B'>   amandaidx stream tcp nowait amandabackup /usr/local/libexec/amanda/current/amindexd   amindexd</emphasis>
212 <emphasis remap='B'>   amidxtape stream tcp nowait amandabackup /usr/local/libexec/amanda/current/amidxtaped amidxtaped</emphasis>
213 </programlisting>
214 </para>
215   </refsect2>
216
217   <refsect2><title>USING XINETD SERVER</title>
218     <para>Template for Amanda client xinetd service file
219
220 <programlisting>
221 service amanda
222 {
223         only_from               = <emphasis remap='I'>Amanda server</emphasis>
224         socket_type             = <emphasis remap='I'>socket type</emphasis>
225         protocol                = <emphasis remap='I'>protocol</emphasis>
226         wait                    = <emphasis remap='I'>yes/no</emphasis>
227         user                    = <emphasis remap='I'>amanda backup user</emphasis>
228         group                   = <emphasis remap='I'>amanda backup user group id</emphasis>
229         groups                  = yes
230         server                  = <emphasis remap='I'>absolute path to amandad</emphasis>
231         server_args             = <emphasis remap='I'>amandad server arguments</emphasis>
232         disable                 = no
233 }
234 </programlisting>
235     </para>
236     <para>The <emphasis remap='I'>only_from</emphasis> parameter can be used with xinetd but is usually in addition to the primary form of access control via the .amandahosts file.</para>
237     <para>Client example of using <emphasis remap='B'>bsd</emphasis> authorization for xinetd server and for Amanda user "amandabackup":
238
239 <programlisting>
240 service amanda
241 {
242         only_from       = amandaserver.example.com
243         socket_type     = dgram
244         protocol        = udp
245         wait            = yes
246         user            = amandabackup
247         group           = disk
248         groups          = yes
249         server          = /path/to/amandad
250         server_args     = -auth=bsd amdump
251         disable         = no 
252 }
253 </programlisting>
254     </para>
255     <para>The same could be used for <emphasis remap='B'>bsdudp</emphasis> if specifying -auth=bsdudp instead of -auth=bsd.</para>
256     <para>Client example of using <emphasis remap='B'>bsdtcp</emphasis> authorization for xinetd server and for Amanda user "amandabackup":
257
258 <programlisting>
259 service amanda
260 {
261         only_from       = amandaserver.example.com amandaclient.example.com
262         socket_type     = stream
263         protocol        = tcp
264         wait            = no
265         user            = amandabackup
266         group           = disk
267         groups          = yes
268         server          = /path/to/amandad
269         server_args     = -auth=bsdtcp amdump
270         disable         = no 
271 }
272 </programlisting>
273     </para>
274     <para><emphasis remap='B'>amindexd</emphasis> and <emphasis remap='B'>amidxtaped</emphasis> would typically be added as additional &amandad; <emphasis remap='I'>server_args</emphasis> for an Amanda server.</para>
275     <para>For Amanda version 2.5.0 and earlier, remember that neither <emphasis remap='B'>bsdudp</emphasis> nor <emphasis remap='B'>bsdtcp</emphasis> are supported and the Amanda daemon &amandad; accepts no arguments.  Because of the latter, &amrecover; as of Amanda version 2.5.1  is not compatible with 2.5.0 and earlier servers.  Thus, servers that are 2.5.0 or earlier must, in addition to the <emphasis remap='I'>amanda</emphasis> service, run <emphasis remap='I'>amindexd</emphasis> and <emphasis remap='I'>amidxtaped</emphasis> Amanda services as their own network services, amandaidx and amidxtape, respectively (see below).</para>
276
277 <para>There are no compatibility issues if server and clients are all 2.5.0 or earlier.  If your server is 2.5.1 or later, you can still have clients that are 2.5.0 and earlier although you must then use <emphasis remap='B'>bsd</emphasis> communication/authentication with these clients and must also run <emphasis remap='I'>amindexd</emphasis> and <emphasis remap='I'>amidxtaped</emphasis> Amanda services on the server as their own network services, amandaidx and amidxtape, respectively (see below).  If you have a server that is 2.5.0 and earlier, clients of a later version on which you wish to run &amrecover; must use <emphasis remap='B'>amoldrecover</emphasis> instead and, again, the server must be running the amandaidx and amidxtape network services.</para>
278
279 <para>Example of amindexd and amidxtaped Amanda daemon services configured as their own network services for a 2.5.0 or earlier server or a newer server having 2.5.0 or earlier clients
280 <programlisting>
281 service amandaidx
282 {
283         socket_type             = stream
284         protocol                = tcp
285         wait                    = no
286         user                    = amanda
287         group                   = disk
288         server                  = /usr/local/libexec/amanda/amindexd 
289         disable                 = no
290 }
291
292 service amidxtape
293 {
294         socket_type             = stream
295         protocol                = tcp
296         wait                    = no
297         user                    = amanda
298         group                   = disk
299         server                  = /usr/local/libexec/amanda/amidxtaped
300         disable                 = no
301 }
302
303 </programlisting>
304 </para>
305   </refsect2>
306
307   <refsect2><title>PORT USAGE</title>
308     <para>List of TCP/UDP ports used by network service communication methods for Amanda server and client.
309
310 <programlisting>
311    Key:
312        UP = Unreserved Port
313     RPpAP = Reserved Port per Amanda Process
314    UPpDLE = Unreserved Port per DLE
315      [..] = Configure options that can be used at compile time to define port ranges
316
317 Authentication  Protocol        Amanda server                                   Amanda client
318 bsd                     udp             1 RPpAP [--with-udpportrange]           10080
319                         tcp             1 UP [--with-tcpportrange]              3 UPpDLE [--with-tcpportrange]
320 bsdudp          udp             1 RPpAP [--with-udpportrange]           10080
321                         tcp             1 UP [-with-tcpportrange]               1 UPpDLE [--with-tcpportrange]
322 bsdtcp          tcp             1 RPpAP [--with-low-tcpportrange]       10080
323 </programlisting>
324 </para>
325     <para>Amanda server also uses two ports (dumper process) to communicate with the chunker/taper processes. These ports are in the range set by --with-tcpportrange.</para>
326 <para>You can override the default port ranges that Amanda was compiled with in each configuration using the <emphasis remap='I'>reserved-udp-port</emphasis>, <emphasis remap='I'>reserved-tcp-port</emphasis>, and <emphasis remap='I'>unreserved-tcp-port</emphasis> parameters in amanda.conf and amanda-client.conf configuration files (see &amconf; and &amclientconf;).</para>
327   </refsect2>
328
329 <refsect2><title>Authenticated Peer Hostnames with BSD Authentications</title>
330
331 <para>The BSD authentication mechanisms only verify that the remote
332 host's DNS is configured correctly and that the remote user has access to
333 reserved ports.  As such, the peer hostname should only be trusted to the
334 extent that the local DNS service is trusted.</para>
335
336 </refsect2>
337
338 </refsect1>
339
340 <refsect1><title>KERBEROS COMMUNICATION AND AUTHENTICATION</title>
341 For more detail, see http://wiki.zmanda.com/index.php/Kerberos_authentication.
342
343 <para>Amanda supports Kerberos 5 communication methods between Amanda server and client.</para>
344
345 <para>General information including compilation are given above (see <emphasis remap='B'>COMPILATION AND GENERAL INFORMATION</emphasis> above).</para>
346
347 <para>Kerberos 5 uses TCP and the server uses only one TCP port and data streams are multiplexed to this port.</para>
348
349 The <emphasis remap='B'>krb5</emphasis> driver script defaults to:
350
351 <programlisting>
352 /*
353  * The lifetime of our tickets in minutes.
354  */
355 #define AMANDA_TKT_LIFETIME     (12*60)
356
357 /*
358  * The name of the service in /etc/services.
359  */
360 #define AMANDA_KRB5_SERVICE_NAME        "k5amanda"
361 </programlisting>
362
363 You can currently only override these by editing the source code.
364
365 The kerberized AMANDA service uses a different port on the client hosts. The /etc/services line is:
366
367 <programlisting>
368    k5amanda      10082/tcp
369 </programlisting>
370
371 <para>And the /etc/inetd.conf line is:
372
373 <programlisting>
374    k5amanda stream tcp nowait root /usr/local/libexec/amanda/amandad amandad -auth=krb5
375 </programlisting>
376 </para>
377
378 <para>Note that you're running this as root, rather than as your dump user.  AMANDA will set its UID down to the dump user at times it doesn't need to read the keytab file, and give up root permissions entirely before it goes off and runs dump.  Alternately you can change your keytab files to be readable by user amanda. You should understand the security implications of this before changing the permissions on the keytab.</para>
379
380 <para>The following dumptype options apply to <emphasis remap='B'>krb5</emphasis>:
381
382 <programlisting>
383    auth "krb5"    # use krb5 auth for this host
384                   # (you can mingle krb hosts and bsd .rhosts in one conf)
385 </programlisting>
386 </para>
387
388 <para>The principal and keytab files that Amanda uses must be set in the amanda.conf file for kerberos 5 dumps to work. You can hardcode this in the source code if you really want to (common-src/krb5-security.c)
389
390 <programlisting>
391    krb5keytab
392    krb5principal
393 </programlisting>
394 </para>
395
396 <para>For example:
397
398 <programlisting>
399    krb5keytab     "/etc/krb5.keytab-amanda"
400    krb5principal  "amanda/saidin.omniscient.com"
401 </programlisting>
402 </para>
403
404 <para>The principal in the second option must be contained in the first. The keytab should be readable by the amanda user (and definitely not world readable!) and is (obviously) on the server.  In MIT's kadmin, the following:
405
406 <programlisting>
407    addprinc -randkey amanda/saidin.omniscient.com
408    ktadd -k /etc/krb5.keytab-amanda amanda/saidin.omniscient.com
409 </programlisting>
410 </para>
411
412 <para>will do the trick. You will obviously want to change the principal name to reflect something appropriate for the conventions at your site.</para>
413
414 <para>You must also configure each client to allow the amanda principal in for dumps.</para>
415
416 <para>There are several ways to go about authorizing a server to connect to a client.</para>
417
418 <para>The normal way is via a .k5amandausers file or a .k5login file in the client user's home directory. The determination of which file to use is based on the way you ran configure on AMANDA. By default, AMANDA will use .k5amandahosts, but if you configured with --without-amandahosts, AMANDA will use .k5login. (similar to the default for .rhosts/.amandahosts-style security). The .k5login file syntax is a superset of the default <emphasis remap='B'>krb5</emphasis> .k5login. The routines to check it are implemented in amanda rather than using krb5_kuserok because the connections are actually gssapi based.</para>
419
420 <para>This .k5amandahosts/.k5login is a hybrid of the .amandahosts and a .k5login file. You can just list principal names, as in a .k5login file and the principal will be permitted in from any host. If you do NOT specify a realm, then there is no attempt to validate the realm (this is only really a concern if you have cross-realm authentication set up with another realm or something else that allows you multiple realms in your kdc. If you do specify a realm, only that principal@realm will be permitted to connect.</para>
421
422 <para>You may prepend this with a hostname and whitespace, and only that principal (with optional realm as above) will be permitted to access from that hostname.</para>
423
424 <para>Here are examples of valid entries in the .k5amandahosts:
425
426 <programlisting>
427    service/amanda
428    service/amanda@TEST.COM
429    dumpmaster.test.com service/amanda
430    dumpmaster.test.com service/amanda@TEST.COM
431 </programlisting>
432 </para>
433
434 <para>Rather than using a .k5amandahosts or .k5login file, the easiest way is to use a principal named after the destination user, (such as amanda@TEST.COM in our example) and not have either a .k5amandahosts or .k5login file in the destination user's home directory.</para>
435
436 <para>There is no attempt to verify the realm in this case (only a concern if you have cross-realm authentication setup).</para>
437
438 <refsect2><title>Authenticated Peer Hostnames with Kerberos Authentication</title>
439
440 <para>When accepting a new incoming connection, the Kerberos authentication
441 mechanism performs a similar check to that done by the BSD authentications:
442 the forward and reverse DNS entries for the remote host must match.  As
443 such, while Kerberos authentication can cryptographically ensure that the
444 remote system is recognized (since it has a ticket), its assurances about
445 the remote host's identity are weaker and depend on the integrity of the
446 DNS.</para>
447
448 </refsect2>
449
450 </refsect1>
451
452 <refsect1><title>LOCAL COMMUNICATION</title>
453 <para>The Amanda server communicates with the client internally versus over the network, ie. the client is also the server.</para>
454 <para>This is the only method that requires no authentication as it is clearly not needed.</para>
455 <para>The authenticated peer hostname for this authentication is always "localhost".</para>
456 </refsect1>
457
458 <refsect1><title>RSH COMMUNICATION AND AUTHENTICATION</title>
459 For more detail, see http://wiki.zmanda.com/index.php/Configuring_rsh_authentication.
460
461 <para>The Amanda server communicates with its client as the Amanda user via the RSH protocol.</para>
462
463 <para>Please note that RSH protocol itself is insecure and should be used with caution especially on any servers and clients with public IPs.</para>
464
465 <para>Each Amanda client communicates with the server using one TCP port and all data streams from the client are multiplexed over one port. The number of Amanda clients is limited by the number of reserved ports available on the Amanda server. Some versions of RSH do not use reserved ports and, thus, this restriction is not valid.</para>
466
467 <para>General information including compilation is given above (see <emphasis remap='B'>COMPILATION AND GENERAL INFORMATION</emphasis> above).</para>
468
469 <para>In addition to specifying the <emphasis remap='I'>auth</emphasis> field in dumptype definition, it might be required to specify <emphasis remap='I'>client-username</emphasis> and &amandad; fields. If the backup user name is different on the Amanda client, the user name is specified as <emphasis remap='B'>client-username</emphasis>. If the location of the Amanda daemon &amandad; is different on the Amanda client, the location is specified as <emphasis remap='I'>amandad-path</emphasis> field value.
470
471 <programlisting>
472 For example:
473 define dumptype rsh_example {
474          ...
475          auth "rsh"
476          client-username "amandabackup"
477          amandad-path "/usr/lib/exec/amandad"
478          ...
479 }
480 </programlisting>
481 </para>
482
483 <refsect2><title>Authenticated Peer Hostnames with RSH Authentication</title>
484
485 <para>The RSH authentication mechanism does not provide an authenticated peer hostname.</para>
486
487 </refsect2>
488
489 </refsect1>
490
491 <refsect1><title>SSH COMMUNICATION AND AUTHENTICATION</title>
492 For more detail, see http://wiki.zmanda.com/index.php/How_To:Set_up_transport_encryption_with_SSH.
493
494 Amanda client sends data to the server using SSH. SSH keys have to be set up so that Amanda server can communicate with its clients using SSH.
495
496 General information including compilation is given above (see <emphasis remap='B'>COMPILATION AND GENERAL INFORMATION</emphasis> above).
497
498 SSH provides transport encryption and authentication. To set up an SSH authentication session, Amanda will run the equivalent of the following to start the backup process.
499
500 <emphasis remap='B'>   /path/to/ssh -l <emphasis remap='I'>user_name</emphasis> client.zmanda.com $libexecdir/amandad</emphasis>
501
502 To use SSH, you need to set up SSH keys either by storing the passphrase in cleartext, using ssh-agent, or using no passphrase at all.  All of these options have security implications which should be carefully considered before adoption.
503
504 When you use a public key on the client to do data encryption (see http://wiki.zmanda.com/index.php/How_To:Set_up_data_encryption), you can lock away the private key in a secure place. Both, transport and storage will be encrypted with such a setup. See http://wiki.zmanda.com/index.php/Encryption for an overview of encryption options.
505
506 Enable SSH authentication and set the <amkeyword>ssh-keys</amkeyword> option in all DLEs for that host by adding the following to the DLE itself or to the corresponding dumptype in amanda.conf:
507
508   auth "ssh"
509   ssh-keys "/home/amandabackup/.ssh/id_rsa_amdump"
510
511 <amkeyword>ssh-keys</amkeyword> is the path to the private key on the client. If the username to which Amanda should connect is different from the default, then you should also add
512
513   client-username "otherusername"
514
515 If your server &amandad; path and client &amandad; path are different, you should also add
516
517   amandad-path "/client/amandad/path"
518
519 <para>For a marginal increase in security, prepend the keys used for AMANDA in the clients' authorized_keys file with the following:
520
521 <programlisting>
522   from="amanda_server.your.domain.com",no-port-forwarding,no-X11-forwarding,no-agent-forwarding,command="/absolute/path/to/amandad -auth=ssh amdump"
523 </programlisting>
524 </para>
525
526 <para>This will limit that key to connect only from Amanda server and only be able to execute &amandad;(8).</para>
527
528 <para>In the same way, prepend the key used for AMANDA in the server's authorized_keys file with:
529
530 <programlisting>
531   from="amanda_client.your.domain.com",no-port-forwarding,no-X11-forwarding,no-agent-forwarding,command="/absolute/path/to/amandad -auth=ssh amindexd amidxtaped"
532 </programlisting>
533 </para>
534
535 <para>You can omit the from=.. option if you have too many clients to list, although this has obvious security implications.</para>
536
537 <para>Set <amkeyword>ssh-keys</amkeyword> and any other necessary options in /etc/amanda/amanda_client.conf:
538
539 <programlisting>
540   auth "ssh"
541   ssh-keys "/root/.ssh/id_rsa_amrecover"
542   client-username "amanda"
543   amandad-path "/server/amandad/path"
544 </programlisting>
545 </para>
546
547 <para>Besides user keys, SSH uses host keys to uniquely identify each host, to prevent one host from impersonating another. Unfortunately, the only easy way to set up these host keys is to make a connection and tell SSH that you trust the identity:
548
549 <programlisting>
550   $ ssh client1.zmanda.com
551   The authenticity of host 'client1.zmanda.com (192.168.10.1)' can't be established.
552   RSA key fingerprint is 26:4e:df:a2:be:c8:cb:20:1c:68:8b:cc:c0:3b:8e:9d.
553   Are you sure you want to continue connecting (yes/no)?yes
554 </programlisting>
555 </para>
556
557 <para>As Amanda will not answer this question itself, you must manually make every connection (server to client and client to server) that you expect Amanda to make. Note that you must use the same username that Amanda will use (that is, ssh client and ssh client.domain.com are distinct).</para>
558
559 <refsect2><title>Authenticated Peer Hostnames with SSH Authentication</title>
560
561 <para>When accepting an incoming conneciton, the SSH daemon gives Amanda
562 information about the remote system in the $SSH_CONNECTION environment
563 variable.  Amanda parses this information to determine the remote
564 address, and then performs a similar check to that done by the BSD
565 authentications: the forward and reverse DNS entries for the remote
566 host must match.  As such, while SSH authentication can
567 cryptographically ensure that the remote system is recognized (since it
568 had a recognized secret key), its assurances about the remote host's
569 identity are weaker and depend on the integrity of the DNS.</para>
570
571 </refsect2>
572
573 </refsect1>
574
575 <seealso>
576 <manref name="amanda.conf" vol="5" />
577 <manref name="amanda-client.conf" vol="5" />
578 <manref name="disklist" vol="5" />
579 <manref name="amdump" vol="8" />
580 <manref name="amrecover" vol="8" />
581 </seealso>
582
583
584 </refentry>