2 .\" Copyright (c) 1995,1996,1997 Berkeley Software Design, Inc.
3 .\" All rights reserved.
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
8 .\" 1. Redistributions of source code must retain the above copyright
9 .\" notice, this list of conditions and the following disclaimer.
10 .\" 2. Redistributions in binary form must reproduce the above copyright
11 .\" notice, this list of conditions and the following disclaimer in the
12 .\" documentation and/or other materials provided with the distribution.
13 .\" 3. All advertising materials mentioning features or use of this software
14 .\" must display the following acknowledgement:
15 .\" This product includes software developed by Berkeley Software Design,
17 .\" 4. The name of Berkeley Software Design, Inc. may not be used to endorse
18 .\" or promote products derived from this software without specific prior
19 .\" written permission.
21 .\" THIS SOFTWARE IS PROVIDED BY BERKELEY SOFTWARE DESIGN, INC. ``AS IS'' AND
22 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 .\" ARE DISCLAIMED. IN NO EVENT SHALL BERKELEY SOFTWARE DESIGN, INC. BE LIABLE
25 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33 .\" $OpenBSD: login.conf.5,v 1.50 2012/11/25 21:18:13 jmc Exp $
34 .\" BSDI $From: login.conf.5,v 2.20 2000/06/26 14:50:38 prb Exp $
36 .Dd $Mdocdate: November 25 2012 $
41 .Nd login class capability database
47 file describes the various attributes of login classes.
48 A login class determines what styles of authentication are available
49 as well as session resource limits and environment setup.
50 While designed primarily for the
53 it is also used by other programs, e.g.,
55 to determine what means of authentication are available.
56 It is also used by programs, e.g.,
58 which need to set up a user environment.
64 is used for any user without a valid login class in
65 .Pa /etc/master.passwd .
69 files may wish to create a database version of the file,
70 .Pa /etc/login.conf.db ,
71 for improved performance.
72 Using a database version for small files does not result in a
73 performance improvement.
75 .Pa /etc/login.conf.db
78 the following command may be used:
80 .Dl # cap_mkdb /etc/login.conf
84 must be run after each edit of
86 to keep the database version in sync with the plain file.
90 for a description of the file layout.
93 file are either boolean or use a
95 to separate the capability from the value.
96 The types are described after the capability table.
97 .Bl -column "approve-service" "program" "blowfish,6" "Description"
98 .It Sy Name Ta Sy Type Ta Sy Default Ta Sy Description
100 .It approve Ta program Ta "" Ta
101 Default program to approve login.
104 .It approve- Ns Ar service Ta program Ta "" Ta
105 Program to approve login for
109 .It auth Ta list Ta Dv passwd Ta
110 Allowed authentication styles.
111 The first value is the default styles.
114 .It auth- Ns Ar type Ta list Ta "" Ta
115 Allowed authentication styles for the authentication type
119 .It classify Ta program Ta "" Ta
120 Classify type of login.
123 .It copyright Ta file Ta "" Ta
124 File containing additional copyright information.
127 .It coredumpsize Ta size Ta "" Ta
128 Maximum coredump size limit.
131 .It cputime Ta time Ta "" Ta
135 .It datasize Ta size Ta "" Ta
136 Maximum data size limit.
139 .It expire-warn Ta time Ta Dv 2w Ta
140 If the user's account will expire within this length of time then
141 warn the user of this.
144 .It filesize Ta size Ta "" Ta
145 Maximum file size limit.
148 .It hushlogin Ta bool Ta Dv false Ta
156 .It ignorenologin Ta bool Ta Dv false Ta
164 .It localcipher Ta string Ta blowfish,6 Ta
165 The cipher to use for local passwords.
168 .Dq newsalt,<rounds> ,
171 .Dq blowfish,<rounds>
174 means classic 56-bit DES.
177 the value of rounds is a 24-bit integer with a minimum of 7250 rounds.
180 the value can be between 4 and 31.
181 It specifies the base 2 logarithm of the number of rounds.
184 .It ypcipher Ta string Ta old Ta
185 The cipher to use for YP passwords.
186 The possible values are the same as for
190 .It login-backoff Ta number Ta 3 Ta
193 unsuccessful login attempts during a single session,
195 will start sleeping a bit in between attempts.
198 .It login-timeout Ta time Ta 300 Ta
199 Number of seconds before
201 times out at the password prompt.
202 Note that this setting is only valid for the
207 .It login-tries Ta number Ta 10 Ta
208 Number of tries a user gets to successfully login before
210 closes the connection.
213 .It stacksize Ta size Ta "" Ta
214 Maximum stack size limit.
217 .It maxproc Ta number Ta "" Ta
218 Maximum number of processes.
221 .It memorylocked Ta size Ta "" Ta
222 Maximum locked in core memory size limit.
225 .It memoryuse Ta size Ta "" Ta
226 Maximum in core memoryuse size limit.
229 .It minpasswordlen Ta number Ta 6 Ta
230 The minimum length a local password may be.
231 If a negative value or zero, no length restrictions are enforced.
237 .It nologin Ta file Ta "" Ta
238 If the file exists it will be displayed
239 and the login session will be terminated.
242 .It openfiles Ta number Ta "" Ta
243 Maximum number of open file descriptors per process.
246 .It password-dead Ta time Ta Dv 0 Ta
247 Length of time a password may be expired but not quite dead yet.
248 When set (for both the client and remote server machine when doing
249 remote authentication), a user is allowed to log in just one more
250 time after their password (but not account) has expired.
251 This allows a grace period for updating their password.
254 .It password-warn Ta time Ta Dv 2w Ta
255 If the user's password will expire within this length of time then
256 warn the user of this.
259 .It passwordcheck Ta program Ta "" Ta
260 An external program that checks the quality of the password.
261 The password is passed to the program on
263 An exit code of 0 indicates that the quality of the password is
264 sufficient, an exit code of 1 signals that the password failed the check.
267 .It passwordtime Ta time Ta "" Ta
268 The lifetime of a password in seconds, reset every time a user
269 changes their password.
270 When this value is exceeded the user will no longer be able to
273 option has been specified.
279 .It passwordtries Ta number Ta 3 Ta
280 The number of times the
282 utility enforces a check on the password.
283 If 0, the new password will only be accepted if it passes the password
287 .It path Ta path Ta value of Dv _PATH_DEFPATH Ta
291 .Pa /usr/include/paths.h .
294 .It priority Ta number Ta "" Ta
295 Initial priority (nice) level.
298 .It requirehome Ta bool Ta Dv false Ta
299 Require home directory to login.
302 .It setenv Ta envlist Ta "" Ta
303 A list of environment variables and associated values to be set for the class.
306 .It shell Ta program Ta "" Ta
307 Session shell to execute rather than the shell specified in the password file.
310 environment variable will contain the shell specified in the password file.
313 .It term Ta string Ta Dv su Ta
314 Default terminal type if not able to determine from other means.
317 .It umask Ta number Ta Dv 022 Ta
319 Should always have a leading
321 to ensure octal interpretation.
326 .It vmemoryuse Ta size Ta "" Ta
327 Maximum virtual memoryuse size limit.
330 .It welcome Ta file Ta Pa /etc/motd Ta
331 File containing welcome message.
334 The resource limit entries
335 .No ( Ns Va cputime , filesize , datasize , stacksize , coredumpsize ,
336 .Va memoryuse , memorylocked , maxproc ,
339 actually specify both the maximum and current limits (see
341 The current limit is the one normally used, although the user is permitted
342 to increase the current limit to the maximum limit.
343 The maximum and current limits may be specified individually by appending a
347 to the capability name (e.g.,
350 .Va openfiles-cur ) .
353 will never define capabilities which start with
357 these are reserved for external use (unless included through contributed
360 The argument types are defined as:
361 .Bl -tag -width programxx
364 A comma-separated list of environment variables of the form
365 .Ev variable Ns No = Ns value .
366 If no value is specified, the
371 in the path name is expanded to the user's home directory
372 if it is at the end of a string or is followed by a slash
374 or the user's login name.
377 in the path name is expanded to the user's login name.
380 Path name to a text file.
383 A comma-separated list of values.
389 implies the number is expressed in hexadecimal.
392 implies the number is expressed in octal.
393 Any other number is treated as decimal.
396 A space-separated list of path names.
397 Login name and directory are substituted as for
401 is only expanded at the beginning of a path name.
404 A path name to program.
409 which expresses a size.
410 By default, the size is specified in bytes.
411 It may have a trailing
418 to indicate that the value is in 512-byte blocks,
419 kilobytes, megabytes, gigabytes, or terrabytes, respectively.
423 A time may be expressed as a series of numbers which are added together.
424 Each number may have a trailing character to represent time units:
428 Indicates a number of 365 day years.
431 Indicates a number of 7 day weeks.
434 Indicates a number of 24 hour days.
437 Indicates a number of 60 minute hours.
440 Indicates a number of 60 second minutes.
443 Indicates a number of seconds.
446 For example, to indicate 1 and 1/2 hours, the following string could be used:
452 uses BSD Authentication, which is made up of a variety of
453 authentication styles.
454 The authentication styles currently provided are:
455 .Bl -tag -width krb5-or-pwdxx
458 Authenticate using an ActivCard token.
463 Change user's password.
468 Authenticate using a CRYPTOCard token.
473 Request a password and use it to request a ticket from the kerberos 5 server.
478 Request a password and first try the
480 authentication style and if that fails use the same password with the
482 authentication style.
484 .Xr login_krb5-or-pwd 8 .
487 Change user's local password.
489 .Xr login_lchpass 8 .
492 Request a password and check it against the password in the master.passwd file.
497 Normally linked to another authentication type, contact the radius server
498 to do authentication.
503 Request a password and reject any request.
508 Send a challenge and request a response, checking it
509 with S/Key (tm) authentication.
514 Authenticate using a SecureNet Key token.
519 Authenticate using a generic X9.9 token.
524 Authenticate using a Yubico YubiKey token.
526 .Xr login_yubikey 8 .
529 Local authentication styles may be added by creating a login script
530 for the style (see below).
531 To prevent collisions with future official BSD
532 Authentication style names, all local style names should start with a dash (-).
533 Current plans are for all official BSD Authentication style names to begin
534 with a lower case alphabetic character.
535 For example, if you have a new style you refer to as
537 then you should create an authentication script named
538 .Pa /usr/libexec/auth/login_-slick
541 When logging in via the
544 .Ar user Ns Li :-slick
547 Authentication requires several pieces of information:
548 .Bl -tag -width kerberosxx
551 The login class being used.
553 The type of service requesting authentication.
554 The service type is used to determine what information the authentication
555 program can provide to the user and what information the user can provide
556 to the authentication program.
560 is appropriate for most situations.
561 Two other service types,
565 are provided for use by programs like
569 If no service type is specified,
573 The authentication style being used.
575 The authentication type,
576 used to determine the available authentication styles.
578 The name of the user to authenticate.
579 The name may contain an instance, e.g.\&
581 as used by Kerberos authentication.
582 If the authentication style being used does not support such instances,
583 the request will fail.
586 The program requesting authentication must specify a username and an
587 authentication style.
590 requests a username from the user.
591 Users may enter usernames of the form
593 to optionally specify the authentication style.)
594 The requesting program may also specify the type of authentication
596 Most programs will only have a single type, if any at all, i.e.,
598 will always request the
600 type authentication, and
602 will always request the
607 utility is special in that it may select an authentication type based
608 on information found in the
610 file for the appropriate tty (see
613 The class to be used is normally determined by the
615 field in the password file (see
618 The class is used to look up a corresponding entry in the
621 If an authentication type is defined and a value for
623 exists in that entry,
624 it will be used as a list of potential authentication styles.
625 If an authentication type is not defined, or
627 is not specified for the class,
630 is used as the list of available authentication styles.
632 If the user did not specify an authentication style the first style
633 in the list of available styles is used.
634 If the user did specify an authentication style and the style is in the
635 list of available styles it will be used, otherwise the request is
638 For any given style, the program
639 .Pa /usr/libexec/auth/login_ Ns Va style
640 is used to perform the authentication.
641 The synopsis of this program is:
643 .Li /usr/libexec/auth/login_ Ns Va style
644 .Op Fl v Va name=value
650 option is used to specify arbitrary information to the authentication
657 program provides the following through the
660 .Bl -tag -width remote_addrxxx
662 The type of authentication to use.
664 The hostname provided to login by the
670 will place in the utmp file
671 for the remote hostname.
673 The local IP address given to
681 when a user's password has expired but the user is being given one last
682 chance to login and update the password.
684 This is a new login session (as opposed to a simple identity check).
686 The remote IP address given to
692 The style of authentication used for this user
693 (see approval scripts below).
698 program provides the following through the
701 .Bl -tag -width remote_addrxxx
703 Set to the name of the user being authenticated; used for Kerberos
710 to indicate if the user is in group wheel when they are trying to become root.
711 Some authentication types require the user to be in group wheel when using
714 program to become super user.
717 When the authentication program is executed,
718 the environment will only contain the values
719 .Ev PATH=/bin:/usr/bin
722 File descriptor 3 will be open for reading and writing.
723 The authentication program should write one or more of the following
724 strings to this file descriptor:
725 .Bl -tag -width authorize
728 The user has been authorized.
730 .It Li authorize secure
731 The user has been authorized and root should be allowed to
732 login even if this is not a secure terminal.
733 This should only be sent by authentication styles that are secure
737 Authorization is rejected.
738 This overrides any indication that the user was authorized (though
739 one would question the wisdom in sending both a
745 .It Li reject challenge
746 Authorization was rejected and a challenge has been made available
751 Authorization is rejected, but no error messages should be generated.
753 .It Li remove Va file
754 If the login session fails for any reason, remove
756 before termination (a kerberos ticket file, for example).
758 .It Li setenv Va name Va value
759 If the login session succeeds, the environment variable
761 should be set to the specified
764 .It Li unsetenv Va name
765 If the login session succeeds, the environment variable
769 .It Li value Va name Va value
770 Set the internal variable
776 should only contain printable characters.
777 Several \e sequences may be used to introduce non printing characters.
779 .Bl -tag -width indent
787 The character represented by the octal value
789 The value may be one, two, or three octal digits.
791 The string is replaced by the value of
793 This allows quoting an initial space or the \e character itself.
796 The following values are currently defined:
797 .Bl -tag -width indent
799 See section on challenges below.
801 If set, the value is the reason authentication failed.
802 The calling program may choose to display this when rejecting the user, but
803 display is not required.
807 In order for authentication to be successful,
808 the authentication program must exit with a value of 0 as well
813 statement on file descriptor 3.
815 An authentication program must not assume it will be called as root,
816 nor must it assume it will not be called as root.
817 If it needs special permissions to access files it should be setuid or
818 setgid to the appropriate user/group.
822 When an authentication program is called with a service of
824 it should do one of three things:
826 If this style of authentication supports challenge response
827 it should set the internal variable
829 to be the appropriate challenge for the user.
832 command listed above.
833 The program should also issue a
835 and then exit with a 0 status.
836 See the section on responses below.
838 If this style of authentication does not support challenge response,
841 service (described below) it should issue
843 and then exit with a 0 status.
845 If this style of authentication does not support the
847 service it should simply fail, complaining about an unknown service type.
848 It should exit with a non-zero status.
850 When an authentication program is called with a service of
852 and this style supports this mode of authentication,
853 it should read two null terminated strings from file descriptor 3.
854 The first string is a challenge that was issued to the user
858 The second string is the response the user gave (i.e., the password).
859 If the response is correct for the specified challenge, the authentication
860 should be accepted, else it should be rejected.
861 It is possible for the challenge to be any empty string, which implies
862 the calling program did first obtain a challenge prior to getting a
863 response from the user.
864 Not all authentication styles support empty challenges.
866 An approval program has the synopsis of:
867 .Bd -filled -offset indent
869 .Op Fl v Ar name=value
870 .Va username class service
873 Just as with an authentication program, file descriptor 3 will be
874 open for writing when the approval program is executed.
877 option is the same as in the authentication program.
878 Unlike an authentication program,
879 the approval program need not explicitly send an
884 it only need exit with a value of 0 or non-zero.
885 An exit value of 0 is equivalent to an
887 statement, and non-zero to a
890 This allows for simple programs which have no information to provide
891 other than approval or denial.
893 A classify program has the synopsis of:
894 .Bd -filled -offset indent
896 .Op Fl v Ar name=value
903 for a description of the
908 option is the same as for the authentication programs.
911 is the username passed to
915 The typical job of the classify program is to determine what authentication
916 type should actually be used, presumably based on the remote IP address.
917 It might also re-specify the hostname to be included in the
919 file, reject the login attempt outright,
920 or even print an additional login banner (e.g.,
923 The classify entry is only valid for the
925 class as it is used prior to knowing who the user is.
926 The classify script may pass environment variables or other commands
929 on file descriptor 3, just as an authentication program does.
934 are used to specify a new authentication type (the type must have the
936 .Li auth- Ns Ar type )
939 option to login, respectively.