NAME¶
pam_ssh —
authentication and session
management with SSH private keys
SYNOPSIS¶
[
service-name]
module-type control-flag
pam_ssh
[
options]
DESCRIPTION¶
The SSH authentication service module for PAM,
pam_ssh
provides functionality for two PAM categories: authentication and session
management. In terms of the
module-type parameter, they
are the “
auth
” and
“
session
” features. It also provides null
functions for the remaining categories.
SSH Authentication Module¶
The SSH authentication component verifies the identity of a user by prompting
the user for a passphrase and verifying that it can decrypt at least one of
the user's SSH login keys using that passphrase.
The following options may be passed to the authentication module:
- debug
- syslog(3) debugging information at
LOG_DEBUG
level.
- use_first_pass
- If the authentication module is not the first in the stack,
and a previous module obtained the user's password, that password is used
decrypt the user's SSH login keys. If this fails, then the authentication
module returns failure without prompting the user for a passphrase.
- try_first_pass
- Similar to the use_first_pass option,
except that if the previously obtained password fails to decrypt any of
the SSH login keys, then the user is prompted for a SSH passphrase.
- nullok
- Allow SSH keys with no passphrase.
If neither
use_first_pass nor
try_first_pass
is specified,
pam_ssh will unconditionally ask for an SSH
passphrase.
In addition to the above authentication procedure, all standard SSH keys
(identity, id_rsa, id_dsa, id_ecdsa) for which the obtained password matches
will be decrypted.
The now deprecated name
allow_blank_passphrase for
nullok is kept for compatibility reasons.
SSH Session Management
Module¶
The SSH session management component initiates sessions by starting an SSH
agent, passing it any SSH login keys it decrypted during the authentication
phase, and sets the environment variables accordingly; the environment
variable TMPDIR, which can be set through the pam_tmpdir module for example,
is also honoured by being passed to the SSH agent.
The SSH session management component terminates the session by killing the
previously started SSH agent by sending it a
SIGTERM
.
The following options may be passed to the session management module:
- debug
- syslog(3) debugging information at
LOG_DEBUG
level.
Be careful with the using the
try_first_pass option when
pam_ssh is the first authentication module because it will
then leak information about existing users without login keys: such users will
not be asked for a specific SSH passphrase, whereas non-existing users and
existing users with login keys will be asked for a passphrase.
FILES¶
- $HOME/.ssh/identity
- standard SSH1/SSH RSA key decrypted by pam_ssh
- $HOME/.ssh/id_rsa
- standard SSH RSA key decrypted by pam_ssh
- $HOME/.ssh/id_dsa
- standard SSH DSA key decrypted by pam_ssh
- $HOME/.ssh/id_ecdsa
- standard SSH ECDSA key decrypted by pam_ssh
- $HOME/.ssh/login-keys.d
- location of (possibly symbolic links to) SSH
RSA1/RSA/DSA/ECDSA keys decrypted by pam_ssh (keys with .disabled or
.frozen as suffix are ignored)
- /var/log/auth.log
- usual log file for syslog(3)
SEE ALSO¶
ssh-agent(1),
syslog(3),
pam.conf(5),
pam(8),
pam_tmp
AUTHORS¶
Andrew J. Korty <ajk@iu.edu> wrote
pam_ssh.
Dag-Erling Smorgrav wrote
the original OpenPAM support code.
Mark R V Murray
wrote the original version of this manual page.
Jens Peter
Secher introduced the login-key concept.