1242be47eSzrj.\" Copyright (c) 2001 Mark R V Murray 2242be47eSzrj.\" All rights reserved. 3242be47eSzrj.\" Copyright (c) 2001 Networks Associates Technology, Inc. 4242be47eSzrj.\" All rights reserved. 5242be47eSzrj.\" 6242be47eSzrj.\" This software was developed for the FreeBSD Project by ThinkSec AS and 7242be47eSzrj.\" NAI Labs, the Security Research Division of Network Associates, Inc. 8242be47eSzrj.\" under DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"), as part of the 9242be47eSzrj.\" DARPA CHATS research program. 10242be47eSzrj.\" 11242be47eSzrj.\" Redistribution and use in source and binary forms, with or without 12242be47eSzrj.\" modification, are permitted provided that the following conditions 13242be47eSzrj.\" are met: 14242be47eSzrj.\" 1. Redistributions of source code must retain the above copyright 15242be47eSzrj.\" notice, this list of conditions and the following disclaimer. 16242be47eSzrj.\" 2. Redistributions in binary form must reproduce the above copyright 17242be47eSzrj.\" notice, this list of conditions and the following disclaimer in the 18242be47eSzrj.\" documentation and/or other materials provided with the distribution. 19242be47eSzrj.\" 3. The name of the author may not be used to endorse or promote 20242be47eSzrj.\" products derived from this software without specific prior written 21242be47eSzrj.\" permission. 22242be47eSzrj.\" 23242be47eSzrj.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 24242be47eSzrj.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 25242be47eSzrj.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 26242be47eSzrj.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 27242be47eSzrj.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 28242be47eSzrj.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 29242be47eSzrj.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30242be47eSzrj.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 31242be47eSzrj.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 32242be47eSzrj.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 33242be47eSzrj.\" SUCH DAMAGE. 34242be47eSzrj.\" 35242be47eSzrj.\" $FreeBSD: src/lib/libpam/modules/pam_unix/pam_unix.8,v 1.17 2011/11/02 23:40:21 des Exp $ 36242be47eSzrj.\" 37242be47eSzrj.Dd June 20, 2009 38242be47eSzrj.Dt PAM_UNIX 8 39242be47eSzrj.Os 40242be47eSzrj.Sh NAME 41242be47eSzrj.Nm pam_unix 42242be47eSzrj.Nd UNIX PAM module 43242be47eSzrj.Sh SYNOPSIS 44242be47eSzrj.Op Ar service-name 45242be47eSzrj.Ar module-type 46242be47eSzrj.Ar control-flag 47242be47eSzrj.Pa pam_unix 48242be47eSzrj.Op Ar options 49242be47eSzrj.Sh DESCRIPTION 50242be47eSzrjThe 51242be47eSzrj.Ux 52242be47eSzrjauthentication service module for PAM, 53242be47eSzrj.Nm 54242be47eSzrjprovides functionality for three PAM categories: 55242be47eSzrjauthentication, account management, and password management. 56242be47eSzrjIn terms of the 57242be47eSzrj.Ar module-type 58242be47eSzrjparameter, they are the 59242be47eSzrj.Dq Li auth , 60242be47eSzrj.Dq Li account , 61242be47eSzrjand 62242be47eSzrj.Dq Li password 63242be47eSzrjfeatures. 64242be47eSzrjIt also provides a null function for session management. 65242be47eSzrj.Ss Ux Ss Authentication Module 66242be47eSzrjThe 67242be47eSzrj.Ux 68242be47eSzrjauthentication component provides functions to verify the identity of 69242be47eSzrja user 70242be47eSzrj.Pq Fn pam_sm_authenticate , 71242be47eSzrjwhich obtains the relevant 72242be47eSzrj.Xr passwd 5 73242be47eSzrjentry. 74242be47eSzrjIt prompts the user for a password and verifies that this is correct with 75242be47eSzrj.Xr crypt 3 . 76242be47eSzrj.Pp 77242be47eSzrjThe following options may be passed to the authentication module: 78242be47eSzrj.Bl -tag -width ".Cm use_first_pass" 79242be47eSzrj.It Cm debug 80242be47eSzrj.Xr syslog 3 81242be47eSzrjdebugging information at 82242be47eSzrj.Dv LOG_DEBUG 83242be47eSzrjlevel. 84242be47eSzrj.It Cm use_first_pass 85242be47eSzrjIf the authentication module is not the first in the stack, and a 86242be47eSzrjprevious module obtained the user's password, that password is used to 87242be47eSzrjauthenticate the user. 88242be47eSzrjIf this fails, the authentication module returns failure without 89242be47eSzrjprompting the user for a password. 90242be47eSzrjThis option has no effect if the authentication module is the first in 91242be47eSzrjthe stack, or if no previous modules obtained the user's password. 92242be47eSzrj.It Cm try_first_pass 93242be47eSzrjThis option is similar to the 94242be47eSzrj.Cm use_first_pass 95242be47eSzrjoption, except that if the previously obtained password fails, the 96242be47eSzrjuser is prompted for another password. 97242be47eSzrj.It Cm auth_as_self 98242be47eSzrjThis option will require the user to authenticate themselves as 99242be47eSzrjthemselves, not as the account they are attempting to access. 100242be47eSzrjThis is primarily for services like 101242be47eSzrj.Xr su 1 , 102242be47eSzrjwhere the user's ability to retype their own password might be deemed 103242be47eSzrjsufficient. 104242be47eSzrj.It Cm nullok 105242be47eSzrjIf the password database has no password for the entity being 106242be47eSzrjauthenticated, then this option will forgo password prompting, and 107242be47eSzrjsilently allow authentication to succeed. 108242be47eSzrj.Pp 109242be47eSzrj.Sy NOTE: 110242be47eSzrjIf 111242be47eSzrj.Nm 112242be47eSzrjis invoked by a process that does not have the privileges required to 113242be47eSzrjaccess the password database (in most cases, this means root 114242be47eSzrjprivileges), the 115242be47eSzrj.Cm nullok 116242be47eSzrjoption may cause 117242be47eSzrj.Nm 118242be47eSzrjto allow any user to log in with any password. 119242be47eSzrj.It Cm local_pass 120242be47eSzrjUse only the local password database, even if NIS is in use. 121242be47eSzrjThis will cause an authentication failure if the system is configured 122242be47eSzrjto only use NIS. 123242be47eSzrj.It Cm nis_pass 124242be47eSzrjUse only the NIS password database. 125242be47eSzrjThis will cause an authentication failure if the system is not 126242be47eSzrjconfigured to use NIS. 127242be47eSzrj.El 128242be47eSzrj.Ss Ux Ss Account Management Module 129242be47eSzrjThe 130242be47eSzrj.Ux 131242be47eSzrjaccount management component provides a function to perform account 132242be47eSzrjmanagement, 133242be47eSzrj.Fn pam_sm_acct_mgmt . 134242be47eSzrjThe function verifies that the authenticated user is allowed to log 135242be47eSzrjinto the local user account by checking the following criteria: 136242be47eSzrj.Bl -dash -offset indent 137242be47eSzrj.It 138242be47eSzrjlocked status of the account compatible with 139242be47eSzrj.Xr pw 8 140242be47eSzrj.Cm lock ; 141242be47eSzrj.It 142242be47eSzrjthe password expiry date from 143242be47eSzrj.Xr passwd 5 ; 144242be47eSzrj.It 145242be47eSzrj.Xr login.conf 5 146242be47eSzrjrestrictions on the remote host, login time, and tty. 147242be47eSzrj.El 148242be47eSzrj.Pp 149242be47eSzrjThe following options may be passed to the management module: 150242be47eSzrj.Bl -tag -width ".Cm use_first_pass" 151242be47eSzrj.It Cm debug 152242be47eSzrj.Xr syslog 3 153242be47eSzrjdebugging information at 154242be47eSzrj.Dv LOG_DEBUG 155242be47eSzrjlevel. 156242be47eSzrj.El 157242be47eSzrj.Ss Ux Ss Password Management Module 158242be47eSzrjThe 159242be47eSzrj.Ux 160242be47eSzrjpassword management component provides a function to perform password 161242be47eSzrjmanagement, 162242be47eSzrj.Fn pam_sm_chauthtok . 163242be47eSzrjThe function changes 164242be47eSzrjthe user's password. 165242be47eSzrj.Pp 166242be47eSzrjThe following options may be passed to the password module: 167242be47eSzrj.Bl -tag -width ".Cm use_first_pass" 168242be47eSzrj.It Cm debug 169242be47eSzrj.Xr syslog 3 170242be47eSzrjdebugging information at 171242be47eSzrj.Dv LOG_DEBUG 172242be47eSzrjlevel. 173242be47eSzrj.It Cm no_warn 174242be47eSzrjsuppress warning messages to the user. 175242be47eSzrjThese messages include reasons why the user's authentication attempt 176242be47eSzrjwas declined. 177242be47eSzrj.It Cm local_pass 178242be47eSzrjforces the password module to change a local password in favour of a 179242be47eSzrjNIS one. 180242be47eSzrj.It Cm nis_pass 181242be47eSzrjforces the password module to change a NIS password in favour of a 182242be47eSzrjlocal one. 183242be47eSzrj.El 184242be47eSzrj.Sh FILES 185242be47eSzrj.Bl -tag -width ".Pa /etc/master.passwd" -compact 186242be47eSzrj.It Pa /etc/master.passwd 187242be47eSzrjdefault 188242be47eSzrj.Ux 189242be47eSzrjpassword database. 190242be47eSzrj.El 191242be47eSzrj.Sh SEE ALSO 192242be47eSzrj.Xr passwd 1 , 193242be47eSzrj.Xr getlogin 2 , 194242be47eSzrj.Xr crypt 3 , 195242be47eSzrj.Xr getpwent 3 , 196*dfc0c85aSSascha Wildner.Xr pam 3 , 197242be47eSzrj.Xr syslog 3 , 198242be47eSzrj.Xr nsswitch.conf 5 , 199242be47eSzrj.Xr passwd 5 , 200242be47eSzrj.Xr pw 8 , 201242be47eSzrj.Xr yp 8 202242be47eSzrj.Sh BUGS 203242be47eSzrjThe 204242be47eSzrj.Nm 205242be47eSzrjmodule ignores the 206242be47eSzrj.Dv PAM_CHANGE_EXPIRED_AUTHTOK 207242be47eSzrjflag. 208