Imported Upstream version 3.2.0
[debian/amanda] / man / amanda-auth.7
1 '\" t
2 .\"     Title: amanda-auth
3 .\"    Author: Jean-Louis Martineau <martineau@zmanda.com>
4 .\" Generator: DocBook XSL Stylesheets vsnapshot_8273 <http://docbook.sf.net/>
5 .\"      Date: 10/18/2010
6 .\"    Manual: Miscellanea
7 .\"    Source: Amanda 3.2.0
8 .\"  Language: English
9 .\"
10 .TH "AMANDA\-AUTH" "7" "10/18/2010" "Amanda 3\&.2\&.0" "Miscellanea"
11 .\" -----------------------------------------------------------------
12 .\" * set default formatting
13 .\" -----------------------------------------------------------------
14 .\" disable hyphenation
15 .nh
16 .\" disable justification (adjust text to left margin only)
17 .ad l
18 .\" -----------------------------------------------------------------
19 .\" * MAIN CONTENT STARTS HERE *
20 .\" -----------------------------------------------------------------
21 .SH "NAME"
22 amanda-auth \- Communication/Authentication methods between Amanda server and client
23 .SH "DESCRIPTION"
24 .PP
25 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
26 \fIauth\fR
27 parameter in the amanda\&.conf file (\fBamanda.conf\fR(5)) commonly as a dumptype\&. Valid values to the
28 \fIauth\fR
29 parameter are
30 \fBbsd\fR,
31 \fBbsdudp\fR,
32 \fBbsdtcp\fR,
33 \fBkrb5\fR,
34 \fBlocal\fR,
35 \fBrsh\fR, and
36 \fBssh\fR\&. The authentication and communication method is used during the backup process
37 \fBamdump\fR
38 (amdump(8)) as well as the recovery process
39 \fBamrecover\fR
40 (amrecover(8))\&.
41 .SH "COMPILATION AND GENERAL INFORMATION"
42 .PP
43 The communication method and thus type of authentication that will be used by the Amanda server is specified by the
44 \fIauth\fR
45 parameter in the dumptype for each disklist entry (DLE)\&. The
46 \fIauth\fR
47 parameter thus may be easily and globally specified in the "global" dumptype\&. If
48 \fIauth\fR
49 is not specified, the
50 \fBbsd\fR
51 communication method is used\&. See
52 \fBamanda.conf\fR(5)
53 for more information on Amanda configuration and dumptypes, and
54 \fBdisklist\fR(5)
55 for more information on disklists\&.
56 .PP
57 On the client side, the Amanda daemon
58 \fBamandad\fR
59 validates the connection depending on the value of the
60 \fBauth\fR
61 argument passed to it (see Amanda(8))\&. Also, when it comes to recovery, the
62 \fBauth\fR
63 parameter can be specified in the
64 \fBamanda-client.conf\fR(5)
65 file to specify the communication method to be used by the client to the server\&.
66 .PP
67 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\&.
68 .sp
69 .nf
70 Authentication    Configure option(s)
71  bsd                    \-\-with\-bsd\-security      \-\-with\-amandahosts (pre\-2\&.6)
72  bsdtcp         \-\-with\-bsdtcp\-security   \-\-with\-amandahosts (pre\-2\&.6)
73  bsdudp         \-\-with\-bsdudp\-security   \-\-with\-amandahosts (pre\-2\&.6)
74  krb5           \-\-with\-krb5\-security
75  local           (always included)
76  rsh                    \-\-with\-rsh\-security
77  ssh                    \-\-with\-ssh\-security
78 .fi
79 .PP
80 There are additional configure options for
81 \fBbsd\fR,
82 \fBbsdudp\fR, and
83 \fBbsdtcp\fR
84 to allow for specifying explicit UDP and TCP port ranges\&.
85 .sp
86 .nf
87    \-\-with\-udpportrange
88    \-\-with\-tcpportrange
89    \-\-with\-low\-tcpportrange
90 .fi
91 .PP
92 See
93 \fBPORT USAGE\fR
94 below for more information\&.
95 .PP
96 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\&.
97 .sp
98 .nf
99    \-\-with\-server\-principal=ARG    server host principal  [amanda]
100    \-\-with\-server\-instance=ARG     server host instance   []
101    \-\-with\-server\-keyfile=ARG      server host key file   [/\&.amanda]
102    \-\-with\-client\-principal=ARG    client host principal  [rcmd]
103    \-\-with\-client\-instance=ARG     client host instance   [HOSTNAME_INSTANCE]
104    \-\-with\-client\-keyfile=ARG      client host key file   [KEYFILE]
105    \-\-with\-ticket\-lifetime=ARG     ticket lifetime        [128]
106    \-\-with\-krb5\-security=DIR       where libkrb\&.a lives   [see below]
107 .fi
108 .PP
109 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\&.
110 .PP
111 The
112 \fBauth\fR
113 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\&.
114 .SS "Usernames"
115 .PP
116 When Amanda is built, a username is specified with the
117 \fB\-\-with\-user\fR
118 option\&. Most Amanda processes run under this user\'s identity, to minimize security risks\&. In binary distributions, this username is usually one of \'amanda\', \'amandabackup\', or \'backup\'\&. The examples below use \'amandabackup\' since it is unambiguous\&. You may need to adjust accordingly for your system\&.
119 .SS "Authenticated Peer Hostnames"
120 .PP
121 Amanda\'s authentication mechanisms provide an authenticated hostname of the system on the other end of the connection, which is used to restrict access to only particular hosts\&. The degree of "authentication" performed on this hostname varies with the authentication mechanism, and is discussed below\&.
122 .SH "BSD, BSDUDP, AND BSDTCP COMMUNICATION AND AUTHENTICATION"
123 .PP
124 For additional information including example configurations, see http://wiki\&.zmanda\&.com/index\&.php/Configuring_bsd/bsdudp/bsdtcp_authentication\&.
125 .PP
126 The
127 \fBbsd\fR,
128 \fBbsdudp\fR, and
129 \fBbsdtcp\fR
130 communication methods use either UDP, TCP, or both protocols operating as a network service to authenticate and exchange data between server and clients\&.
131 .PP
132 The authentication proceeds as follows: for a new, incoming connection, Amanda verifies that the source port is in the reserved range (less than 1024), which for UNIX hosts suggests that the remote user has root privileges\&. Amanda then verifies that the reverse DNS for the remote address matches the forward DNS; that is, that the address maps to a hostname which maps back to the same address\&. Finally, the remote system must provide a username that matches the username in \&.amandahosts\&.
133 .PP
134 In addition to compilation and general configuration (see
135 \fBCOMPILATION AND GENERAL INFORMATION\fR
136 above), the authentication method that the client is configured to receive is specified by the
137 \fBauth\fR
138 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
139 \fIauth\fR
140 parameter in the client\'s Amanda network service configuration or in its amanda\-client\&.conf file (see amanda\-client\&.conf(5))\&.
141 .PP
142 By default, Amanda use the "amanda" service name and associated port set in /etc/services\&. It can be changed by setting the dumptype
143 \fIclient\-port\fR
144 option to a different port number or a different service name\&. All examples are for the service name "amanda" that uses the default port 10080\&.
145 .SS "\&.amandahosts file"
146 .PP
147 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)\&.
148 .PP
149 Amanda looks for the \&.amandahosts file in the Amanda user\'s home directory, commonly /var/lib/amanda\&.
150 .PP
151 Each authorization is on its own line in the following format
152 .PP
153 \fIhostname\fR
154 [
155 \fIusername\fR
156 [
157 \fIservice\&.\&.\&.\fR
158 ] ]
159 .PP
160 If
161 \fIusername\fR
162 is ommitted, it defaults to the user running
163 \fBamandad\fR, i\&.e\&. the user listed in the
164 \fBinetd\fR
165 or
166 \fBxinetd\fR
167 configuration file\&.
168 .PP
169 \fIservice\&.\&.\&.\fR
170 is a space\-delimited list of services the client is authorized to execute:
171 \fBnoop\fR,
172 \fBselfcheck\fR,
173 \fBsendsize\fR,
174 \fBsendbackup\fR,
175 \fBamdump\fR
176 (a shortcut for the previous four services which are required on clients),
177 \fBamindexd\fR, and
178 \fBamidxtaped\fR\&. The last two services are required on a server for clients to connect to it using
179 \fBamrecover\fR\&.
180 .PP
181 If service is omitted, it defaults to
182 \fBnoop selfcheck sendsize sendbackup\fR
183 (which is equivalent to
184 \fBamdump\fR)\&.
185 .PP
186 Example of the \&.amandahosts file on an Amanda client, where \'amandabackup\' is the Amanda dumpuser\&.
187 .sp
188 .nf
189     \fBamandaserver\&.example\&.com   amandabackup   amdump\fR
190 .fi
191 .PP
192 Example of the \&.amandahosts file on an Amanda server
193 .sp
194 .nf
195     \fBamandaclient1\&.example\&.com   root   amindexd amidxtaped\fR
196 .fi
197 .SS "bsd communication and authentication"
198 .PP
199 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)
200 .SS "bsdudp communication and authentication"
201 .PP
202 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)\&.
203 .SS "bsdtcp communication and authentication"
204 .PP
205 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)\&.
206 .SS "USING INETD SERVER"
207 .PP
208 Template for Amanda client inetd service entry
209 .sp
210 .nf
211 \fI   service_name\fR \fIsocket_type\fR \fIprotocol\fR \fIwait/nowait\fR \fIamanda_backup_user\fR \fIabsolute_path_to_amandad\fR amandad \fIserver_args\fR
212 .fi
213 .PP
214 Client example of using
215 \fBbsd\fR
216 authorization for inetd server given Amanda user is "amandabackup":
217 .sp
218 .nf
219 \fB   amanda dgram udp wait amandabackup /path/to/amandad amandad \-auth=bsd amdump\fR
220 .fi
221 .PP
222 The same could be used for
223 \fBbsdudp\fR
224 if specifying \-auth=bsdudp instead of \-auth=bsd\&.
225 .PP
226 Client example of using
227 \fBbsdtcp\fR
228 authorization for inetd server given Amanda user is "amandabackup":
229 .sp
230 .nf
231 \fB   amanda stream tcp nowait amandabackup /path/to/amandad amandad \-auth=bsdtcp amdump\fR
232 .fi
233 .PP
234 \fBamindexd\fR
235 and
236 \fBamidxtaped\fR
237 would typically be added at the end of the line as
238 \fBamandad\fR
239 server arguments for an Amanda server\&.
240 .PP
241 Server example of using
242 \fBbsdtcp\fR
243 authorization for inetd server given Amanda user is "amandabackup":
244 .sp
245 .nf
246 \fB   amanda stream tcp nowait amandabackup /path/to/amandad amandad \-auth=bsdtcp amdump amindexd amidxtaped\fR
247 .fi
248 .PP
249 For Amanda version 2\&.5\&.0 and earlier, remember that neither
250 \fBbsdudp\fR
251 nor
252 \fBbsdtcp\fR
253 are supported and the Amanda daemon
254 \fBamandad\fR
255 accepts no arguments\&. Because of the latter,
256 \fBamrecover\fR
257 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
258 \fIamanda\fR
259 service, run
260 \fIamindexd\fR
261 and
262 \fIamidxtaped\fR
263 Amanda services as their own network services, amandaidx and amidxtape, respectively (see below)\&.
264 .PP
265 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
266 \fBbsd\fR
267 communication/authentication with these clients and must also run
268 \fIamindexd\fR
269 and
270 \fIamidxtaped\fR
271 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
272 \fBamrecover\fR
273 must use
274 \fBamoldrecover\fR
275 instead and, again, the server must be running the amandaidx and amidxtape network services\&.
276 .PP
277 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
278 .sp
279 .nf
280 \fB   amandaidx stream tcp nowait amandabackup /usr/local/libexec/amanda/current/amindexd   amindexd\fR
281 \fB   amidxtape stream tcp nowait amandabackup /usr/local/libexec/amanda/current/amidxtaped amidxtaped\fR
282 .fi
283 .SS "USING XINETD SERVER"
284 .PP
285 Template for Amanda client xinetd service file
286 .sp
287 .nf
288 service amanda
289 {
290         only_from               = \fIAmanda server\fR
291         socket_type             = \fIsocket type\fR
292         protocol                = \fIprotocol\fR
293         wait                    = \fIyes/no\fR
294         user                    = \fIamanda backup user\fR
295         group                   = \fIamanda backup user group id\fR
296         groups                  = yes
297         server                  = \fIabsolute path to amandad\fR
298         server_args             = \fIamandad server arguments\fR
299         disable                 = no
300 }
301 .fi
302 .PP
303 The
304 \fIonly_from\fR
305 parameter can be used with xinetd but is usually in addition to the primary form of access control via the \&.amandahosts file\&.
306 .PP
307 Client example of using
308 \fBbsd\fR
309 authorization for xinetd server and for Amanda user "amandabackup":
310 .sp
311 .nf
312 service amanda
313 {
314         only_from       = amandaserver\&.example\&.com
315         socket_type     = dgram
316         protocol        = udp
317         wait            = yes
318         user            = amandabackup
319         group           = disk
320         groups          = yes
321         server          = /path/to/amandad
322         server_args     = \-auth=bsd amdump
323         disable         = no 
324 }
325 .fi
326 .PP
327 The same could be used for
328 \fBbsdudp\fR
329 if specifying \-auth=bsdudp instead of \-auth=bsd\&.
330 .PP
331 Client example of using
332 \fBbsdtcp\fR
333 authorization for xinetd server and for Amanda user "amandabackup":
334 .sp
335 .nf
336 service amanda
337 {
338         only_from       = amandaserver\&.example\&.com amandaclient\&.example\&.com
339         socket_type     = stream
340         protocol        = tcp
341         wait            = no
342         user            = amandabackup
343         group           = disk
344         groups          = yes
345         server          = /path/to/amandad
346         server_args     = \-auth=bsdtcp amdump
347         disable         = no 
348 }
349 .fi
350 .PP
351 \fBamindexd\fR
352 and
353 \fBamidxtaped\fR
354 would typically be added as additional
355 \fBamandad\fR
356 \fIserver_args\fR
357 for an Amanda server\&.
358 .PP
359 For Amanda version 2\&.5\&.0 and earlier, remember that neither
360 \fBbsdudp\fR
361 nor
362 \fBbsdtcp\fR
363 are supported and the Amanda daemon
364 \fBamandad\fR
365 accepts no arguments\&. Because of the latter,
366 \fBamrecover\fR
367 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
368 \fIamanda\fR
369 service, run
370 \fIamindexd\fR
371 and
372 \fIamidxtaped\fR
373 Amanda services as their own network services, amandaidx and amidxtape, respectively (see below)\&.
374 .PP
375 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
376 \fBbsd\fR
377 communication/authentication with these clients and must also run
378 \fIamindexd\fR
379 and
380 \fIamidxtaped\fR
381 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
382 \fBamrecover\fR
383 must use
384 \fBamoldrecover\fR
385 instead and, again, the server must be running the amandaidx and amidxtape network services\&.
386 .PP
387 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
388 .sp
389 .nf
390 service amandaidx
391 {
392         socket_type             = stream
393         protocol                = tcp
394         wait                    = no
395         user                    = amanda
396         group                   = disk
397         server                  = /usr/local/libexec/amanda/amindexd 
398         disable                 = no
399 }
400
401 service amidxtape
402 {
403         socket_type             = stream
404         protocol                = tcp
405         wait                    = no
406         user                    = amanda
407         group                   = disk
408         server                  = /usr/local/libexec/amanda/amidxtaped
409         disable                 = no
410 }
411 .fi
412 .SS "PORT USAGE"
413 .PP
414 List of TCP/UDP ports used by network service communication methods for Amanda server and client\&.
415 .sp
416 .nf
417    Key:
418        UP = Unreserved Port
419     RPpAP = Reserved Port per Amanda Process
420    UPpDLE = Unreserved Port per DLE
421      [\&.\&.] = Configure options that can be used at compile time to define port ranges
422
423 Authentication  Protocol        Amanda server                                   Amanda client
424 bsd                     udp             1 RPpAP [\-\-with\-udpportrange]                10080
425                         tcp             1 UP [\-\-with\-tcpportrange]           3 UPpDLE [\-\-with\-tcpportrange]
426 bsdudp          udp             1 RPpAP [\-\-with\-udpportrange]                10080
427                         tcp             1 UP [\-with\-tcpportrange]             1 UPpDLE [\-\-with\-tcpportrange]
428 bsdtcp          tcp             1 RPpAP [\-\-with\-low\-tcpportrange]   10080
429 .fi
430 .PP
431 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\&.
432 .PP
433 You can override the default port ranges that Amanda was compiled with in each configuration using the
434 \fIreserved\-udp\-port\fR,
435 \fIreserved\-tcp\-port\fR, and
436 \fIunreserved\-tcp\-port\fR
437 parameters in amanda\&.conf and amanda\-client\&.conf configuration files (see
438 \fBamanda.conf\fR(5)
439 and
440 \fBamanda-client.conf\fR(5))\&.
441 .SS "Authenticated Peer Hostnames with BSD Authentications"
442 .PP
443 The BSD authentication mechanisms only verify that the remote host\'s DNS is configured correctly and that the remote user has access to reserved ports\&. As such, the peer hostname should only be trusted to the extent that the local DNS service is trusted\&.
444 .SH "KERBEROS COMMUNICATION AND AUTHENTICATION"
445
446 For more detail, see http://wiki\&.zmanda\&.com/index\&.php/Kerberos_authentication\&.
447 .PP
448 Amanda supports Kerberos 5 communication methods between Amanda server and client\&.
449 .PP
450 General information including compilation are given above (see
451 \fBCOMPILATION AND GENERAL INFORMATION\fR
452 above)\&.
453 .PP
454 Kerberos 5 uses TCP and the server uses only one TCP port and data streams are multiplexed to this port\&.
455
456
457 The \fBkrb5\fR driver script defaults to:
458 .nf
459 /*
460  * The lifetime of our tickets in minutes\&.
461  */
462 #define AMANDA_TKT_LIFETIME     (12*60)
463
464 /*
465  * The name of the service in /etc/services\&.
466  */
467 #define AMANDA_KRB5_SERVICE_NAME        "k5amanda"
468 .fi
469
470
471 You can currently only override these by editing the source code\&.
472
473 The kerberized AMANDA service uses a different port on the client hosts\&. The /etc/services line is:
474 .nf
475    k5amanda      10082/tcp
476 .fi
477 .PP
478 And the /etc/inetd\&.conf line is:
479 .sp
480 .nf
481    k5amanda stream tcp nowait root /usr/local/libexec/amanda/amandad amandad \-auth=krb5
482 .fi
483 .PP
484 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\&.
485 .PP
486 The following dumptype options apply to
487 \fBkrb5\fR:
488 .sp
489 .nf
490    auth "krb5"    # use krb5 auth for this host
491                   # (you can mingle krb hosts and bsd \&.rhosts in one conf)
492 .fi
493 .PP
494 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)
495 .sp
496 .nf
497    krb5keytab
498    krb5principal
499 .fi
500 .PP
501 For example:
502 .sp
503 .nf
504    krb5keytab     "/etc/krb5\&.keytab\-amanda"
505    krb5principal  "amanda/saidin\&.omniscient\&.com"
506 .fi
507 .PP
508 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:
509 .sp
510 .nf
511    addprinc \-randkey amanda/saidin\&.omniscient\&.com
512    ktadd \-k /etc/krb5\&.keytab\-amanda amanda/saidin\&.omniscient\&.com
513 .fi
514 .PP
515 will do the trick\&. You will obviously want to change the principal name to reflect something appropriate for the conventions at your site\&.
516 .PP
517 You must also configure each client to allow the amanda principal in for dumps\&.
518 .PP
519 There are several ways to go about authorizing a server to connect to a client\&.
520 .PP
521 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
522 \fBkrb5\fR
523 \&.k5login\&. The routines to check it are implemented in amanda rather than using krb5_kuserok because the connections are actually gssapi based\&.
524 .PP
525 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\&.
526 .PP
527 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\&.
528 .PP
529 Here are examples of valid entries in the \&.k5amandahosts:
530 .sp
531 .nf
532    service/amanda
533    service/amanda@TEST\&.COM
534    dumpmaster\&.test\&.com service/amanda
535    dumpmaster\&.test\&.com service/amanda@TEST\&.COM
536 .fi
537 .PP
538 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\&.
539 .PP
540 There is no attempt to verify the realm in this case (only a concern if you have cross\-realm authentication setup)\&.
541 .SS "Authenticated Peer Hostnames with Kerberos Authentication"
542 .PP
543 When accepting a new incoming connection, the Kerberos authentication mechanism performs a similar check to that done by the BSD authentications: the forward and reverse DNS entries for the remote host must match\&. As such, while Kerberos authentication can cryptographically ensure that the remote system is recognized (since it has a ticket), its assurances about the remote host\'s identity are weaker and depend on the integrity of the DNS\&.
544 .SH "LOCAL COMMUNICATION"
545 .PP
546 The Amanda server communicates with the client internally versus over the network, ie\&. the client is also the server\&.
547 .PP
548 This is the only method that requires no authentication as it is clearly not needed\&.
549 .PP
550 The authenticated peer hostname for this authentication is always "localhost"\&.
551 .SH "RSH COMMUNICATION AND AUTHENTICATION"
552
553 For more detail, see http://wiki\&.zmanda\&.com/index\&.php/Configuring_rsh_authentication\&.
554 .PP
555 The Amanda server communicates with its client as the Amanda user via the RSH protocol\&.
556 .PP
557 Please note that RSH protocol itself is insecure and should be used with caution especially on any servers and clients with public IPs\&.
558 .PP
559 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\&.
560 .PP
561 General information including compilation is given above (see
562 \fBCOMPILATION AND GENERAL INFORMATION\fR
563 above)\&.
564 .PP
565 In addition to specifying the
566 \fIauth\fR
567 field in dumptype definition, it might be required to specify
568 \fIclient\-username\fR
569 and
570 \fBamandad\fR
571 fields\&. If the backup user name is different on the Amanda client, the user name is specified as
572 \fBclient\-username\fR\&. If the location of the Amanda daemon
573 \fBamandad\fR
574 is different on the Amanda client, the location is specified as
575 \fIamandad\-path\fR
576 field value\&.
577 .sp
578 .nf
579 For example:
580 define dumptype rsh_example {
581          \&.\&.\&.
582          auth "rsh"
583          client\-username "amandabackup"
584          amandad\-path "/usr/lib/exec/amandad"
585          \&.\&.\&.
586 }
587 .fi
588 .SS "Authenticated Peer Hostnames with RSH Authentication"
589 .PP
590 The RSH authentication mechanism does not provide an authenticated peer hostname\&.
591 .SH "SSH COMMUNICATION AND AUTHENTICATION"
592
593 For more detail, see http://wiki\&.zmanda\&.com/index\&.php/How_To:Set_up_transport_encryption_with_SSH\&.
594
595 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\&.
596
597 General information including compilation is given above (see \fBCOMPILATION AND GENERAL INFORMATION\fR above)\&.
598
599 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\&.
600
601 \fB   /path/to/ssh \-l \fR\fB\fIuser_name\fR\fR\fB client\&.zmanda\&.com $libexecdir/amandad\fR
602
603 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\&.
604
605 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\&.
606
607 Enable SSH authentication and set the \fBssh\-keys\fR option in all DLEs for that host by adding the following to the DLE itself or to the corresponding dumptype in amanda\&.conf:
608
609   auth "ssh"
610   ssh\-keys "/home/amandabackup/\&.ssh/id_rsa_amdump"
611
612 \fBssh\-keys\fR 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
613
614   client\-username "otherusername"
615
616 If your server  \fBamandad\fR path and client  \fBamandad\fR path are different, you should also add
617
618   amandad\-path "/client/amandad/path"
619 .PP
620 For a marginal increase in security, prepend the keys used for AMANDA in the clients\' authorized_keys file with the following:
621 .sp
622 .nf
623   from="amanda_server\&.your\&.domain\&.com",no\-port\-forwarding,no\-X11\-forwarding,no\-agent\-forwarding,command="/absolute/path/to/amandad \-auth=ssh amdump"
624 .fi
625 .PP
626 This will limit that key to connect only from Amanda server and only be able to execute
627 \fBamandad\fR(8)\&.
628 .PP
629 In the same way, prepend the key used for AMANDA in the server\'s authorized_keys file with:
630 .sp
631 .nf
632   from="amanda_client\&.your\&.domain\&.com",no\-port\-forwarding,no\-X11\-forwarding,no\-agent\-forwarding,command="/absolute/path/to/amandad \-auth=ssh amindexd amidxtaped"
633 .fi
634 .PP
635 You can omit the from=\&.\&. option if you have too many clients to list, although this has obvious security implications\&.
636 .PP
637 Set
638 \fBssh\-keys\fR
639 and any other necessary options in /etc/amanda/amanda_client\&.conf:
640 .sp
641 .nf
642   auth "ssh"
643   ssh\-keys "/root/\&.ssh/id_rsa_amrecover"
644   client\-username "amanda"
645   amandad\-path "/server/amandad/path"
646 .fi
647 .PP
648 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:
649 .sp
650 .nf
651   $ ssh client1\&.zmanda\&.com
652   The authenticity of host \'client1\&.zmanda\&.com (192\&.168\&.10\&.1)\' can\'t be established\&.
653   RSA key fingerprint is 26:4e:df:a2:be:c8:cb:20:1c:68:8b:cc:c0:3b:8e:9d\&.
654   Are you sure you want to continue connecting (yes/no)?yes
655 .fi
656 .PP
657 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)\&.
658 .SS "Authenticated Peer Hostnames with SSH Authentication"
659 .PP
660 When accepting an incoming conneciton, the SSH daemon gives Amanda information about the remote system in the $SSH_CONNECTION environment variable\&. Amanda parses this information to determine the remote address, and then performs a similar check to that done by the BSD authentications: the forward and reverse DNS entries for the remote host must match\&. As such, while SSH authentication can cryptographically ensure that the remote system is recognized (since it had a recognized secret key), its assurances about the remote host\'s identity are weaker and depend on the integrity of the DNS\&.
661 .SH "SEE ALSO"
662 .PP
663 \fBamanda\fR(8),
664 \fBamanda.conf\fR(5),
665 \fBamanda-client.conf\fR(5),
666 \fBdisklist\fR(5),
667 \fBamdump\fR(8),
668 \fBamrecover\fR(8)
669 .PP
670 The Amanda Wiki:
671 : http://wiki.zmanda.com/
672 .SH "AUTHORS"
673 .PP
674 \fBJean\-Louis Martineau\fR <\&martineau@zmanda\&.com\&>
675 .RS 4
676 Zmanda, Inc\&. (http://www\&.zmanda\&.com)
677 .RE
678 .PP
679 \fBDustin J\&. Mitchell\fR <\&dustin@zmanda\&.com\&>
680 .RS 4
681 Zmanda, Inc\&. (http://www\&.zmanda\&.com)
682 .RE
683 .PP
684 \fBPaul Yeatman\fR <\&pyeatman@zmanda\&.com\&>
685 .RS 4
686 Zmanda, Inc\&. (http://www\&.zmanda\&.com)
687 .RE