11642eb1aSMark Murray.\" Copyright (c) 2001 Mark R V Murray 21642eb1aSMark Murray.\" All rights reserved. 3f03a4b81SDag-Erling Smørgrav.\" Copyright (c) 2001 Networks Associates Technology, Inc. 4d65e5dfaSDag-Erling Smørgrav.\" All rights reserved. 5d65e5dfaSDag-Erling Smørgrav.\" 6d65e5dfaSDag-Erling Smørgrav.\" This software was developed for the FreeBSD Project by ThinkSec AS and 7d65e5dfaSDag-Erling Smørgrav.\" NAI Labs, the Security Research Division of Network Associates, Inc. 8d65e5dfaSDag-Erling Smørgrav.\" under DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"), as part of the 9d65e5dfaSDag-Erling Smørgrav.\" DARPA CHATS research program. 101642eb1aSMark Murray.\" 111642eb1aSMark Murray.\" Redistribution and use in source and binary forms, with or without 121642eb1aSMark Murray.\" modification, are permitted provided that the following conditions 131642eb1aSMark Murray.\" are met: 141642eb1aSMark Murray.\" 1. Redistributions of source code must retain the above copyright 151642eb1aSMark Murray.\" notice, this list of conditions and the following disclaimer. 161642eb1aSMark Murray.\" 2. Redistributions in binary form must reproduce the above copyright 171642eb1aSMark Murray.\" notice, this list of conditions and the following disclaimer in the 181642eb1aSMark Murray.\" documentation and/or other materials provided with the distribution. 19d65e5dfaSDag-Erling Smørgrav.\" 3. The name of the author may not be used to endorse or promote 20d65e5dfaSDag-Erling Smørgrav.\" products derived from this software without specific prior written 21d65e5dfaSDag-Erling Smørgrav.\" permission. 221642eb1aSMark Murray.\" 231642eb1aSMark Murray.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 241642eb1aSMark Murray.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 251642eb1aSMark Murray.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 261642eb1aSMark Murray.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 271642eb1aSMark Murray.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 281642eb1aSMark Murray.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 291642eb1aSMark Murray.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 301642eb1aSMark Murray.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 311642eb1aSMark Murray.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 321642eb1aSMark Murray.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 331642eb1aSMark Murray.\" SUCH DAMAGE. 341642eb1aSMark Murray.\" 351642eb1aSMark Murray.\" $FreeBSD$ 361642eb1aSMark Murray.\" 37e83105d1SDag-Erling Smørgrav.Dd June 20, 2009 381642eb1aSMark Murray.Dt PAM_UNIX 8 391642eb1aSMark Murray.Os 401642eb1aSMark Murray.Sh NAME 411642eb1aSMark Murray.Nm pam_unix 421642eb1aSMark Murray.Nd UNIX PAM module 431642eb1aSMark Murray.Sh SYNOPSIS 441642eb1aSMark Murray.Op Ar service-name 451642eb1aSMark Murray.Ar module-type 461642eb1aSMark Murray.Ar control-flag 471642eb1aSMark Murray.Pa pam_unix 481642eb1aSMark Murray.Op Ar options 491642eb1aSMark Murray.Sh DESCRIPTION 501642eb1aSMark MurrayThe 511642eb1aSMark Murray.Ux 521642eb1aSMark Murrayauthentication service module for PAM, 531642eb1aSMark Murray.Nm 545429f490SRuslan Ermilovprovides functionality for three PAM categories: 5584e3202fSDag-Erling Smørgravauthentication, account management, and password management. 561642eb1aSMark MurrayIn terms of the 571642eb1aSMark Murray.Ar module-type 581642eb1aSMark Murrayparameter, they are the 595429f490SRuslan Ermilov.Dq Li auth , 605429f490SRuslan Ermilov.Dq Li account , 611642eb1aSMark Murrayand 625429f490SRuslan Ermilov.Dq Li password 631642eb1aSMark Murrayfeatures. 641642eb1aSMark MurrayIt also provides a null function for session management. 6508ecaa10SRuslan Ermilov.Ss Ux Ss Authentication Module 661642eb1aSMark MurrayThe 671642eb1aSMark Murray.Ux 6884e3202fSDag-Erling Smørgravauthentication component provides functions to verify the identity of 6984e3202fSDag-Erling Smørgrava user 701642eb1aSMark Murray.Pq Fn pam_sm_authenticate , 711642eb1aSMark Murraywhich obtains the relevant 721642eb1aSMark Murray.Xr passwd 5 731642eb1aSMark Murrayentry. 7484e3202fSDag-Erling SmørgravIt prompts the user for a password and verifies that this is correct with 751642eb1aSMark Murray.Xr crypt 3 . 761642eb1aSMark Murray.Pp 771642eb1aSMark MurrayThe following options may be passed to the authentication module: 78e8b02a42SRuslan Ermilov.Bl -tag -width ".Cm use_first_pass" 791642eb1aSMark Murray.It Cm debug 801642eb1aSMark Murray.Xr syslog 3 811642eb1aSMark Murraydebugging information at 821642eb1aSMark Murray.Dv LOG_DEBUG 831642eb1aSMark Murraylevel. 841642eb1aSMark Murray.It Cm use_first_pass 8584e3202fSDag-Erling SmørgravIf the authentication module is not the first in the stack, and a 8684e3202fSDag-Erling Smørgravprevious module obtained the user's password, that password is used to 8784e3202fSDag-Erling Smørgravauthenticate the user. 8884e3202fSDag-Erling SmørgravIf this fails, the authentication module returns failure without 8984e3202fSDag-Erling Smørgravprompting the user for a password. 9084e3202fSDag-Erling SmørgravThis option has no effect if the authentication module is the first in 9184e3202fSDag-Erling Smørgravthe stack, or if no previous modules obtained the user's password. 921642eb1aSMark Murray.It Cm try_first_pass 931642eb1aSMark MurrayThis option is similar to the 941642eb1aSMark Murray.Cm use_first_pass 9584e3202fSDag-Erling Smørgravoption, except that if the previously obtained password fails, the 9684e3202fSDag-Erling Smørgravuser is prompted for another password. 971642eb1aSMark Murray.It Cm auth_as_self 9884e3202fSDag-Erling SmørgravThis option will require the user to authenticate themselves as 9984e3202fSDag-Erling Smørgravthemselves, not as the account they are attempting to access. 1001642eb1aSMark MurrayThis is primarily for services like 1011642eb1aSMark Murray.Xr su 1 , 10284e3202fSDag-Erling Smørgravwhere the user's ability to retype their own password might be deemed 10384e3202fSDag-Erling Smørgravsufficient. 1041642eb1aSMark Murray.It Cm nullok 10584e3202fSDag-Erling SmørgravIf the password database has no password for the entity being 10684e3202fSDag-Erling Smørgravauthenticated, then this option will forgo password prompting, and 10784e3202fSDag-Erling Smørgravsilently allow authentication to succeed. 10813e1b162SDag-Erling Smørgrav.Pp 10913e1b162SDag-Erling Smørgrav.Sy NOTE: 11013e1b162SDag-Erling SmørgravIf 11113e1b162SDag-Erling Smørgrav.Nm 11213e1b162SDag-Erling Smørgravis invoked by a process that does not have the privileges required to 11313e1b162SDag-Erling Smørgravaccess the password database (in most cases, this means root 11413e1b162SDag-Erling Smørgravprivileges), the 11513e1b162SDag-Erling Smørgrav.Cm nullok 11613e1b162SDag-Erling Smørgravoption may cause 11713e1b162SDag-Erling Smørgrav.Nm 11813e1b162SDag-Erling Smørgravto allow any user to log in with any password. 119d65e5dfaSDag-Erling Smørgrav.It Cm local_pass 12084e3202fSDag-Erling SmørgravUse only the local password database, even if NIS is in use. 12184e3202fSDag-Erling SmørgravThis will cause an authentication failure if the system is configured 122d65e5dfaSDag-Erling Smørgravto only use NIS. 123d65e5dfaSDag-Erling Smørgrav.It Cm nis_pass 124d65e5dfaSDag-Erling SmørgravUse only the NIS password database. 12584e3202fSDag-Erling SmørgravThis will cause an authentication failure if the system is not 12684e3202fSDag-Erling Smørgravconfigured to use NIS. 1271642eb1aSMark Murray.El 12808ecaa10SRuslan Ermilov.Ss Ux Ss Account Management Module 1291642eb1aSMark MurrayThe 1301642eb1aSMark Murray.Ux 13184e3202fSDag-Erling Smørgravaccount management component provides a function to perform account 13284e3202fSDag-Erling Smørgravmanagement, 1331642eb1aSMark Murray.Fn pam_sm_acct_mgmt . 13484e3202fSDag-Erling SmørgravThe function verifies that the authenticated user is allowed to log 13584e3202fSDag-Erling Smørgravinto the local user account by checking the following criteria: 136cf21ead5SYaroslav Tykhiy.Bl -dash -offset indent 137cf21ead5SYaroslav Tykhiy.It 138cf21ead5SYaroslav Tykhiylocked status of the account compatible with 139cf21ead5SYaroslav Tykhiy.Xr pw 8 140cf21ead5SYaroslav Tykhiy.Cm lock ; 141cf21ead5SYaroslav Tykhiy.It 142cf21ead5SYaroslav Tykhiythe password expiry date from 143cf21ead5SYaroslav Tykhiy.Xr passwd 5 ; 144cf21ead5SYaroslav Tykhiy.It 145cf21ead5SYaroslav Tykhiy.Xr login.conf 5 146cf21ead5SYaroslav Tykhiyrestrictions on the remote host, login time, and tty. 147cf21ead5SYaroslav Tykhiy.El 1481642eb1aSMark Murray.Pp 1491642eb1aSMark MurrayThe following options may be passed to the management module: 150e8b02a42SRuslan Ermilov.Bl -tag -width ".Cm use_first_pass" 1511642eb1aSMark Murray.It Cm debug 1521642eb1aSMark Murray.Xr syslog 3 1531642eb1aSMark Murraydebugging information at 1541642eb1aSMark Murray.Dv LOG_DEBUG 1551642eb1aSMark Murraylevel. 1561642eb1aSMark Murray.El 1573d55a6c0SMark Murray.Ss Ux Ss Password Management Module 1583d55a6c0SMark MurrayThe 1593d55a6c0SMark Murray.Ux 16084e3202fSDag-Erling Smørgravpassword management component provides a function to perform password 16184e3202fSDag-Erling Smørgravmanagement, 1623d55a6c0SMark Murray.Fn pam_sm_chauthtok . 1633d55a6c0SMark MurrayThe function changes 1643d55a6c0SMark Murraythe user's password. 1653d55a6c0SMark Murray.Pp 1663d55a6c0SMark MurrayThe following options may be passed to the password module: 1673d55a6c0SMark Murray.Bl -tag -width ".Cm use_first_pass" 1683d55a6c0SMark Murray.It Cm debug 1693d55a6c0SMark Murray.Xr syslog 3 1703d55a6c0SMark Murraydebugging information at 1713d55a6c0SMark Murray.Dv LOG_DEBUG 1723d55a6c0SMark Murraylevel. 1733d55a6c0SMark Murray.It Cm no_warn 1743d55a6c0SMark Murraysuppress warning messages to the user. 17584e3202fSDag-Erling SmørgravThese messages include reasons why the user's authentication attempt 17684e3202fSDag-Erling Smørgravwas declined. 1773d55a6c0SMark Murray.It Cm local_pass 17884e3202fSDag-Erling Smørgravforces the password module to change a local password in favour of a 17984e3202fSDag-Erling SmørgravNIS one. 1803d55a6c0SMark Murray.It Cm nis_pass 18184e3202fSDag-Erling Smørgravforces the password module to change a NIS password in favour of a 18284e3202fSDag-Erling Smørgravlocal one. 1833d55a6c0SMark Murray.El 1841642eb1aSMark Murray.Sh FILES 185e8b02a42SRuslan Ermilov.Bl -tag -width ".Pa /etc/master.passwd" -compact 1861642eb1aSMark Murray.It Pa /etc/master.passwd 1871642eb1aSMark Murraydefault 1881642eb1aSMark Murray.Ux 1891642eb1aSMark Murraypassword database. 1901642eb1aSMark Murray.El 1911642eb1aSMark Murray.Sh SEE ALSO 192d65e5dfaSDag-Erling Smørgrav.Xr passwd 1 , 193945b9f4dSRuslan Ermilov.Xr getlogin 2 , 194945b9f4dSRuslan Ermilov.Xr crypt 3 , 195945b9f4dSRuslan Ermilov.Xr getpwent 3 , 196d65e5dfaSDag-Erling Smørgrav.Xr syslog 3 , 197945b9f4dSRuslan Ermilov.Xr nsswitch.conf 5 , 198945b9f4dSRuslan Ermilov.Xr passwd 5 , 1993ac17febSRuslan Ermilov.Xr pam 8 , 200cf21ead5SYaroslav Tykhiy.Xr pw 8 , 2013ac17febSRuslan Ermilov.Xr yp 8 202*23b8f4d8SDag-Erling Smørgrav.Sh BUGS 203*23b8f4d8SDag-Erling SmørgravThe 204*23b8f4d8SDag-Erling Smørgrav.Nm 205*23b8f4d8SDag-Erling Smørgravmodule ignores the 206*23b8f4d8SDag-Erling Smørgrav.Dv PAM_CHANGE_EXPIRED_AUTHTOK 207*23b8f4d8SDag-Erling Smørgravflag. 208