Add `TZ' to the list of variables to be preserved.
[become] / manual / become.texi
CommitLineData
7a53967a 1\input texinfo @c -*-texinfo-*-
2@c
69805471 3@c $Id: become.texi,v 1.2 1998/01/12 16:41:31 mdw Exp $
7a53967a 4@c
5@c Documentation for `become'
6@c
69805471 7@c (c) 1998 EBI
7a53967a 8@c
9
10@c ----- Revision history ---------------------------------------------------
11@c
12@c $Log: become.texi,v $
69805471 13@c Revision 1.2 1998/01/12 16:41:31 mdw
14@c Tidying for new release versions. Fix copyright date.
15@c
7a53967a 16@c Revision 1.1 1997/09/18 11:16:34 mdw
17@c Brand new Texinfo manual, with wider scope than the original LaTeX one.
18@c
19
20@c ----- Standard boilerplate -----------------------------------------------
21
22@c %**start of header
23@setfilename become
24@settitle Become
25@setchapternewpage odd
26@footnotestyle end
27@paragraphindent 0
28@iftex
29@c @smallbook
30@afourpaper
31@c @parindent=0pt
32@end iftex
33@c %**end of header
34
35@c ----- Useful macros ------------------------------------------------------
36
69805471 37@set version 1.2
7a53967a 38
39@c ----- Copyright matters --------------------------------------------------
40
41@c --- The `Info' version ---
42
43@ifinfo
44
45This file documents Become version @value{version}.
46
69805471 47Copyright (c) 1998 European Bioinformatics Institute.
7a53967a 48
49Permission is granted to make and distribute verbatim copies of this
50manual provided the copyright notice and this permission notice are
51preserved on all copies.
52
53@ignore
54Permission is granted to process this file through TeX and print the
55results, provided the printed document carries a copying permission
56notice identical to this one except for the removal of this paragraph
57(this paragraph not being relevant to the printed manual).
58
59@end ignore
60Permission is granted to copy and distribute modified versions of this
61manual under the conditions for verbatim copying, provided also that the
62sections entitled `Copying' and `GNU General Public License' are
63included exactly as in the original, and provided that the entire
64resulting derived work is distributed under the terms of a permission
65notice identical to this one.
66
67Permission is granted to copy and distribute translations of this manual
68into another language, under the above conditions for modified versions,
69except that this permission notice may be stated in a translation
70approved by the European Bioinformatics Institute.
71
72@end ifinfo
73
74@c --- Printed title page ---
75
76@titlepage
77
78@title The Become program
79@subtitle Become version @value{version}
80@author Mark Wooding (@email{mdw@@ebi.ac.uk})
81@page
82
83@vskip 0pt plus 1filll
84
85Copyright @copyright{} 1997 European Bioinformatics Institute.
86
87Permission is granted to make and distribute verbatim copies of this
88manual provided the copyright notice and this permission notice are
89preserved on all copies.
90
91Permission is granted to copy and distribute modified versions of this
92manual under the conditions for verbatim copying, provided also that the
93sections entitled `Copying' and `GNU General Public License' are
94included exactly as in the original, and provided that the entire
95resulting derived work is distributed under the terms of a permission
96notice identical to this one.
97
98Permission is granted to copy and distribute translations of this manual
99into another language, under the above conditions for modified versions,
100except that this permission notice may be stated in a translation
101approved by the European Bioinformatics Institute.
102
103@end titlepage
104
105
106@c --------------------------------------------------------------------------
107@ifinfo
108@node Top, Copying, (dir), (dir)
109@top Become
110
111
112Become is a system for managing shared accounts. It allows users to
113`become' other users in order to do useful work. It can be managed on a
114central server (or a small number of central servers), or it can run
115standalone.
116
117This file documents Become version @value{version}.
118
119@end ifinfo
120
121@menu
122* Copying:: Your rights to distribute and modify
123* Introduction:: A brief introduction to Become
124* Becoming someone else:: How to become somebody else
125* Administering Become:: How to maintain Become
126* Invoking Become:: Reference to Become's command line options
127
128 --- The Detailed Node Listing ---
129
130Becoming someone else
131
132* Terminology:: Some important terms defined
133* Environment:: Login styles and environment variables
134* Group permissions:: How Become handles group permissions
135* X authority:: Problems with X authority files
136* Running commands:: Running commands other than a shell
137
138How Become sets up the environment
139
140* New environment variables:: Become adds some useful environment variables
141* Login styles:: Choose how Become sets the environment
142* Tweaking the environment:: Altering individual environment variables
143* Removed variables:: Some environment variables aren't passed on
7a53967a 144
145Login styles
146
147* The preserve style:: Preserve the current environment
148* The set-user style:: Set user-specific variables (like @code{su})
149* The login style:: Clear the environment (like @code{login})
150
151How Become handles groups
152
153* Primary group selection:: Setting the new primary group
154* Subsidiary groups:: Setting subsidiary group memberships
155
156Considerations for X authority
157
158* The user-group method:: A secure method for handling X authority
159* Using xauth:: A less secure method, which might be easier
160
161Become administration
162
163* Configuration files:: Overview of Become's configuration files
164* Standalone or networked:: The two main types of Become installations
165* The configuration file:: How to define who's allowed to do what
69805471 166* Networked configuration:: Considerations for networked installations
7a53967a 167
168The configuration file
169
170* Basic syntax:: Quick overview of Become's syntax
171* Classes:: Defining classes of things
172* Predefined classes:: Become predefines some (maybe) useful classes
173* Allow statements:: Allow users to become other users
174* Other statements:: Some other useful statements
175* Example configuration file:: An example, showing a few features.
176* Complete grammar:: Complete grammar for Become config files
177
178Networked configuration
179
180* Choosing servers:: Which servers Become tries to talk to
181* Setting up keys:: How to generate keys for Become
182* Random number files:: Become keeps random number state around
183* Issuing a new key:: How to issue new keys without disruption
184
185Setting up keys
186
187* Invoking keygen:: How to use the @code{keygen} program
188
189Invoking Become
190
191* Becoming another user:: Options for becoming another user
192* Starting Become daemons:: Options for starting Become daemons
193* Debugging options:: Options to use when Become goes wrong
194@end menu
195
196@c --------------------------------------------------------------------------
197@node Copying, Introduction, Top, Top
198@unnumbered The GNU General Public License
199
200
201@include gpl.texi
202
203
204@c --------------------------------------------------------------------------
205@node Introduction, Becoming someone else, Copying, Top
206@unnumbered Introduction
207
208
209It's often useful to be able to share accounts between a number of
210users. For example, a group maintaining an externally visible service
211need to be able to start and kill the server process. Giving such a
212shared account a password is a fairly bad plan: such passwords tend not
213to get changed very often, and they have a habit of spreading beyond the
214group of legitimate users.
215
216The Become program presented here offers a solution to the problems of
217shared accounts. It allows the system adminstrator to define which
218users are allowed access to which accounts, on which hosts, and to
219execute which commands. Such shared accounts can then, in general, have
220their passwords removed.
221
222This coincidentally has another advantage: when `becoming' to a shared
223account, a user can retain her@footnote{Or his. I'll choose one or the
224other fairly randomly throughout this manual.} own environment, which
225she's carefully crafted and honed over the years, rather then being
226presented with some lowest-common-denominator setup which probably
227doesn't even use the right shell.
228
229The configuration file for Become can either be distributed to all the
230various hosts in a network or a few carefully set up and secure servers
231(@pxref{Standalone or networked}).
232
233
234@c --------------------------------------------------------------------------
235@node Becoming someone else, Administering Become, Introduction, Top
236@chapter Becoming someone else
237
238
239The simplest way to become someone else is to say
240
241@example
242become @var{user}
243@end example
244
245@noindent
246Become will check to see whether you're allowed to become @var{user}. If you
247are, it starts a shell process with the user-id set to @var{user}. Any
248commands you type are executed with the privileges of @var{user}.
249
250The full invocation is slightly more complicated:
251
252@example
253become [@var{option}@dots{}] [@var{env-var}@dots{}] @var{user} [@var{command} [@var{arg}@dots{}]]
254@end example
255
256Actually, the @var{option}s, @var{env-var}s and @var{user} can be in any
257order -- the important point is that all of them appear before the
258@var{command}, if there is one.
259
260@menu
261* Terminology:: Some important terms defined
262* Environment:: Login styles and environment variables
263* Group permissions:: How Become handles group permissions
264* X authority:: Problems with X authority files
265* Running commands:: Running commands other than a shell
266@end menu
267
268
269
270@node Terminology, Environment, Becoming someone else, Becoming someone else
271@section Terminology
272
273The following terms get used quite a bit in the following text:
274
275@table @asis
276@item request
277An invocation of Become, asking permission to become another user.
278
279@item old user
280The (real) user id of the process which invoked Become; usually, this will be
281your normal user id.
282
283@item target user
284The user whom you want to become, named in a request.
285@end table
286
287
288
289@node Environment, Group permissions, Terminology, Becoming someone else
290@section How Become sets up the environment
291
292There are thorny problems with handling the user's environment. It seems
293that (the author's initial assessment notwithstanding) there is no single
294best way of handling environment variables. As a result, Become can do just
295about everything you might want it to. This gets slightly complicated.
296Don't worry: it's not as hard as all that.
297
298@menu
299* New environment variables:: Become adds some useful environment variables
300* Login styles:: Choose how Become sets the environment
301* Tweaking the environment:: Altering individual environment variables
302* Removed variables:: Some environment variables aren't passed on
7a53967a 303@end menu
304
305
306@node New environment variables, Login styles, Environment, Environment
307@subsection Environment variables created by Become
308
309To help you (and, more importantly, your startup scripts) keep track of who
310you are, and who you were originally, Become adds some variables to the
311environment of any processes it starts.
312
313@table @code
314@item BECOME_USER
315The name of the target user (i.e., the user you are now). It might be useful
316to test this value in shell startup scripts, for example.
317
318@item BECOME_HOME
319The home directory of the target user. It can be handy to read startup and
320other configuration files from here.
321
322@item BECOME_OLD_USER
323The name of the user who invoked Become.
324
325@item BECOME_OLD_HOME
326The home directory of the `old' user.
327
328@item BECOME_ORIGINAL_USER
329This is intended to be the name you logged in with. If it's unset, Become
330sets it to be the same as @code{BECOME_OLD_USER}; otherwise it leaves it
331unchanged.
332
333@item BECOME_ORIGINAL_HOME
334This is intended to be the home directory you logged in with. If it's unset,
335Become sets it to be the same as @code{BECOME_OLD_HOME}; otherwise, it leaves
336it unchanged.
337@end table
338
339Don't even think about relying on these variables as a form of
340authentication. It won't work. They're provided only to help organise
341startup scripts.
342
343
344
345@node Login styles, Tweaking the environment, New environment variables, Environment
346@subsection Login styles
347
348Originally, Become always tried to preserve your environment. There's a
349rational explanation for this approach, which is given in the description of
350the `preserve' style below. Unfortunately, not everyone liked this
351approach. As a result, there's now a collection of different login styles.
352
353Login styles are selected by giving command line arguments:
354
355@table @code
356@item -p
357@itemx --preserve
358The original style: try to preserve the existing user's environment as much
359as possible.
360
361@item -s
362@itemx --set-user
363Set some user-specific variables, like @code{USER} and @code{HOME} to reflect
364the target user rather than the old user. All other variables are preserved.
365
366@item -l
367@itemx --login
368Attempts to make the `become' process as much like a real login as possible.
369All variables not explicitly preserved are deleted, and a new environment is
370built, reflecting the target user.
371@end table
372
373The various styles, and the reasons behind them, are described below.
374
375@menu
376* The preserve style:: Preserve the current environment
377* The set-user style:: Set user-specific variables (like @code{su})
378* The login style:: Clear the environment (like @code{login})
379@end menu
380
381
382@node The preserve style, The set-user style, Login styles, Login styles
383@subsubsection The `preserve' login style
384
385You've spent many hours (days? weeks, even?) customising and honing your
386startup files, learning how to use your shell, and tweaking your favourite
387text editor until it's just the way you like it. So there can be few things
388more annoying than logging into a shared account to find out that the shell's
389wrong, your editor startup files are ignored, and nothing works quite the way
390you'd like it to. Typically you can't change this without annoying the other
391users: the result is a horrible compromise which dissatisfies everyone
392equally.
393
394The `preserve' style lets you take your standard environment with you when
395you become someone else. It tries hard not to modify any environment
396variables.
397
398Become starts your standard shell. If you have an environment variable
399@code{SHELL} defined, than this is executed. Otherwise, the shell specified
400in your entry in the password file is used. (You must have permission to
401execute whatever shell is chosen as the target user, or you'll just be given
402an error message.)
403
404Most programs look at environment variables in preference to looking up
405entries in the password database; e.g., they tend to use @code{USER} or
406@code{LOGNAME} for the user name, and @code{HOME} for your home directory.
407As a result, most programs will continue to find their configuration files in
408your home directory. Also, systems like RCS will use your real name, rather
409than the name of the user that you have become.
410
411To make best use of this login style, you may need to adjust your login
412scripts to notice when @code{BECOME_USER} is someone else, and read in
413appropriate definitions. For example, a `bash' user might say something like
414this in her @file{.bashrc}:
415
416@example
417if [ -n "$BECOME_HOME" ]; then . $BECOME_HOME/.bashrc
418@end example
419
420@noindent
421Similarly, a C shell user (either `tcsh' or `csh') might say something like
422
423@example
424if ($?BECOME_HOME) source $@{BECOME_HOME@}/.cshrc
425@end example
426
427(Note that plain Bourne shell users have a slight problem, because the Bourne
428shell only reads configuration things on a login, not when a normal
429interactive shell is started.)
430
431
432@node The set-user style, The login style, The preserve style, Login styles
433@subsubsection The `set-user' login style
434
435The author sees the main use of Become as allowing a user to acquire the
436privileges associated with a shared account without all the problems which
437shared accounts usually cause. To the author's way of thinking, one of the
438main problems is that your environment gets replaced by something alien and
439wrong. People disagree with me over this point, and for this reason the
440`set-user' style exists.
441
442The objective of `set-user' style is to behave similarly to the standard
443@code{su} command. Unless they've been preserved explicitly (@pxref{Tweaking
444the environment}), `set-user' mode sets the following environment variables:
445
446@table @code
447@item USER
448@itemx LOGNAME
449The name of the target user.
450
451@item HOME
452The home directory of the target user.
453
454@item SHELL
455The target user's default shell
456@end table
457
458The result of this is that the shell will read the target user's
459configuration files and present you with the environment set up there.
460
461I can't think of this style as being anything other than a migration aid
462while users are getting used to the freedom offered by the `preserve' style.
463
464
465@node The login style, , The set-user style, Login styles
466@subsubsection The `login' login style
467
468The `login' style causes Become to attempt to emulate a full login. Become
469will empty the environment of any variables which aren't explicitly preserved
470(@pxref{Tweaking the environment}). It will then set the following
471variables:
472
473@table @code
474@item USER
475@itemx LOGNAME
476The name of the target user.
477
478@item HOME
479The home directory of the target user.
480
481@item SHELL
482The target user's default shell
483
484@item MAIL
485An educated guess at where the target user's mailbox is.
486@end table
487
488By default, it runs the target user's shell, informing it that this is a
489login by setting the first character of @code{argv[0]} to @samp{-}.
490
491Become makes no entries in the @file{utmp} and @file{wtmp} files.
492
493
494
495@node Tweaking the environment, Removed variables, Login styles, Environment
496@subsection Tweaking individual environment variables
497
498Become's login styles provide a sort of course-grained control over the
499environment. Sometimes the control isn't fine enough. Become lets you tweak
500individual variables: you can set, delete, or preserve named variables from
501modification.
502
503There are three different things you can do with environment variables:
504
505@itemize @bullet
506@item
507Set a variable called @var{var} to a value @var{value}, by saying
508
509@example
510@var{var}=@var{value}
511@end example
512
513@noindent
514The variable is preserved from automatic deletion by the login-style rules.
515
516@item
517Delete a variable called @var{var} from the environment, by saying
518
519@example
520@var{var}-
521@end example
522
523@item
524Preserve a variable @var{var} from being deleted or modified by Become's
525login-style rules, but not change its value, by saying
526
527@example
528@var{var}!
529@end example
530@end itemize
531
532Just to try and make this slightly more sensible, here's an example. Suppose
533I want my @code{XAUTHORITY} variable to be set when I become user `fred':
534
535@example
536become XAUTHORITY=$HOME/.Xauthority fred
537@end example
538
539@noindent
540should do the job nicely. Similarly, if I want to log in as `bob', but don't
541want my @code{EDITOR} variable to change:
542
543@example
544become --login EDITOR! bob
545@end example
546
547@noindent
548(Of course, in this example, I'm at the mercy of Bob's shell init files as to
549whether his choice of editor overrides mine.)
550
551
552
69805471 553@node Removed variables, , Tweaking the environment, Environment
7a53967a 554@subsection Variables removed from the environment
555
556Some variables are removed from the environment which Become passes to a
557program for security reasons:
558
559@table @code
560@item LD_*
561@itemx SHLIB_PATH
562@itemx LIBPATH
563@itemx _RLD_*
564These variables are used on various systems as a search path for shared
565libraries. Clearly, by manipulating these search paths, an attacker could
566replace a standard shared library with one of his own.
567
568@item IFS
569The shell input field separator. Modifying this variable radically alters
570the way shells parse their inputs. (In particular, consider the case where
571@code{IFS} contains @samp{/}.)
572
573@item ENV
574@itemx BASH_ENV
575Used by some shells: it contains the name of a file to read on every shell
576invocation.
577
578@item KRB_CONF
579@ignore
580I'm not really sure what's going on here, so I'll just have to bluff my way
581through. I think that the following is more-or-less accurate, having browsed
582a small amount of Kerberos-related documentation.
583@end ignore
584Contains the name of a Kerberos configuration file. By manipulating this
585variable, an attacker could persuade a program to believe the wrong
586authentication server.
587@end table
588
589Also note that the @code{PATH} variable is modified: any items which aren't
590absolute pathnames are removed from the path. This check may become stricter
591in future, although getting the balance between security and convenience is
592particularly hard here.
593
594
595
7a53967a 596@node Group permissions, X authority, Environment, Becoming someone else
597@section How Become handles groups
598
599As well as handling changes of user id, Become also changes group ids.
600The exact changes Become makes are under user control.
601
602@menu
603* Primary group selection:: Setting the new primary group
604* Subsidiary groups:: Setting subsidiary group memberships
605@end menu
606
607
608@node Primary group selection, Subsidiary groups, Group permissions, Group permissions
609@subsection Choosing a new primary group
610
611By default, the primary group is chosen according to the login style
612(@pxref{Login styles}): the `preserve' style retains the current primary
613group, while `set-user' and `login' styles choose the target's primary group.
614
615You can override Become's default choice using the @code{--group} (@code{-g}
616for short) option:
617
618@example
619become --group=@var{group} @dots{}
620@end example
621
622The chosen @var{group} may be either a group name or a numeric gid. The
623group must be one of the following:
624
625@itemize @bullet
626@item
627Your current primary group.
628@item
629One of your current subsidiary groups.
630@item
631The target user's primary group.
632@item
633One of the target user's subsidiary groups.
634@end itemize
635
636Become will raise an error if this isn't the case.
637
638
639@node Subsidiary groups, , Primary group selection, Group permissions
640@subsection Handling subsidiary group memberships
641
642Subsidiary group memberships are a powerful tool for managing permissions
643under Unix. Traditionally, they tend to be tied to particular users. Become
644tries to be sightly more intelligent about group memberships.
645
646Become has a concept of @dfn{group style}, analogous to login style
647(@pxref{Login styles}). The styles are selected by giving command line
648arguments:
649
650@table @code
651@item -k
652@itemx --keep-groups
653Retain the existing group memberships; don't add any new groups.
654
655@item -m
656@itemx --merge-groups
657Merge group memberships of the target user with the exiting memberships.
658
659@item -r
660@itemx --replace-groups
661Replace the existing group memberships with the target user's memberships.
662@end table
663
664Again, the defaults are dependent on the chosen login style. Both `preserve'
665and `set-user' merge group memberships; the `login' style replaces the set of
666groups.
667
668Note that you can do perverse things like replace all the subsidiary groups
669but retain your primary group (using the @code{--group} option;
670@pxref{Primary group selection}) if you like: Become won't try to stop you.
671
672
673
674@node X authority, Running commands, Group permissions, Becoming someone else
675@section Considerations for X authority
676
677Other users can't read your @file{.Xauthority} file, if you have one. This
678is as it should be: anyone who can read it can connect to your X server and
679read or generate events. However, once you've become another user, you can't
680open any X windows; this can be annoying if your favourite editor is X-based.
681
682There are two basic approaches. Either you can send the shared account a
683copy of your display's magic cookie, or you can retain permission to read the
684cookie file.
685
686@menu
687* The user-group method:: A secure method for handling X authority
688* Using xauth:: A less secure method, which might be easier
689@end menu
690
691
692@node The user-group method, Using xauth, X authority, X authority
693@subsection The user-group method for handling X authority
694
695This method is completely secure only if your site uses the `user-group'
696system. In this system, each user is allocated a group containing only that
697user. Usually this is made the user's default primary group, although that's
698not necessary here.
699
700When you start a new X session, ensure that your cookie file is owned by you
701and your private group. Change the file's permissions so that it's group
702readable. Finally, ensure that your private group is retained when you
703become someone else (@pxref{Group permissions}), and that the
704@code{XAUTHORITY} variable is set correctly.
705
706The following Bourne shell code in a @file{.xinitrc} should do most of the
707work:
708
709@example
710XAUTHORITY="$HOME/.Xauthority"
711export XAUTHORITY
712chgrp mygroup $XAUTHORITY
713chmod 640 $XAUTHORITY
714@end example
715
716@noindent
717In a C shell, this becomes
718
719@example
720setenv XAUTHORITY $@{HOME@}/.Xauthority
721chgrp mygroup $XAUTHORITY
722chmod 640 $XAUTHORITY
723@end example
724
725The @code{XAUTHORITY} file is preserved by both the `preserve' and `set-user'
726login styles, so this isn't a problem. You can now become other users, and
727your X permissions will follow you around correctly.
728
729It's probably worth noting that the @code{xauth} program annoyingly resets
730the permissions on the cookie file every time it writes to it. This will be
731particularly irritating if you use @code{ssh}'s X forwarding capabilities,
732because every @code{ssh} connection will reset the permissions. You can deal
733with this problem by putting a line
734
735@example
736chmod 640 $@{XAUTHORITY-$HOME/.Xauthority@} 2>/dev/null
737@end example
738
739@noindent
740in your @file{.bashrc} or @file{.profile} (for Bourne-like shell users) or
741
742@example
743if ($?XAUTHORITY) then
744 chmod 640 $XAUTHORITY >&/dev/null
745else
746 chmod 640 $@{HOME@}/.Xauthority >&/dev/null
747endif
748@end example
749
750@noindent
751in @file{.cshrc} for C shell users.
752
753
754
755@node Using xauth, , The user-group method, X authority
756@subsection The `xauth' method for handling X authority
757
758This method sends your X cookie to the shared account. It's therefore
759intrinsically dangerous: you must be able to trust the other users of the
760shared account not to take undue advantage of this situation.
761
762The following (Bourne) shell snippet illustrates how you might send an
763authorisation cookie to the shared account, to allow it to connect to your
764display:
765
766@example
767if test -n "$BECOME_HOME"; then
768 XAUTHORITY="$BECOME_HOME/.Xauthority"; export XAUTHORITY
769elif test -n "$DISPLAY" && test -z "done_xauth_cookie"; then
770 case "$DISPLAY" in
771 :0.0) display=`hostname`:0.0 ;;
772 *) display="$DISPLAY" ;;
773 esac
774 xauth extract - $display | \
775 become someone -c 'xauth -f $BECOME_HOME/.Xauthority merge -'
776 done_xauth_cookie=yes; export done_xauth_cookie
777fi
778@end example
779
780The equivalent C shell code is
781
782@example
783if ($?BECOME_HOME) then
784 setenv XAUTHORITY "$@{BECOME_HOME@}/.Xauthority
785else if ($?DISPLAY && ! $?done_xauth_cookie) then
786 if ($DISPLAY == :0.0) then
787 set display="`hostname`:0.0"
788 else
789 set display="$DISPLAY"
790 endif
791 xauth extract - $display | \
792 become someone -c 'xauth -f $BECOME_HOME/.Xauthority merge -'
793endif
794@end example
795
796It works as follows:
797
798@itemize @bullet
799@item
800If the variable @code{BECOME_HOME} is set, then we're probably really someone
801else, so point to the shared account's authority file.
802
803@item
804Otherwise, check to see whether we have a display, and the authorisation has
805not already been sent. If this is so, resolve a local display name into a
806remote one (just in case) and then send it to the shared account.
807@end itemize
808
809
810
811@node Running commands, , X authority, Becoming someone else
812@section Executing specific commands
813
814As well as starting shells, Become can run single commands. This can be
815useful in two ways:
816
817@itemize @bullet
818@item
819It enables Become to be used in scripts.
820
821@item
822It allows access to shared accounts to be controlled on the basis of the
823command to be run.
824@end itemize
825
826To run a command as another user, say:
827
828@example
829become @var{user} @var{command} [@var{argument}@dots{}]
830@end example
831
832If the request is granted, Become runs @var{command}, passing it any
833arguments following the command name. Become doesn't run a shell, so there's
834no extra escaping which needs to be done.
835
836If you really want to run a shell command as another user, you can use the
837@code{-c} option:
838
839@example
840become @var{user} -c @var{shell-command}
841@end example
842
843This is exactly equivalent to
844
845@example
846become @var{user} /bin/sh -c @var{shell-command}
847@end example
848
849in every way. In particular, you must have permission to run @file{/bin/sh}
850as @var{user} for it to work: Become doesn't attempt to interpret the shell
851command in any way. Also note that Become always uses the Bourne shell,
852regardless of your current shell preference, or @var{user}'s default shell.
853(This is done to provide a stable programming interface which works
854irrespective of changes to the shared account's configuration.)
855
856
857@c --------------------------------------------------------------------------
858@node Administering Become, Invoking Become, Becoming someone else, Top
859@chapter Become administration
860
861
862This chapter will explain how Become is administrated and maintained.
863
864@menu
865* Configuration files:: Overview of Become's configuration files
866* Standalone or networked:: The two main types of Become installations
867* The configuration file:: How to define who's allowed to do what
868* Networked configuration:: Considerations for networked installations
869@end menu
870
871
872
873@node Configuration files, Standalone or networked, Administering Become, Administering Become
874@section Configuration files
875
876Become keeps its configuration and administrative files in a directory
877usually named @file{/etc/become}, although this can be changed with the
878@code{--with-etcdir} option to the configuration script when you build
879Become.
880
881Not all of the files are needed on all machines.
882
883@table @file
884@item become.conf
885The main configuration file, containing a description of which users are
886allowed to become which other users, where, and what they're allowed to run
887when they get there. Only needed on servers or standalone machines.
888
889@item become.server
890A list of servers to contact. Only needed on client machines.
891
892@item become.key
893The encryption key to use when sending requests to servers. Needed on
894clients and servers, but not on standalone machines.
895
896@item become.pid
897The process id of the server. Created automatically by Become's server when
898in starts up.
899
900@item become.random
901Contains state information for Become's random number generator. Created
902automatically if it doesn't exist.
903@end table
904
905
906@node Standalone or networked, The configuration file, Configuration files, Administering Become
907@section Installation types
908
909
910Become can be installed in two different ways, depending on how you want to
911administer it:
912
913@itemize @bullet
914@item
915In a @dfn{standalone} installation, each Become request is dealt with
916locally: the program reads the configuration file, and decides whether it
917should grant or deny permission.
918
919Standalone installations don't depend on servers being available, or even on
920the existance of a network. They're useful for small sites, or sites with a
921small number of users. The disadvantages are that reading the configuration
922file takes a while, so the program doesn't feel as responsive as it should,
923and ensuring that all the hosts' configuration files are synchronised becomes
924difficult when you have lots of machines.
925
926@item
927In a @dfn{network} installation, any Become requests are sent on to a
928collection of servers. The servers analyse the request and send a reply back
929which either authorises or forbids access.
930
931A networked installation clearly depends on the servers' reliability. The
932client reacts only to the first reply it receives, so as long as there is one
933server running, everything should continue as normal.
934
935A networked installation is useful when you have a large number of client
936machines, particularly ones which may not be awake all the time. The full
937configuration file only needs to be installed on a small number of servers;
938the clients require only a list of server machines to contact, and an
939encryption key to use.
940@end itemize
941
942
943
944@node The configuration file, Networked configuration, Standalone or networked, Administering Become
945@section The configuration file
946
947The main configuration file, usually called @file{/etc/become/become.conf},
948contains all the rules which Become uses to decide whether to grant or deny
949requests. It may also contain additional information for the benefit of
950Become daemons, if you're using a networked installation.
951
952@menu
953* Basic syntax:: Quick overview of Become's syntax
954* Classes:: Defining classes of things
955* Predefined classes:: Become predefines some (maybe) useful classes
956* Allow statements:: Allow users to become other users
957* Other statements:: Some other useful statements
958* Example configuration file:: An example, showing a few features.
959* Complete grammar:: Complete grammar for Become config files
960@end menu
961
962
963@node Basic syntax, Classes, The configuration file, The configuration file
964@subsection Basic configuration file syntax
965
966The configuration file consists of a sequence of statements, each terminated
967by a semicolon.
968
969Comments begin with a @samp{#} character, and continue to the end of the
970line. This is the only time newlines behave specially: newlines behave just
971like any other whitespace characters within statements.
972
973Strings are enclosed in double-quote characters (@samp{"}). Within a string,
974a backslash causes the following character to be treated literally, whatever
975it may be (including quotes, backslashes and newlines).
976
977Names begin with an alphabetic character or an underscore, and consist of
978letters, digits and underscores.
979
980In general, ...
981
982
983
984@node Classes, Predefined classes, Basic syntax, The configuration file
985@subsection Classes
986
987A @dfn{class} in Become is a set of users, hosts or commands. You can define
988and name your own classes using statements of the form:
989
990@example
991user @var{name} = @var{class-expr} ;
992command @var{name} = @var{class-expr} ;
993host @var{name} = @var{class-expr} ;
994@end example
995
996A @var{class-expr} is an expression defining a class. You can build a
997complex class out of simple classes using the operators (in ascending
998precedence order) @samp{,}, @samp{-}, @samp{|} and @samp{&}, which represent
999the set options `union', `subtraction', `union' (again!), and `intersection'.
1000Subexpressions can be parenthesised to override the default precedence.
1001Once a class name has been defined, as shown above, it can be used in
1002subsequent class expressions.
1003
1004A single user may be designated by either a user name (in quotes) or an
1005integer uid. Commands and hosts may be designated by quoted strings which
1006may contain wildcards. Host strings are matched against both numeric (dotted
1007quad) IP addresses and the reverse-resolved hostname. Command strings are
1008matched against the absolute pathname of the command the user wants to
1009execute.
1010
1011
1012
1013@node Predefined classes, Allow statements, Classes, The configuration file
1014@subsection Predefined classes
1015
1016In an attempt to make life a bit easier, Become creates a collection of
1017predefined classes.
1018
1019The standard classes @code{all} and @code{none} match anything and nothing
1020respectively. The @code{all} class is useful in some contexts: it gives you
1021a way of saying `everything except@dots{}', for example:
1022
1023@example
1024user MUNDANES = all - SYSHACKS;
1025@end example
1026
1027@noindent
1028The @code{none} class isn't particularly useful in itself. It's there for
1029completeness.
1030
1031Become also defines some other classes:
1032
1033@itemize @bullet
1034@item
1035For each username @var{user}, Become adds a class called @samp{@var{user}}
1036which matches just that user.
1037
1038@item
1039For each group name @var{group}, Become creates a class called
1040@samp{@var{group}} which matches any user who is a member of that group.
1041
1042@item For each netgroup @var{netgroup}, Become creates two classes:
1043@samp{u_@var{netgroup}} which matches any user listed in the netgroup, and
1044@samp{h_@var{netgroup}} which matches any host listed in the netgroup.
1045@end itemize
1046
1047If a name is used for both a user @emph{and} a group, then corresponding
1048class ends up containing the user together with all of the group members.
1049For this reason, it's probably better to use the predefined classes for
1050groups rather than individual users -- use quoted user names for individual
1051users.
1052
1053Note that users and groups are read using the standard @code{get*ent} calls
1054@emph{and} directly from the NIS server (if there is one). The idea here is
1055that a Become server can be run on a machine which allows restricted logins.
1056It still needs to know about all the users known to the outside world.
1057
1058Netgroups are read only from the NIS servers. In particular, although GNU
1059systems allow netgroup databases to be stored in local files, Become wonn't
1060read them because there's no defined interface for enumerating netgroups.
1061
1062
1063@node Allow statements, Other statements, Predefined classes, The configuration file
1064@subsection Allow statements
1065
1066Defining classes is just a means to an end. The end is to specify which
1067users are allowed to do what, where, and as whom. This is done with an
1068@code{allow} statement:
1069
1070@example
1071allow [[@var{host-class}]] [@var{user-class}] -> [@var{user-class}] [ : @var{command-class}]
1072@end example
1073
1074(The @var{host-class} is optional, but must be enclosed in square brackets if
1075present.)
1076
1077The four classes in an allow statement are called, respectively, the `host',
1078the `to-user', the `from-user' and the `command'. Any of the four classes
1079may be omitted, and an omitted class defaults to `all'.
1080
1081When a request is received, Become checks the fields in the request against
1082the classes in each allow statement of the configuration file. If a
1083statement matches, the request is granted; if there are no full matches,
1084the request is denied.
1085
1086
1087@node Other statements, Example configuration file, Allow statements, The configuration file
1088@subsection Other statements
1089
1090Two other statement types are defined. They only have an effect on Become in
1091daemon mode:
1092
1093@example
1094port @var{port} ;
1095keyfile @var{key-file} ;
1096@end example
1097
1098@noindent
1099The @code{port} statement specifies the port to which the server should
1100listen; the @var{port} may be be an integer or a quoted service name. The
1101@code{keyfile} statement instructs Become to use the key from the file named
1102@var{key-file}, which must be a quoted string.
1103
1104
1105@node Example configuration file, Complete grammar, Other statements, The configuration file
1106@subsection An example configuration file
1107
1108@example
1109#
1110# become.conf
1111#
1112# Example configuration file
1113#
1114
1115allow wheel -> "root";
1116
1117user NEWS = "fred", "jim";
1118allow NEWS -> "news";
1119
1120user HTTP = "jim", "bob";
1121allow HTTP -> "httpd" : "/bin/kill", "/etc/init.d/httpd";
1122@end example
1123
1124
1125@node Complete grammar, , Example configuration file, The configuration file
1126@subsection Complete grammar for configuration files
1127
1128@format
1129@var{file} ::= @var{file} @var{statement}
1130
1131@var{statement} ::= @var{class-def}
1132 | @var{allow-spec}
1133 | @var{port-spec}
1134 | @var{key-spec}
1135
1136@var{class-def} ::= @samp{user} @var{name} = @var{class-expr} @samp{;}
1137 | @samp{command} @var{name} = @var{class-expr} @samp{;}
1138 | @samp{host} @var{name} = @var{class-expr} @samp{;}
1139
1140@var{allow-spec} ::= @samp{allow} @var{opt-host-spec} @var{opt-user-spec}
1141 @samp{->} @var{opt-user-spec} @var{opt-command-spec} @samp{;}
1142
1143@var{opt-host-spec} ::= @samp{[} @var{class-expr} @samp{]}
1144 | @var{empty}
1145
1146@var{opt-user-spec} ::= @var{class-expr}
1147 | @var{empty}
1148
1149@var{opt-command-spec} ::= @samp{:} @var{class-expr}
1150 | @var{empty}
1151
1152@var{port-spec} ::= @samp{port} @var{integer} @samp{;}
1153 | @samp{port} @var{string} @samp{;}
1154
1155@var{key-spec} ::= @samp{keyfile} @var{string} @samp{;}
1156
1157@var{class-expr} ::= @var{class-diff-expr}
1158 | @var{class-expr} @samp{,} @var{class-diff-expr}
1159
1160@var{class-diff-expr} ::= @var{class-isect-expr}
1161 | @var{class-diff-expr} @samp{-} @var{class-union-expr}
1162
1163@var{class-union-expr} ::= @var{class-isect-expr}
1164 | @var{class-union-expr} @samp{|} @var{class-isect-expr}
1165
1166@var{class-isect-expr} ::= @var{class-primary}
1167 | @var{class-isect-expr} @samp{&} @var{class-primary}
1168
1169@var{class-primary} ::= @samp{(} @var{class-expr} @samp{)}
1170 | @var{string}
1171 | @var{integer}
1172
1173@var{integer} ::= one or more digits (@samp{0}--@samp{9})
1174
1175@var{name} ::= an alphabetic character or underscore, followed by zero or
1176 more alphanumeric characters or underscores
1177
1178@var{string} ::= @samp{"} @var{string-chars} @samp{"}
1179
1180@var{string-chars} ::= @var{string-chars} @var{string-char}
1181 | @var{empty}
1182
1183@var{string-char} ::= a @samp{\} followed by any character
1184 | any character other than @samp{"}, @samp{\} or newline
1185
1186@var{empty} ::=
1187@end format
1188
1189
1190@node Networked configuration, , The configuration file, Administering Become
1191@section Networked configuration
1192
1193If you're planning to use Become in a standalone way, you can skip this
1194section.
1195
1196@menu
1197* Choosing servers:: Which servers Become tries to talk to
1198* Setting up keys:: How to generate keys for Become
1199* Random number files:: Become keeps random number state around
1200* Issuing a new key:: How to issue new keys without disruption
1201@end menu
1202
1203
1204@node Choosing servers, Setting up keys, Networked configuration, Networked configuration
1205@subsection Choosing servers
1206
1207Become notices that it's meant to send requests to a server if it finds a
1208@file{become.server} file. This file contains entries of the form
1209
1210@example
1211@var{host} [: @var{port}]
1212@end example
1213
1214If the @var{port} is omitted, Become chooses a port by looking at the
1215services database for a service which matches the name by which Become was
1216invoked: normally this will be @samp{become}.
1217
1218Become sends a request to all of the servers and believes the first valid
1219reply it receives. Since servers ignore requests they believe to be invalid,
1220this enables you to change Become's key without disrupting service
1221(@pxref{Issuing a new key}).
1222
1223If you're using NIS, you should try to ensure that Become servers runs only
1224on NIS servers; the NIS master is probably a good choice.
1225
1226Become isn't particularly processor-intensive, and doesn't seem to require
1227very much memory.
1228
1229
1230@node Setting up keys, Random number files, Choosing servers, Networked configuration
1231@subsection Setting up keys
1232
1233Communication between Become clients and the server is encrypted to ensure
1234that it's not feasible to gain unauthorised privilege by subverting the
1235network. Become uses simple symmetric cryptography -- it's not necessary to
1236use complicated public key techniques in this case.
1237
1238Each client machine, and the server, must have a copy of the same key. The
1239key is usually stored in @file{/etc/become/become.key}. Become's keys are
1240128 bits long.
1241
1242The key file can be generated using the @code{keygen} program, supplied. The
1243command
1244
1245@example
1246keygen --bits=128 --output=/etc/become/become.key
1247@end example
1248
1249@noindent
1250generates a 128-bit key and writes it to @file{/etc/become/become.key} in a
1251format which Become can read.
1252
1253The @code{keygen} program works by measuring the time between keystrokes. It
1254also tries to obtain some randomness from the environment, and mixes all of
1255this noise together before it outputs the key file.
1256
1257Having generated a key, it must be distributed to all of the other hosts
1258which will use this server. The author recommends using the @code{scp}
1259program, distributed with the @code{SSH} (Secure Shell) package, for doing
1260this.
1261
1262Being able to read a key file enables a user to assume root privileges. The
1263author recommends that only the super-user be able to read key files.
1264
1265@menu
1266* Invoking keygen:: How to use the @code{keygen} program
1267@end menu
1268
1269
1270@node Invoking keygen, , Setting up keys, Setting up keys
1271@subsubsection Invoking @code{keygen}
1272
1273@example
1274keygen [@var{option}@dots{}]
1275@end example
1276
1277By default, @code{keygen} generates a 128-bit key, and writes it to standard
1278output in a hexadecimal format. This behaviour can be modified by passing
1279options:
1280
1281@table @code
1282@item -h
1283@itemx --help
1284Write a summary of @code{keygen}'s usage instructions to standard output and
1285exits.
1286
1287@item -b @var{bits}
1288@itemx --bits=@var{bits}
1289Generate a @var{bits}-bit key, instead of the default 128 bits.
1290
1291@item -o @var{file}
1292@itemx --output=@var{file}
1293Write the key to @var{file} instead of standard output.
1294
1295@item -f @var{format}
1296@itemx --format=@var{format}
1297Set the format in which @code{keygen} outputs the generated key. If the
1298@var{format} is @samp{hex} (or @samp{tx}), the key is output in Become's
1299hexadecimal format; @samp{binary} writes the key as a raw binary dump; and
1300@samp{base64} writes the key using the Base64 encoding.
1301@end table
1302
1303
1304
1305@node Random number files, Issuing a new key, Setting up keys, Networked configuration
1306@subsection Random number files
1307
1308Become uses random numbers to generate session keys when it's communicating
1309with a server. When it's finished, it stores the state of its random number
1310generator in a file, usually @code{/etc/become/become.random}. If this file
1311doesn't exist, Become creates it automatically, using noise collected from
1312the environment. It's probably not worth your while creating randomness
1313files by hand.
1314
1315
1316@node Issuing a new key, , Random number files, Networked configuration
1317@subsection Issuing a new key
1318
1319When you're sending out a new key, you run a risk of disrupting service. The
1320server reads a new key; the clients still have the old one.
1321
1322The author's recommendation is to run two servers. Update the key on one.
1323Then send the new key to all of the clients. Finally, update the key on the
1324other server. Because of the way Become works, a client will always get a
1325response from one of the servers, depending on whether the new key has
1326reached it yet.
1327
1328A similar method is handy if Become's protocol ever changes. (This is quite
1329likely at the moment. The current protocol doesn't include any version
1330information, and the MAC isn't as good as it could be.)
1331
1332
1333@c --------------------------------------------------------------------------
1334@node Invoking Become, , Administering Become, Top
1335@chapter Invoking Become
1336
1337
1338This chapter provides an exhaustive description of Become's command line
1339options, organised in a reference-manual sort of way.
1340
1341@menu
1342* Becoming another user:: Options for becoming another user
1343* Starting Become daemons:: Options for starting Become daemons
1344* Debugging options:: Options to use when Become goes wrong
1345@end menu
1346
1347
1348
1349@node Becoming another user, Starting Become daemons, Invoking Become, Invoking Become
1350@section Becoming another user
1351
1352@subsection Synopsis
1353
1354@example
1355become [@var{option}@dots{}] [@var{env-var}@dots{}] @var{user} [@var{command} [@var{argument}@dots{}]]
1356@end example
1357
1358Actually, you can put the @var{option}s, @var{env-var}s and @var{user} in any
1359order you like; the important thing is that all of them appear before the
1360command, if any.
1361
1362
1363@subsection Usage
1364
1365The @var{option}s appropriate for this mode are as follows:
1366
1367@table @code
1368@item -h
1369@itemx --help
1370Display a (fairly verbose) help message describing the various command line
1371options and exits successfully.
1372
1373@item -u
1374@itemx --usage
1375Display a terse summary of the command line options and exits successfully.
1376
1377@item -v
1378@itemx
1379Display's Become's version number and exits successfully.
1380
1381@item -e
1382@item --preserve-environment
1383Selects the `preserve' login style (@pxref{The preserve style}). All
1384environment variables are preserved. The default command is the current
1385user's own shell. The default primary group becomes the current primary
1386group; the default group style is set to `merge'.
1387
1388@item -s
1389@itemx --su
1390@itemx --set-user
1391Selects the `set-user' login style (@pxref{The set-user style}). Most
1392environment variables are preserved, but @code{USER}, @code{LOGNAME},
1393@code{HOME} and other user-specific variables are altered to reflect the
1394target user's configuration. The default command is the target user's shell.
1395The default primary group becomes the target user's primary group; the
1396default group style is set to `merge'.
1397
1398@item -l
1399@itemx --login
1400Selects the `login' login style (@pxref{The login style}). The environment
1401is cleared and rebuilt, in a similar way to the behaviour of @code{login}.
1402The default command is the target user's shell. The default primary group
1403becomes the target user's primary group; the default group style is set to
1404`replace'.
1405
1406@item -g @var{group}
1407@itemx --group=@var{group}
1408Selects @var{group} as the primary group; it may be either a group name or a
1409numeric group id. Note that @var{group} must be the primary group or
1410a subsidiary group of either the current user or the target user.
1411
1412@item -k
1413@itemx --keep-groups
1414Selects the `keep' group style (@pxref{Subsidiary groups}). The current set
1415of subsidiary group memberships are passed on unchanged.
1416
1417@item -m
1418@itemx --merge-groups
1419Selects the `merge' group style (@pxref{Subsidiary groups}). The current set
1420of subsidiary group memberships are merged with the subsidiary groups of the
1421target user.
1422
1423@item -r
1424@itemx --replace-groups
1425Selects the `replace' group style (@pxref{Subsidiary groups}). The target
1426user's subsidiary group memberships are passed on; the current subsidiary
1427groups are discarded.
1428
1429@item -c @var{shell-cmd}
1430@itemx --command=@var{shell-cmd}
1431Sets the @var{command} and @var{argument}s to invoke
1432@code{/bin/sh -c @var{shell-cmd}}; i.e., to execute a Bourne shell command
1433instead of just @code{exec}ing a program. Note that permissions are checked
1434for executing the Bourne shell @code{/bin/sh}; the contents of the
1435@var{shell-cmd} are not inspected.
1436@end table
1437
1438The @var{env-var} arguments fine-tune the environment passed to the command.
1439Each @var{env-var} setting must be one of the following:
1440
1441@table @code
1442@item @var{var}=@var{value}
1443Assign the variable named @var{var} the value @var{value}. Protect the
1444variable @var{var} from modifications by the login style.
1445
1446@item @var{var}!
1447Protect the variable @var{var} from modifications by the login style, but
1448don't change its value.
1449
1450@item @var{var}-
1451Remove the variable @var{var} from the environment; do not pass it on.
1452@end table
1453
1454The @var{user} specifies the user as whom the @var{command} should be
1455executed (i.e., the @dfn{target user}). It may be a user name or a numeric
1456user id.
1457
1458The @var{command} specifies a command to execute. If @var{command} does not
1459contain a path, it is looked for using the current @code{PATH} environment
1460variable. The resulting pathname is canonified if necessary, to produce an
1461absolute pathname. Note that symbolic links are @emph{not} resolved -- this
1462prevents an attack whereby a user could invoke a program, passing it an
1463unusual @code{argv[0]} which might cause unusual behaviour.
1464
1465The @var{command} name is used both as the command to execute and passed to
1466the command as @code{argv[0]}. It is not possible to specify an alternative
1467calue to be passed as @code{argv[0]}. Subsequent arguments, if supplied, are
1468passed as @code{argv[1]} upwards.
1469
1470If no @var{command} is given, a shell is invoked; the particulars of the
1471shell are determined by the login style (see above).
1472
1473The @var{command} is executed as follows:
1474
1475@itemize @bullet
1476@item
1477The subsidiary groups are chosen as determined by the group style.
1478@item
1479The real and effective gids are set.
1480@item
1481The real and effective uids are set.
1482@item
1483The @var{command} is called using the standard @code{execve} system call.
1484@end itemize
1485
1486
1487
1488@node Starting Become daemons, Debugging options, Becoming another user, Invoking Become
1489@section Starting Become daemons
1490
1491@subsection Synopsis
1492
1493@example
1494become --daemon [@var{option}@dots{}]
1495@end example
1496
1497
1498@subsection Usage
1499
1500The following options are appropriate to this mode:
1501
1502@table @code
1503@item -h
1504@itemx --help
1505Display a (fairly verbose) help message describing the various command line
1506options and exits successfully.
1507
1508@item -u
1509@itemx --usage
1510Display a terse summary of the command line options and exits successfully.
1511
1512@item -v
1513@itemx
1514Display's Become's version number and exits successfully.
1515
1516@item -d
1517@itemx --daemon
1518Start a Become server, instead of processing a request. Become will read its
1519command line options, read in the configuration file (and verify that it's
1520correct) and then fork into the background to wait for incoming requests.
1521Become relinquishes all setuid privileges (by setting all uids to the real
1522uid) when it enters daemon mode. It is therefore only really useful to run a
1523daemon as the superuser.
1524
1525@item -p @var{port}
1526@itemx --port=@var{port}
1527Listen for requests on @var{port}. This option is overridden by the
1528@code{port} option in the configuration file.
1529
1530@item -f @var{file}
1531@itemx --config-file=@var{file}
1532Read configuration from @var{file}, instead of the default (usually
1533@file{/etc/become/become.conf}).
1534@end table
1535
1536The syntax of the configuration file is described in @ref{The configuration
1537file}.
1538
1539
1540@node Debugging options, , Starting Become daemons, Invoking Become
1541@section Debugging options
1542
1543Some options are only useful when trying to find out why Become is
1544misbehaving. Of course, this never happens, so here are the options which
1545you won't need to use:
1546
1547@table @code
1548@item -T[@var{file}]
1549@itemx --trace[=@var{file}]
1550Write trace information to @var{file} (or to standard output, if no
1551@var{file} is specified). You must be able to create the file and open it
1552for writing.
1553
1554@item -L[@var{feature}...]
1555@itemx --trace-level[=@var{feature}]
1556Selects which features Become ought to trace. Each feature is allocated a
1557letter; simply string together the letters for the features you want to
1558debug. The letters @samp{D} and @samp{A} stand respectively for `default'
1559and `all' features; you can subtract from them by saying, for example,
1560@samp{A-xyz} to select all features except @samp{x}, @samp{y} and @samp{z}.
1561The exact list of features supported at any one time can be listed by giving
1562the @code{--trace-level} option without an argument.
1563
1564@item -I @var{user}
1565@itemx --impersonate=@var{user}
1566Pretend to be @var{user} instead of yourself when the request is checked.
1567This option can only be used if it wasn't disabled at compile-time and if
1568Become is not running setuid. Even so, Become will only inform you of the
1569outcome; it will not execute any commands.
1570@end table
1571
1572
1573
1574@c --------------------------------------------------------------------------
1575
1576@c --- No index yet ---
1577@c
1578@c @node Concept index, , Invoking Become, Top
1579@c @unnumbered Concept index
1580@c @printindex cp
1581@c
1582@c @contents
1583
1584@bye
1585
1586@c ----- That's all, folks --------------------------------------------------