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. 108d65e5dfaSDag-Erling Smørgrav.It Cm local_pass 10984e3202fSDag-Erling SmørgravUse only the local password database, even if NIS is in use. 11084e3202fSDag-Erling SmørgravThis will cause an authentication failure if the system is configured 111d65e5dfaSDag-Erling Smørgravto only use NIS. 112d65e5dfaSDag-Erling Smørgrav.It Cm nis_pass 113d65e5dfaSDag-Erling SmørgravUse only the NIS password database. 11484e3202fSDag-Erling SmørgravThis will cause an authentication failure if the system is not 11584e3202fSDag-Erling Smørgravconfigured to use NIS. 1161642eb1aSMark Murray.El 11708ecaa10SRuslan Ermilov.Ss Ux Ss Account Management Module 1181642eb1aSMark MurrayThe 1191642eb1aSMark Murray.Ux 12084e3202fSDag-Erling Smørgravaccount management component provides a function to perform account 12184e3202fSDag-Erling Smørgravmanagement, 1221642eb1aSMark Murray.Fn pam_sm_acct_mgmt . 12384e3202fSDag-Erling SmørgravThe function verifies that the authenticated user is allowed to log 12484e3202fSDag-Erling Smørgravinto the local user account by checking the following criteria: 125cf21ead5SYaroslav Tykhiy.Bl -dash -offset indent 126cf21ead5SYaroslav Tykhiy.It 127cf21ead5SYaroslav Tykhiylocked status of the account compatible with 128cf21ead5SYaroslav Tykhiy.Xr pw 8 129cf21ead5SYaroslav Tykhiy.Cm lock ; 130cf21ead5SYaroslav Tykhiy.It 131cf21ead5SYaroslav Tykhiythe password expiry date from 132cf21ead5SYaroslav Tykhiy.Xr passwd 5 ; 133cf21ead5SYaroslav Tykhiy.It 134cf21ead5SYaroslav Tykhiy.Xr login.conf 5 135cf21ead5SYaroslav Tykhiyrestrictions on the remote host, login time, and tty. 136cf21ead5SYaroslav Tykhiy.El 1371642eb1aSMark Murray.Pp 1381642eb1aSMark MurrayThe following options may be passed to the management module: 139e8b02a42SRuslan Ermilov.Bl -tag -width ".Cm use_first_pass" 1401642eb1aSMark Murray.It Cm debug 1411642eb1aSMark Murray.Xr syslog 3 1421642eb1aSMark Murraydebugging information at 1431642eb1aSMark Murray.Dv LOG_DEBUG 1441642eb1aSMark Murraylevel. 1451642eb1aSMark Murray.El 1463d55a6c0SMark Murray.Ss Ux Ss Password Management Module 1473d55a6c0SMark MurrayThe 1483d55a6c0SMark Murray.Ux 14984e3202fSDag-Erling Smørgravpassword management component provides a function to perform password 15084e3202fSDag-Erling Smørgravmanagement, 1513d55a6c0SMark Murray.Fn pam_sm_chauthtok . 1523d55a6c0SMark MurrayThe function changes 1533d55a6c0SMark Murraythe user's password. 1543d55a6c0SMark Murray.Pp 1553d55a6c0SMark MurrayThe following options may be passed to the password module: 1563d55a6c0SMark Murray.Bl -tag -width ".Cm use_first_pass" 1573d55a6c0SMark Murray.It Cm debug 1583d55a6c0SMark Murray.Xr syslog 3 1593d55a6c0SMark Murraydebugging information at 1603d55a6c0SMark Murray.Dv LOG_DEBUG 1613d55a6c0SMark Murraylevel. 1623d55a6c0SMark Murray.It Cm no_warn 1633d55a6c0SMark Murraysuppress warning messages to the user. 16484e3202fSDag-Erling SmørgravThese messages include reasons why the user's authentication attempt 16584e3202fSDag-Erling Smørgravwas declined. 1663d55a6c0SMark Murray.It Cm local_pass 16784e3202fSDag-Erling Smørgravforces the password module to change a local password in favour of a 16884e3202fSDag-Erling SmørgravNIS one. 1693d55a6c0SMark Murray.It Cm nis_pass 17084e3202fSDag-Erling Smørgravforces the password module to change a NIS password in favour of a 17184e3202fSDag-Erling Smørgravlocal one. 1723d55a6c0SMark Murray.El 1731642eb1aSMark Murray.Sh FILES 174e8b02a42SRuslan Ermilov.Bl -tag -width ".Pa /etc/master.passwd" -compact 1751642eb1aSMark Murray.It Pa /etc/master.passwd 1761642eb1aSMark Murraydefault 1771642eb1aSMark Murray.Ux 1781642eb1aSMark Murraypassword database. 1791642eb1aSMark Murray.El 1801642eb1aSMark Murray.Sh SEE ALSO 181d65e5dfaSDag-Erling Smørgrav.Xr passwd 1 , 182945b9f4dSRuslan Ermilov.Xr getlogin 2 , 183945b9f4dSRuslan Ermilov.Xr crypt 3 , 184945b9f4dSRuslan Ermilov.Xr getpwent 3 , 185d65e5dfaSDag-Erling Smørgrav.Xr syslog 3 , 186945b9f4dSRuslan Ermilov.Xr nsswitch.conf 5 , 187945b9f4dSRuslan Ermilov.Xr passwd 5 , 1883ac17febSRuslan Ermilov.Xr pam 8 , 189cf21ead5SYaroslav Tykhiy.Xr pw 8 , 1903ac17febSRuslan Ermilov.Xr yp 8 191