1.\" Copyright (c) 2001 Mark R V Murray 2.\" All rights reserved. 3.\" Copyright (c) 2001-2003 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$ 36.\" 37.Dd November 26, 2001 38.Dt PAM_SSH 8 39.Os 40.Sh NAME 41.Nm pam_ssh 42.Nd authentication and session management with SSH private keys 43.Sh SYNOPSIS 44.Op Ar service-name 45.Ar module-type 46.Ar control-flag 47.Pa pam_ssh 48.Op Ar options 49.Sh DESCRIPTION 50The 51SSH 52authentication service module for PAM, 53.Nm 54provides functionality for two PAM categories: 55authentication 56and session management. 57In terms of the 58.Ar module-type 59parameter, they are the 60.Dq Li auth 61and 62.Dq Li session 63features. 64.Ss SSH Authentication Module 65The 66SSH 67authentication component 68provides a function to verify the identity of a user 69.Pq Fn pam_sm_authenticate , 70by prompting the user for a passphrase and verifying that it can 71decrypt the target user's SSH key using that passphrase. 72.Pp 73The following options may be passed to the authentication module: 74.Bl -tag -width ".Cm use_first_pass" 75.It Cm use_first_pass 76If the authentication module 77is not the first in the stack, 78and a previous module 79obtained the user's password, 80that password is used 81to authenticate the user. 82If this fails, 83the authentication module returns failure 84without prompting the user for a password. 85This option has no effect 86if the authentication module 87is the first in the stack, 88or if no previous modules 89obtained the user's password. 90.It Cm try_first_pass 91This option is similar to the 92.Cm use_first_pass 93option, 94except that if the previously obtained password fails, 95the user is prompted for another password. 96.El 97.Ss SSH Session Management Module 98The 99SSH 100session management component 101provides functions to initiate 102.Pq Fn pam_sm_open_session 103and terminate 104.Pq Fn pam_sm_close_session 105sessions. 106The 107.Fn pam_sm_open_session 108function starts an SSH agent, 109passing it any private keys it decrypted 110during the authentication phase, 111and sets the environment variables 112the agent specifies. 113The 114.Fn pam_sm_close_session 115function kills the previously started SSH agent 116by sending it a 117.Dv SIGTERM . 118.Pp 119The following options may be passed to the session management module: 120.Bl -tag -width ".Cm want_agent" 121.It Cm want_agent 122Start an agent even if no keys were decrypted during the 123authentication phase. 124.El 125.Sh FILES 126.Bl -tag -width ".Pa $HOME/.ssh/identity" -compact 127.It Pa $HOME/.ssh/identity 128SSH1 RSA key 129.It Pa $HOME/.ssh/id_rsa 130SSH2 RSA key 131.It Pa $HOME/.ssh/id_dsa 132SSH2 DSA key 133.El 134.Sh SEE ALSO 135.Xr ssh-agent 1 , 136.Xr pam.conf 5 , 137.Xr pam 8 138.Sh AUTHORS 139The 140.Nm 141module was originally written by 142.An -nosplit 143.An "Andrew J. Korty" Aq ajk@iu.edu . 144The current implementation was developed for the 145.Fx 146Project by 147ThinkSec AS and NAI Labs, the Security Research Division of Network 148Associates, Inc.\& under DARPA/SPAWAR contract N66001-01-C-8035 149.Pq Dq CBOSS , 150as part of the DARPA CHATS research program. 151This manual page was written by 152.An "Mark R V Murray" Aq markm@FreeBSD.org . 153