.\" Automatically generated by Pod::Man 4.11 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "pam_ssh_agent_auth 8" .TH pam_ssh_agent_auth 8 "2020-08-23" "v0.10.3" "PAM" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" pam_ssh_agent_auth \- PAM module for granting permissions based on SSH agent requests .SH "DESCRIPTION" .IX Header "DESCRIPTION" This module provides authentication via ssh-agent. If an ssh-agent listening at \s-1SSH_AUTH_SOCK\s0 can successfully authenticate that it has the secret key for a public key in the specified file, authentication is granted, otherwise authentication fails. .SH "CONFIGURATION" .IX Header "CONFIGURATION" .IP "/etc/pam.d/sudo: auth sufficient pam_ssh_agent_auth.so file=/etc/security/authorized_keys" 4 .IX Item "/etc/pam.d/sudo: auth sufficient pam_ssh_agent_auth.so file=/etc/security/authorized_keys" .PD 0 .IP "/etc/sudoers:" 4 .IX Item "/etc/sudoers:" .PD In older versions of sudo (< 1.8.5) it was necessary to set: Defaults env_keep += \*(L"\s-1SSH_AUTH_SOCK\*(R"\s0 .PP This configuration would permit anyone who has an \s-1SSH_AUTH_SOCK\s0 that manages the private key matching a public key in /etc/security/authorized_keys to execute sudo without having to enter a password. Note that the ssh-agent listening to \s-1SSH_AUTH_SOCK\s0 can either be local, or forwarded. .PP Unlike \s-1NOPASSWD,\s0 this still requires an authentication, it's just that the authentication is provided by ssh-agent, and not password entry. .SH "ARGUMENTS" .IX Header "ARGUMENTS" .IP "file=" 4 .IX Item "file=" Specify the path to the authorized_keys file(s) you would like to use for authentication. Subject to tilde and % \s-1EXPANSIONS\s0 (below) .IP "allow_user_owned_authorized_keys_file" 4 .IX Item "allow_user_owned_authorized_keys_file" A flag which enables authorized_keys files to be owned by the invoking user, instead of root. This flag is enabled automatically whenever the expansions \f(CW%h\fR or ~ are used. .IP "authorized_keys_command=" 4 .IX Item "authorized_keys_command=" Specify an external command to run, which should take a single argument, the username of the person being authenticated, and emit to its stdout a file in authorized_keys format. This is ideally suited for use with sssd's sss_ssh_authorizedkeys, for authenticating users via authorized_keys stored in ldap or other sssd supported security service. .IP "authorized_keys_command_user=" 4 .IX Item "authorized_keys_command_user=" Specify a user to run the authorized_keys_command as. If this option is not specified, the authorized_keys_command will be run as the user being authenticated. .IP "debug" 4 .IX Item "debug" A flag which enables verbose logging .IP "sudo_service_name=" 4 .IX Item "sudo_service_name=" (when compiled with \-\-enable\-sudo\-hack) .Sp Specify the service name to use to identify the service \*(L"sudo\*(R". When the \s-1PAM_SERVICE\s0 identifier matches this string, and if \s-1PAM_RUSER\s0 is not set, pam_ssh_agent_auth will attempt to identify the calling user from the environment variable \s-1SUDO_USER.\s0 .Sp This defaults to \*(L"sudo\*(R". .SH "EXPANSIONS" .IX Header "EXPANSIONS" .IP "~ \*(-- same as in shells, a user's Home directory" 4 .IX Item "~ same as in shells, a user's Home directory" Automatically enables allow_user_owned_authorized_keys_file if used in the context of ~/. If used as ~user/, it would expect the file to be owned by 'user', unless you explicitly set allow_user_owned_authorized_keys_file .ie n .IP "%h \*(-- User's Home directory" 4 .el .IP "\f(CW%h\fR \*(-- User's Home directory" 4 .IX Item "%h User's Home directory" Automatically enables allow_user_owned_authorized_keys_file .ie n .IP "%H \*(-- The short-hostname" 4 .el .IP "\f(CW%H\fR \*(-- The short-hostname" 4 .IX Item "%H The short-hostname" .PD 0 .ie n .IP "%u \*(-- Username" 4 .el .IP "\f(CW%u\fR \*(-- Username" 4 .IX Item "%u Username" .ie n .IP "%f \*(-- \s-1FQDN\s0" 4 .el .IP "\f(CW%f\fR \*(-- \s-1FQDN\s0" 4 .IX Item "%f FQDN" .PD .SH "EXAMPLES" .IX Header "EXAMPLES" in /etc/pam.d/sudo .ie n .IP """auth sufficient pam_ssh_agent_auth.so file=~/.ssh/authorized_keys""" 4 .el .IP "\f(CWauth sufficient pam_ssh_agent_auth.so file=~/.ssh/authorized_keys\fR" 4 .IX Item "auth sufficient pam_ssh_agent_auth.so file=~/.ssh/authorized_keys" The default .ssh/authorized_keys file in a user's home-directory .ie n .IP """auth sufficient pam_ssh_agent_auth.so file=%h/.ssh/authorized_keys""" 4 .el .IP "\f(CWauth sufficient pam_ssh_agent_auth.so file=%h/.ssh/authorized_keys\fR" 4 .IX Item "auth sufficient pam_ssh_agent_auth.so file=%h/.ssh/authorized_keys" Same as above. .ie n .IP """auth sufficient pam_ssh_agent_auth.so file=~fred/.ssh/authorized_keys""" 4 .el .IP "\f(CWauth sufficient pam_ssh_agent_auth.so file=~fred/.ssh/authorized_keys\fR" 4 .IX Item "auth sufficient pam_ssh_agent_auth.so file=~fred/.ssh/authorized_keys" If the home-directory of user 'fred' was /home/fred, this would expand to /home/fred/.ssh/authorized_keys. In this case, we have not specified allow_user_owned_authorized_keys_file, so this file must be owned by 'fred'. .ie n .IP """auth sufficient pam_ssh_agent_auth.so file=/secure/%H/%u/authorized_keys allow_user_owned_authorized_keys_file""" 4 .el .IP "\f(CWauth sufficient pam_ssh_agent_auth.so file=/secure/%H/%u/authorized_keys allow_user_owned_authorized_keys_file\fR" 4 .IX Item "auth sufficient pam_ssh_agent_auth.so file=/secure/%H/%u/authorized_keys allow_user_owned_authorized_keys_file" On a host named foobar.baz.com, and a user named fred, would expand to /secure/foobar/fred/authorized_keys. In this case, we specified allow_user_owned_authorized_keys_file, so fred would be able to manage that authorized_keys file himself. .ie n .IP """auth sufficient pam_ssh_agent_auth.so file=/secure/%f/%u/authorized_keys""" 4 .el .IP "\f(CWauth sufficient pam_ssh_agent_auth.so file=/secure/%f/%u/authorized_keys\fR" 4 .IX Item "auth sufficient pam_ssh_agent_auth.so file=/secure/%f/%u/authorized_keys" On a host named foobar.baz.com, and a user named fred, would expand to /secure/foobar.baz.com/fred/authorized_keys. In this case, we have not specified allow_user_owned_authorized_keys_file, so this file must be owned by root. .ie n .IP """auth [success=3 default=ignore] pam_ssh_agent_auth.so file=~/.ssh/authorized_keys debug""" 4 .el .IP "\f(CWauth [success=3 default=ignore] pam_ssh_agent_auth.so file=~/.ssh/authorized_keys debug\fR" 4 .IX Item "auth [success=3 default=ignore] pam_ssh_agent_auth.so file=~/.ssh/authorized_keys debug" This pam.d config format allows for more control over how pam handles success and failure. In this example, we use success=3, which specifies that when this module succeeds, pam should jump over the next 3 auth modules and continue from there. This is useful, for instance, if /etc/pam.d/common\-auth is included, and contains 3 \*(L"auth required\*(R" or similar module rules that we wish to skip, but we wish not to skip other auth rules. .Sp For more information, please see http://linux.die.net/man/5/pam.d .SH "COPYRIGHT" .IX Header "COPYRIGHT" .Vb 3 \& Copyright (c) 2008\-2014, Jamie Beverly. \& And is based on openssh, and the included works by Markus Friedl, Darren Tucker, \& Todd C. Miller, Ben Lindstrom, Tim Rice, Damien Miller, and many others. \& \& All rights reserved. \& \& See sources for complete attributions. \& \& Redistribution and use in source and binary forms, with or without modification, are \& permitted provided that the following conditions are met: \& \& 1. Redistributions of source code must retain the above copyright notice, this list of \& conditions and the following disclaimer. \& \& 2. Redistributions in binary form must reproduce the above copyright notice, this list \& of conditions and the following disclaimer in the documentation and/or other materials \& provided with the distribution. \& \& THIS SOFTWARE IS PROVIDED BY Jamie Beverly \`\`AS IS\*(Aq\*(Aq AND ANY EXPRESS OR IMPLIED \& WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND \& FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL Jamie Beverly OR \& CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR \& CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR \& SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON \& ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING \& NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF \& ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .Ve