11642eb1aSMark Murray.\" Copyright (c) 2001 Mark R V Murray 2d9027819SDag-Erling Smørgrav.\" Copyright (c) 2001-2003 Networks Associates Technology, Inc. 332627537SDag-Erling Smørgrav.\" Copyright (c) 2004-2011 Dag-Erling Smørgrav 4b4a47593SDag-Erling Smørgrav.\" All rights reserved. 5b4a47593SDag-Erling Smørgrav.\" 6b4a47593SDag-Erling Smørgrav.\" This software was developed for the FreeBSD Project by ThinkSec AS and 7b4a47593SDag-Erling Smørgrav.\" NAI Labs, the Security Research Division of Network Associates, Inc. 8b4a47593SDag-Erling Smørgrav.\" under DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"), as part of the 9b4a47593SDag-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. 19b4a47593SDag-Erling Smørgrav.\" 3. The name of the author may not be used to endorse or promote 20b4a47593SDag-Erling Smørgrav.\" products derived from this software without specific prior written 21b4a47593SDag-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.\" 3532627537SDag-Erling Smørgrav.Dd October 7, 2011 36b4a47593SDag-Erling Smørgrav.Dt PAM_SSH 8 371642eb1aSMark Murray.Os 381642eb1aSMark Murray.Sh NAME 39b4a47593SDag-Erling Smørgrav.Nm pam_ssh 4032f0c048SDag-Erling Smørgrav.Nd authentication and session management with SSH private keys 411642eb1aSMark Murray.Sh SYNOPSIS 421642eb1aSMark Murray.Op Ar service-name 431642eb1aSMark Murray.Ar module-type 441642eb1aSMark Murray.Ar control-flag 45b4a47593SDag-Erling Smørgrav.Pa pam_ssh 461642eb1aSMark Murray.Op Ar options 471642eb1aSMark Murray.Sh DESCRIPTION 481642eb1aSMark MurrayThe 49b4a47593SDag-Erling SmørgravSSH 501642eb1aSMark Murrayauthentication service module for PAM, 511642eb1aSMark Murray.Nm 521642eb1aSMark Murrayprovides functionality for two PAM categories: 531642eb1aSMark Murrayauthentication 54b4a47593SDag-Erling Smørgravand session management. 551642eb1aSMark MurrayIn terms of the 561642eb1aSMark Murray.Ar module-type 571642eb1aSMark Murrayparameter, they are the 5808ecaa10SRuslan Ermilov.Dq Li auth 591642eb1aSMark Murrayand 60b4a47593SDag-Erling Smørgrav.Dq Li session 611642eb1aSMark Murrayfeatures. 62b4a47593SDag-Erling Smørgrav.Ss SSH Authentication Module 631642eb1aSMark MurrayThe 64b4a47593SDag-Erling SmørgravSSH 651642eb1aSMark Murrayauthentication component 66b4a47593SDag-Erling Smørgravprovides a function to verify the identity of a user 671642eb1aSMark Murray.Pq Fn pam_sm_authenticate , 68b4a47593SDag-Erling Smørgravby prompting the user for a passphrase and verifying that it can 69b4a47593SDag-Erling Smørgravdecrypt the target user's SSH key using that passphrase. 701642eb1aSMark Murray.Pp 711642eb1aSMark MurrayThe following options may be passed to the authentication module: 72e8b02a42SRuslan Ermilov.Bl -tag -width ".Cm use_first_pass" 731642eb1aSMark Murray.It Cm use_first_pass 741642eb1aSMark MurrayIf the authentication module 751642eb1aSMark Murrayis not the first in the stack, 761642eb1aSMark Murrayand a previous module 771642eb1aSMark Murrayobtained the user's password, 781642eb1aSMark Murraythat password is used 791642eb1aSMark Murrayto authenticate the user. 801642eb1aSMark MurrayIf this fails, 811642eb1aSMark Murraythe authentication module returns failure 821642eb1aSMark Murraywithout prompting the user for a password. 831642eb1aSMark MurrayThis option has no effect 841642eb1aSMark Murrayif the authentication module 851642eb1aSMark Murrayis the first in the stack, 861642eb1aSMark Murrayor if no previous modules 871642eb1aSMark Murrayobtained the user's password. 881642eb1aSMark Murray.It Cm try_first_pass 891642eb1aSMark MurrayThis option is similar to the 901642eb1aSMark Murray.Cm use_first_pass 911642eb1aSMark Murrayoption, 921642eb1aSMark Murrayexcept that if the previously obtained password fails, 931642eb1aSMark Murraythe user is prompted for another password. 94c777c69bSDag-Erling Smørgrav.It Cm nullok 95c777c69bSDag-Erling SmørgravNormally, keys with no passphrase are ignored for authentication 96c777c69bSDag-Erling Smørgravpurposes. 97c777c69bSDag-Erling SmørgravIf this option is set, keys with no passphrase will be taken into 98c777c69bSDag-Erling Smørgravconsideration, allowing the user to log in with a blank password. 991642eb1aSMark Murray.El 100b4a47593SDag-Erling Smørgrav.Ss SSH Session Management Module 1011642eb1aSMark MurrayThe 10260c67361SRuslan ErmilovSSH 103b4a47593SDag-Erling Smørgravsession management component 104b4a47593SDag-Erling Smørgravprovides functions to initiate 105b4a47593SDag-Erling Smørgrav.Pq Fn pam_sm_open_session 106b4a47593SDag-Erling Smørgravand terminate 107b4a47593SDag-Erling Smørgrav.Pq Fn pam_sm_close_session 108b4a47593SDag-Erling Smørgravsessions. 109b4a47593SDag-Erling SmørgravThe 110b4a47593SDag-Erling Smørgrav.Fn pam_sm_open_session 111b4a47593SDag-Erling Smørgravfunction starts an SSH agent, 112b4a47593SDag-Erling Smørgravpassing it any private keys it decrypted 113b4a47593SDag-Erling Smørgravduring the authentication phase, 114b4a47593SDag-Erling Smørgravand sets the environment variables 115b4a47593SDag-Erling Smørgravthe agent specifies. 116b4a47593SDag-Erling SmørgravThe 117b4a47593SDag-Erling Smørgrav.Fn pam_sm_close_session 118b4a47593SDag-Erling Smørgravfunction kills the previously started SSH agent 119b4a47593SDag-Erling Smørgravby sending it a 120b4a47593SDag-Erling Smørgrav.Dv SIGTERM . 1211642eb1aSMark Murray.Pp 122b4a47593SDag-Erling SmørgravThe following options may be passed to the session management module: 123d9027819SDag-Erling Smørgrav.Bl -tag -width ".Cm want_agent" 124d9027819SDag-Erling Smørgrav.It Cm want_agent 125d9027819SDag-Erling SmørgravStart an agent even if no keys were decrypted during the 126d9027819SDag-Erling Smørgravauthentication phase. 1271642eb1aSMark Murray.El 1281642eb1aSMark Murray.Sh FILES 1296eb79b47SOllivier Robert.Bl -tag -width ".Pa $HOME/.ssh/id_ed25519" -compact 130d9027819SDag-Erling Smørgrav.It Pa $HOME/.ssh/id_rsa 131d9027819SDag-Erling SmørgravSSH2 RSA key 132b4a47593SDag-Erling Smørgrav.It Pa $HOME/.ssh/id_dsa 133d9027819SDag-Erling SmørgravSSH2 DSA key 13432627537SDag-Erling Smørgrav.It Pa $HOME/.ssh/id_ecdsa 13532627537SDag-Erling SmørgravSSH2 ECDSA key 1366533da45SOllivier Robert.It Pa $HOME/.ssh/id_ed25519 1376533da45SOllivier RobertSSH2 Ed25519 key 1381642eb1aSMark Murray.El 1391642eb1aSMark Murray.Sh SEE ALSO 140b4a47593SDag-Erling Smørgrav.Xr ssh-agent 1 , 141*6e1fc011SGraham Percival.Xr pam 3 , 142*6e1fc011SGraham Percival.Xr pam.conf 5 14332f0c048SDag-Erling Smørgrav.Sh AUTHORS 144d9027819SDag-Erling SmørgravThe 145d9027819SDag-Erling Smørgrav.Nm 146d9027819SDag-Erling Smørgravmodule was originally written by 14732f0c048SDag-Erling Smørgrav.An -nosplit 1482b7af31cSBaptiste Daroussin.An Andrew J. Korty Aq Mt ajk@iu.edu . 149d9027819SDag-Erling SmørgravThe current implementation was developed for the 150d9027819SDag-Erling Smørgrav.Fx 151d9027819SDag-Erling SmørgravProject by 152d9027819SDag-Erling SmørgravThinkSec AS and NAI Labs, the Security Research Division of Network 1531a0a9345SRuslan ErmilovAssociates, Inc.\& under DARPA/SPAWAR contract N66001-01-C-8035 154d9027819SDag-Erling Smørgrav.Pq Dq CBOSS , 155d9027819SDag-Erling Smørgravas part of the DARPA CHATS research program. 156d9027819SDag-Erling SmørgravThis manual page was written by 1572b7af31cSBaptiste Daroussin.An Mark R V Murray Aq Mt markm@FreeBSD.org . 158