1.\" Copyright (c) 2001 Mark R V Murray 2.\" All rights reserved. 3.\" Copyright (c) 2001 Networks Associates Technology, Inc. 4.\" All rights reserved. 5.\" 6.\" This software was developed for the FreeBSD Project by ThinkSec AS and 7.\" NAI Labs, the Security Research Division of Network Associates, Inc. 8.\" under DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"), as part of the 9.\" DARPA CHATS research program. 10.\" 11.\" Redistribution and use in source and binary forms, with or without 12.\" modification, are permitted provided that the following conditions 13.\" are met: 14.\" 1. Redistributions of source code must retain the above copyright 15.\" notice, this list of conditions and the following disclaimer. 16.\" 2. Redistributions in binary form must reproduce the above copyright 17.\" notice, this list of conditions and the following disclaimer in the 18.\" documentation and/or other materials provided with the distribution. 19.\" 3. The name of the author may not be used to endorse or promote 20.\" products derived from this software without specific prior written 21.\" permission. 22.\" 23.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 24.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 25.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 26.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 27.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 28.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 29.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 31.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 32.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 33.\" SUCH DAMAGE. 34.\" 35.\" $FreeBSD: head/lib/libpam/modules/pam_unix/pam_unix.8 227044 2011-11-02 23:40:21Z des $ 36.\" 37.Dd June 20, 2009 38.Dt PAM_UNIX 8 39.Os 40.Sh NAME 41.Nm pam_unix 42.Nd UNIX PAM module 43.Sh SYNOPSIS 44.Op Ar service-name 45.Ar module-type 46.Ar control-flag 47.Pa pam_unix 48.Op Ar options 49.Sh DESCRIPTION 50The 51.Ux 52authentication service module for PAM, 53.Nm 54provides functionality for three PAM categories: 55authentication, account management, and password management. 56In terms of the 57.Ar module-type 58parameter, they are the 59.Dq Li auth , 60.Dq Li account , 61and 62.Dq Li password 63features. 64It also provides a null function for session management. 65.Ss Eo 66.Ux 67Authentication Module 68.Ec 69The 70.Ux 71authentication component provides functions to verify the identity of 72a user 73.Pq Fn pam_sm_authenticate , 74which obtains the relevant 75.Xr passwd 5 76entry. 77It prompts the user for a password and verifies that this is correct with 78.Xr crypt 3 . 79.Pp 80The following options may be passed to the authentication module: 81.Bl -tag -width ".Cm use_first_pass" 82.It Cm debug 83.Xr syslog 3 84debugging information at 85.Dv LOG_DEBUG 86level. 87.It Cm use_first_pass 88If the authentication module is not the first in the stack, and a 89previous module obtained the user's password, that password is used to 90authenticate the user. 91If this fails, the authentication module returns failure without 92prompting the user for a password. 93This option has no effect if the authentication module is the first in 94the stack, or if no previous modules obtained the user's password. 95.It Cm try_first_pass 96This option is similar to the 97.Cm use_first_pass 98option, except that if the previously obtained password fails, the 99user is prompted for another password. 100.It Cm auth_as_self 101This option will require the user to authenticate themselves as 102themselves, not as the account they are attempting to access. 103This is primarily for services like 104.Xr su 1 , 105where the user's ability to retype their own password might be deemed 106sufficient. 107.It Cm nullok 108If the password database has no password for the entity being 109authenticated, then this option will forgo password prompting, and 110silently allow authentication to succeed. 111.Pp 112.Sy NOTE: 113If 114.Nm 115is invoked by a process that does not have the privileges required to 116access the password database (in most cases, this means root 117privileges), the 118.Cm nullok 119option may cause 120.Nm 121to allow any user to log in with any password. 122.It Cm local_pass 123Use only the local password database, even if NIS is in use. 124This will cause an authentication failure if the system is configured 125to only use NIS. 126.It Cm nis_pass 127Use only the NIS password database. 128This will cause an authentication failure if the system is not 129configured to use NIS. 130.El 131.Ss Eo 132.Ux 133Account Management Module 134.Ec 135The 136.Ux 137account management component provides a function to perform account 138management, 139.Fn pam_sm_acct_mgmt . 140The function verifies that the authenticated user is allowed to log 141into the local user account by checking the following criteria: 142.Bl -dash -offset indent 143.It 144locked status of the account compatible with 145.Xr pw 8 146.Cm lock ; 147.It 148the password expiry date from 149.Xr passwd 5 ; 150.It 151.Xr login.conf 5 152restrictions on the remote host, login time, and tty. 153.El 154.Pp 155The following options may be passed to the management module: 156.Bl -tag -width ".Cm use_first_pass" 157.It Cm debug 158.Xr syslog 3 159debugging information at 160.Dv LOG_DEBUG 161level. 162.El 163.Ss Eo 164.Ux 165Password Management Module 166.Ec 167The 168.Ux 169password management component provides a function to perform password 170management, 171.Fn pam_sm_chauthtok . 172The function changes 173the user's password. 174.Pp 175The following options may be passed to the password module: 176.Bl -tag -width ".Cm use_first_pass" 177.It Cm debug 178.Xr syslog 3 179debugging information at 180.Dv LOG_DEBUG 181level. 182.It Cm no_warn 183suppress warning messages to the user. 184These messages include reasons why the user's authentication attempt 185was declined. 186.It Cm local_pass 187forces the password module to change a local password in favour of a 188NIS one. 189.It Cm nis_pass 190forces the password module to change a NIS password in favour of a 191local one. 192.El 193.Sh FILES 194.Bl -tag -width ".Pa /etc/master.passwd" -compact 195.It Pa /etc/master.passwd 196default 197.Ux 198password database. 199.El 200.Sh SEE ALSO 201.Xr passwd 1 , 202.Xr getlogin 2 , 203.Xr crypt 3 , 204.Xr getpwent 3 , 205.Xr pam 3 , 206.Xr syslog 3 , 207.Xr nsswitch.conf 5 , 208.Xr passwd 5 , 209.Xr pw 8 , 210.Xr yp 8 211.Sh BUGS 212The 213.Nm 214module ignores the 215.Dv PAM_CHANGE_EXPIRED_AUTHTOK 216flag. 217