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.\" 35c98db407SSascha Wildner.\" $FreeBSD: head/lib/libpam/modules/pam_unix/pam_unix.8 227044 2011-11-02 23:40:21Z des $ 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. 65*c9c6988bSSascha Wildner.Ss Eo 66*c9c6988bSSascha Wildner.Ux 67*c9c6988bSSascha WildnerAuthentication Module 68*c9c6988bSSascha Wildner.Ec 69242be47eSzrjThe 70242be47eSzrj.Ux 71242be47eSzrjauthentication component provides functions to verify the identity of 72242be47eSzrja user 73242be47eSzrj.Pq Fn pam_sm_authenticate , 74242be47eSzrjwhich obtains the relevant 75242be47eSzrj.Xr passwd 5 76242be47eSzrjentry. 77242be47eSzrjIt prompts the user for a password and verifies that this is correct with 78242be47eSzrj.Xr crypt 3 . 79242be47eSzrj.Pp 80242be47eSzrjThe following options may be passed to the authentication module: 81242be47eSzrj.Bl -tag -width ".Cm use_first_pass" 82242be47eSzrj.It Cm debug 83242be47eSzrj.Xr syslog 3 84242be47eSzrjdebugging information at 85242be47eSzrj.Dv LOG_DEBUG 86242be47eSzrjlevel. 87242be47eSzrj.It Cm use_first_pass 88242be47eSzrjIf the authentication module is not the first in the stack, and a 89242be47eSzrjprevious module obtained the user's password, that password is used to 90242be47eSzrjauthenticate the user. 91242be47eSzrjIf this fails, the authentication module returns failure without 92242be47eSzrjprompting the user for a password. 93242be47eSzrjThis option has no effect if the authentication module is the first in 94242be47eSzrjthe stack, or if no previous modules obtained the user's password. 95242be47eSzrj.It Cm try_first_pass 96242be47eSzrjThis option is similar to the 97242be47eSzrj.Cm use_first_pass 98242be47eSzrjoption, except that if the previously obtained password fails, the 99242be47eSzrjuser is prompted for another password. 100242be47eSzrj.It Cm auth_as_self 101242be47eSzrjThis option will require the user to authenticate themselves as 102242be47eSzrjthemselves, not as the account they are attempting to access. 103242be47eSzrjThis is primarily for services like 104242be47eSzrj.Xr su 1 , 105242be47eSzrjwhere the user's ability to retype their own password might be deemed 106242be47eSzrjsufficient. 107242be47eSzrj.It Cm nullok 108242be47eSzrjIf the password database has no password for the entity being 109242be47eSzrjauthenticated, then this option will forgo password prompting, and 110242be47eSzrjsilently allow authentication to succeed. 111242be47eSzrj.Pp 112242be47eSzrj.Sy NOTE: 113242be47eSzrjIf 114242be47eSzrj.Nm 115242be47eSzrjis invoked by a process that does not have the privileges required to 116242be47eSzrjaccess the password database (in most cases, this means root 117242be47eSzrjprivileges), the 118242be47eSzrj.Cm nullok 119242be47eSzrjoption may cause 120242be47eSzrj.Nm 121242be47eSzrjto allow any user to log in with any password. 122242be47eSzrj.It Cm local_pass 123242be47eSzrjUse only the local password database, even if NIS is in use. 124242be47eSzrjThis will cause an authentication failure if the system is configured 125242be47eSzrjto only use NIS. 126242be47eSzrj.It Cm nis_pass 127242be47eSzrjUse only the NIS password database. 128242be47eSzrjThis will cause an authentication failure if the system is not 129242be47eSzrjconfigured to use NIS. 130242be47eSzrj.El 131*c9c6988bSSascha Wildner.Ss Eo 132*c9c6988bSSascha Wildner.Ux 133*c9c6988bSSascha WildnerAccount Management Module 134*c9c6988bSSascha Wildner.Ec 135242be47eSzrjThe 136242be47eSzrj.Ux 137242be47eSzrjaccount management component provides a function to perform account 138242be47eSzrjmanagement, 139242be47eSzrj.Fn pam_sm_acct_mgmt . 140242be47eSzrjThe function verifies that the authenticated user is allowed to log 141242be47eSzrjinto the local user account by checking the following criteria: 142242be47eSzrj.Bl -dash -offset indent 143242be47eSzrj.It 144242be47eSzrjlocked status of the account compatible with 145242be47eSzrj.Xr pw 8 146242be47eSzrj.Cm lock ; 147242be47eSzrj.It 148242be47eSzrjthe password expiry date from 149242be47eSzrj.Xr passwd 5 ; 150242be47eSzrj.It 151242be47eSzrj.Xr login.conf 5 152242be47eSzrjrestrictions on the remote host, login time, and tty. 153242be47eSzrj.El 154242be47eSzrj.Pp 155242be47eSzrjThe following options may be passed to the management module: 156242be47eSzrj.Bl -tag -width ".Cm use_first_pass" 157242be47eSzrj.It Cm debug 158242be47eSzrj.Xr syslog 3 159242be47eSzrjdebugging information at 160242be47eSzrj.Dv LOG_DEBUG 161242be47eSzrjlevel. 162242be47eSzrj.El 163*c9c6988bSSascha Wildner.Ss Eo 164*c9c6988bSSascha Wildner.Ux 165*c9c6988bSSascha WildnerPassword Management Module 166*c9c6988bSSascha Wildner.Ec 167242be47eSzrjThe 168242be47eSzrj.Ux 169242be47eSzrjpassword management component provides a function to perform password 170242be47eSzrjmanagement, 171242be47eSzrj.Fn pam_sm_chauthtok . 172242be47eSzrjThe function changes 173242be47eSzrjthe user's password. 174242be47eSzrj.Pp 175242be47eSzrjThe following options may be passed to the password module: 176242be47eSzrj.Bl -tag -width ".Cm use_first_pass" 177242be47eSzrj.It Cm debug 178242be47eSzrj.Xr syslog 3 179242be47eSzrjdebugging information at 180242be47eSzrj.Dv LOG_DEBUG 181242be47eSzrjlevel. 182242be47eSzrj.It Cm no_warn 183242be47eSzrjsuppress warning messages to the user. 184242be47eSzrjThese messages include reasons why the user's authentication attempt 185242be47eSzrjwas declined. 186242be47eSzrj.It Cm local_pass 187242be47eSzrjforces the password module to change a local password in favour of a 188242be47eSzrjNIS one. 189242be47eSzrj.It Cm nis_pass 190242be47eSzrjforces the password module to change a NIS password in favour of a 191242be47eSzrjlocal one. 192242be47eSzrj.El 193242be47eSzrj.Sh FILES 194242be47eSzrj.Bl -tag -width ".Pa /etc/master.passwd" -compact 195242be47eSzrj.It Pa /etc/master.passwd 196242be47eSzrjdefault 197242be47eSzrj.Ux 198242be47eSzrjpassword database. 199242be47eSzrj.El 200242be47eSzrj.Sh SEE ALSO 201242be47eSzrj.Xr passwd 1 , 202242be47eSzrj.Xr getlogin 2 , 203242be47eSzrj.Xr crypt 3 , 204242be47eSzrj.Xr getpwent 3 , 205dfc0c85aSSascha Wildner.Xr pam 3 , 206242be47eSzrj.Xr syslog 3 , 207242be47eSzrj.Xr nsswitch.conf 5 , 208242be47eSzrj.Xr passwd 5 , 209242be47eSzrj.Xr pw 8 , 210242be47eSzrj.Xr yp 8 211242be47eSzrj.Sh BUGS 212242be47eSzrjThe 213242be47eSzrj.Nm 214242be47eSzrjmodule ignores the 215242be47eSzrj.Dv PAM_CHANGE_EXPIRED_AUTHTOK 216242be47eSzrjflag. 217