1ffac92f0SchristosPAM_U2F(8) 2ffac92f0Schristos========== 3ffac92f0Schristos:doctype: manpage 4ffac92f0Schristos:man source: pam-u2f 5ffac92f0Schristos:man manual: PAM U2F Module Manual 6ffac92f0Schristos 7ffac92f0Schristos== NAME 8ffac92f0Schristospam_u2f - Module for U2F authentication 9ffac92f0Schristos 10ffac92f0Schristos== SYNOPSIS 11ffac92f0Schristos*pam_u2f* [...] 12ffac92f0Schristos 13ffac92f0Schristos== DESCRIPTION 14*672d764fSchristosThe module provides U2F authentication against Yubikeys and other 15*672d764fSchristoscompliant authenticators. 16ffac92f0Schristos 17ffac92f0Schristos== OPTIONS 18ffac92f0Schristos*debug*:: 19ffac92f0SchristosEnables debug output 20ffac92f0Schristos 21ffac92f0Schristos*debug_file*:: 22*672d764fSchristosFilename to write debugging messages to. **If this file is missing, 23*672d764fSchristosnothing will be logged**. This regular file **has to be created by the 24*672d764fSchristosuser** or **must exist and be a regular file** for anything getting 25*672d764fSchristoslogged to it. It is not created by pam-u2f on purpose (for security 26*672d764fSchristosconsiderations). This filename may be alternatively set to "stderr" 27*672d764fSchristos(default), "stdout", or "syslog". 28ffac92f0Schristos 29ffac92f0Schristos*origin*=_origin_:: 30*672d764fSchristosSet the relying party ID for the FIDO authentication procedure. If no 31*672d764fSchristosvalue is specified, the identifier "pam://$HOSTNAME" is used. 32ffac92f0Schristos 33ffac92f0Schristos*appid*=_appid_:: 34*672d764fSchristosSet the application ID for the U2F authentication 35*672d764fSchristosprocedure. If no value is specified, the same value used for origin is 36*672d764fSchristostaken ("pam://$HOSTNAME" if also origin is not specified). This setting 37*672d764fSchristosis only applicable for U2F credentials created with pamu2fcfg versions 38*672d764fSchristosv1.0.8 or earlier. Note that on v1.1.0 and v1.1.1 of pam-u2f, handling 39*672d764fSchristosof this setting was temporarily broken if the value was not the same as 40*672d764fSchristosthe value of origin. 41ffac92f0Schristos 42ffac92f0Schristos*authfile*=_file_:: 43*672d764fSchristosSet the location of the file that holds the mappings of user 44*672d764fSchristosnames to keyHandles and user keys. An individual (per user) 45*672d764fSchristosfile may be configured relative to the users' home dirs, e.g. 46*672d764fSchristos".ssh/u2f_keys". If not specified, the location defaults to 47*672d764fSchristos$XDG_CONFIG_HOME/Yubico/u2f_keys. If $XDG_CONFIG_HOME is not set, 48*672d764fSchristos$HOME/.config/Yubico/u2f_keys is used. The authfile format is 49*672d764fSchristos<username>:<KeyHandle1>,<UserKey1>,<CoseType1>,<Options1>:<KeyHandle2>,<UserKey2>,<CoseType2>,<Options2>:... 50ffac92f0Schristos 51ffac92f0Schristos*authpending_file*=_file_:: 52*672d764fSchristosSet the location of the file that is used for touch request 53*672d764fSchristosnotifications. This file will be opened when pam-u2f starts waiting 54*672d764fSchristosfor a user to touch the device, and will be closed when it no longer 55*672d764fSchristoswaits for a touch. Use inotify to listen on these events, or a more 56*672d764fSchristoshigh-level tool like yubikey-touch-detector. Default value: 57*672d764fSchristos/var/run/user/$UID/pam-u2f-authpending. Set an empty value in order to 58*672d764fSchristosdisable this functionality, like so: "authpending_file=". 59ffac92f0Schristos 60ffac92f0Schristos*nouserok*:: 61*672d764fSchristosSet to enable authentication attempts to succeed even if the user 62*672d764fSchristostrying to authenticate is not found inside authfile or if authfile is 63*672d764fSchristosmissing/malformed. 64ffac92f0Schristos 65ffac92f0Schristos*openasuser*:: 66*672d764fSchristosSetuid to the authenticating user when opening the authfile. Useful 67*672d764fSchristoswhen the user's home is stored on an NFS volume mounted with the 68*672d764fSchristosroot_squash option (which maps root to nobody which will not be able 69*672d764fSchristosto read the file). Note that after release 1.0.8 this is done by 70*672d764fSchristosdefault when no global authfile or XDG_CONFIG_HOME environment 71*672d764fSchristosvariable has been set. 72ffac92f0Schristos 73ffac92f0Schristos*alwaysok*:: 74*672d764fSchristosSet to enable all authentication attempts to succeed (aka presentation 75*672d764fSchristosmode). 76ffac92f0Schristos 77ffac92f0Schristos*max_devices*=_n_devices_:: 78*672d764fSchristosMaximum number of devices allowed per user (default is 24). Devices 79*672d764fSchristosspecified in the authentication file that exceed this value will be 80*672d764fSchristosignored. 81ffac92f0Schristos 82ffac92f0Schristos*interactive*:: 83*672d764fSchristosSet to prompt a message and wait before testing the presence of a U2F 84*672d764fSchristosdevice. Recommended if your device doesn't have tactile trigger. 85ffac92f0Schristos 86ffac92f0Schristos*[prompt=your prompt here]*:: 87*672d764fSchristosSet individual prompt message for interactive mode. Watch the square 88*672d764fSchristosbrackets around this parameter to get spaces correctly recognized by 89*672d764fSchristosPAM. 90ffac92f0Schristos 91ffac92f0Schristos*manual*:: 92*672d764fSchristosSet to drop to a manual console where challenges are printed on screen 93*672d764fSchristosand response read from standard input. Useful for debugging and SSH 94*672d764fSchristossessions without U2F-support from the SSH client/server. If enabled, 95*672d764fSchristosinteractive mode becomes redundant and has no effect. 96ffac92f0Schristos 97ffac92f0Schristos*cue*:: 98ffac92f0SchristosSet to prompt a message to remind to touch the device. 99ffac92f0Schristos 100ffac92f0Schristos*[cue_prompt=your prompt here]*:: 101*672d764fSchristosSet individual prompt message for the cue option. Watch the square 102*672d764fSchristosbrackets around this parameter to get spaces correctly recognized by 103*672d764fSchristosPAM. 104ffac92f0Schristos 105ffac92f0Schristos*nodetect*:: 106*672d764fSchristosSkip detecting if a suitable key is inserted before performing a full 107*672d764fSchristosauthentication. See *NOTES* below. 108ffac92f0Schristos 109ffac92f0Schristos*userpresence*=_int_:: 110*672d764fSchristosIf 1, require user presence during authentication. If 0, do not 111*672d764fSchristosrequest user presence during authentication. Otherwise, fallback to 112*672d764fSchristosthe authenticator's default behaviour. 113ffac92f0Schristos 114ffac92f0Schristos*userverification*=_int_:: 115*672d764fSchristosIf 1, require user verification during authentication. If 0, do not 116*672d764fSchristosrequest user verification during authentication. Otherwise, fallback 117*672d764fSchristosto the authenticator's default behaviour. 118ffac92f0Schristos 119ffac92f0Schristos*pinverification*=_int_:: 120*672d764fSchristosIf 1, require PIN verification during authentication. If 0, do not 121*672d764fSchristosrequest PIN verification during authentication. Otherwise, fallback to 122*672d764fSchristosthe authenticator's default behaviour. 123*672d764fSchristos 124*672d764fSchristos*sshformat*:: 125*672d764fSchristosUse credentials produced by versions of OpenSSH that have support for 126*672d764fSchristosFIDO devices. It is not possible to mix native credentials and SSH 127*672d764fSchristoscredentials. Once this option is enabled all credentials will be parsed 128*672d764fSchristosas SSH. 129ffac92f0Schristos 130ffac92f0Schristos== EXAMPLES 131ffac92f0Schristos 132ffac92f0Schristosauth sufficient pam_u2f.so debug origin=pam://$HOSTNAME appid=pam://$HOSTNAME 133ffac92f0Schristos 134ffac92f0Schristosauth required pam_u2f.so origin=http://example.com appid=http://example.com authfile=/etc/yubikey_mappings 135ffac92f0Schristos 136ffac92f0Schristos== CAVEATS 137ffac92f0SchristosBy default the mapping file inside a home directory will be opened as 138ffac92f0Schristosthe target user, whereas the central file will be opened as "root". If 139ffac92f0Schristosthe "XDG_CONFIG_HOME" variable is set, privileges will not be dropped 140ffac92f0Schristosunless the "openasuser" configuration setting is set. 141ffac92f0Schristos 142*672d764fSchristosUsing pam-u2f to secure the login to a computer while storing the 143*672d764fSchristosmapping file in an encrypted home directory, will result in the 144*672d764fSchristosimpossibility of logging into the system. The partition is decrypted 145*672d764fSchristosafter login and the mapping file can not be accessed. 146ffac92f0Schristos 147ffac92f0Schristos== NOTES 148ffac92f0Schristos 149*672d764fSchristos*Nodetect* 150ffac92f0Schristos 151*672d764fSchristosThe "nodetect" option should be used with caution. pam_u2f checks that 152*672d764fSchristosa key configured for the user is inserted before performing the full 153*672d764fSchristostactile authentication. This detection is done by sending a 154*672d764fSchristos"check-only" authentication request to all inserted tokens to so see 155*672d764fSchristosif at least one of them responds affirmatively to one or more of the 156*672d764fSchristoskeyhandles configured for the user. By doing this, pam_u2f can avoid 157*672d764fSchristosemitting the "cue" prompt (if configured), which can cause some 158*672d764fSchristosconfusing UI issues if the cue is emitted followed by the underlying 159*672d764fSchristoslibrary immediately failing the tactile authentication. This option is 160*672d764fSchristosalso useful to avoid an unintended 1-second delay prior to the tactile 161*672d764fSchristosauthentication caused by versions of libu2f-host \<= 1.1.5. 162*672d764fSchristos 163*672d764fSchristosIf pam_u2f is configured to "cue" and "nodetect", an attacker can 164*672d764fSchristosdetermine that pam_u2f is part of the authentication stack by 165*672d764fSchristosinserting any random U2F token and performing an authentication 166*672d764fSchristosattempt. In this scenario, the attacker would see the cue message 167*672d764fSchristosfollowed by an immediate failure, whereas with detection enabled, the 168*672d764fSchristosU2F authentication will fail silently. Understand that an attacker 169*672d764fSchristoscould choose a U2F token that alerts him or her in some way to the 170*672d764fSchristos"check-only" authentication attempt, so this precaution only pushes 171*672d764fSchristosthe issue back a step. 172*672d764fSchristos 173*672d764fSchristosIn summary, the detection feature was added to avoid confusing UI 174*672d764fSchristosissues and to prevent leaking information about the authentication 175*672d764fSchristosstack in very specific scenario when "cue" is configured. The 176*672d764fSchristos"nodetect" option was added to avoid buggy sleep behavior in older 177*672d764fSchristosversions of libu2f-host and for hypothetical tokens that do not 178*672d764fSchristostolerate the double authentication. Detection is performed, and 179*672d764fSchristoslikewise "nodetect" honored, regardless of whether "cue" is also 180*672d764fSchristosspecified. 181*672d764fSchristos 182*672d764fSchristos*SELinux* 183*672d764fSchristos 184*672d764fSchristosDue to an issue with Fedora Linux, and possibly with other 185*672d764fSchristosdistributions that use SELinux, a system configured with pam-u2f may 186*672d764fSchristosend up in a situation where access to the credentials file is denied. 187*672d764fSchristosIf the `nouserok` option is also set, this will result in a successful 188*672d764fSchristosauthentication within the module, without using the FIDO 189*672d764fSchristosauthenticator. 190*672d764fSchristos 191*672d764fSchristosIn order to correctly update the security context the command 192*672d764fSchristos*fixfiles onboot* should be used on existing installations 193*672d764fSchristos 194*672d764fSchristosMoreover, to allow read access to an authfile or directory placed in a 195*672d764fSchristosnon-standard location, the command 196*672d764fSchristos 197*672d764fSchristos # chcon -R -t auth_home_t /path/to/authfile 198*672d764fSchristos 199*672d764fSchristosshould be used. 200*672d764fSchristos 201*672d764fSchristosFor more information see 202*672d764fSchristoshttps://access.redhat.com/security/cve/CVE-2020-24612. 203ffac92f0Schristos 204ffac92f0Schristos== BUGS 205ffac92f0SchristosReport pam-u2f bugs in the issue tracker: https://github.com/Yubico/pam-u2f/issues 206ffac92f0Schristos 207ffac92f0Schristos== SEE ALSO 208ffac92f0Schristos*pam*(7) 209ffac92f0Schristos 210ffac92f0SchristosThe pam-u2f home page: https://developers.yubico.com/pam-u2f/ 211ffac92f0Schristos 212ffac92f0SchristosYubiKeys can be obtained from Yubico: http://www.yubico.com/ 213