PAM_YUBICO(8)
π pam_yubico β the Yubico PAM module π
okay bestie, welcome to pam_yubico, the module for YubiKey authentication β¨ it lives in the Yubico PAM Module Manual, section 8 of your local man pages, and it's genuinely iconic. no cap.
β¨ SYNOPSIS β¨
pam_yubico [...]
πΈ DESCRIPTION πΈ
so basically this module handles authentication of YubiKeys, and it does it two whole ways:
- online validation of OTP β the OTP gets checked against a validation server
- offline validation with HMAC-SHA1 challenge-response β no internet required, just vibes and crypto π¦
π OPTIONS π
bestie there are a LOT of these and we're going through every single one, no skipping, periodt π
debugβ turns on debugging. that's it. that's the option. πdebug_file=fileβ the file name to write debug output to. heads up: the file must already exist and it must be a regular file. defaults tostdout.mode=[client|challenge-response]β picks the mode of operation.client= OTP validation,challenge-response= challenge-response validation. defaults toclient. lowkey the main character switch of this whole page β¨authfile=fileβ where the file lives that holds the mappings of YubiKey token IDs to user names. the format is:
username:first_public_id:second_public_id:...
default location is $HOME/.yubico/authorized_yubikeys.
id=idβ your API client identity for the validation server. iykyk.key=keyβ your client key, in base64 format. the client key is also known as the API key, and it's what provides integrity in the communication between you (the client) and the validation server. if you want one for use with the default YubiCloud service, please go to:https://upgrade.yubico.com/getapikey/π«Άalwaysokβ succeed with all authentication attempts. > this one is dangerous. it's presentation mode, bestie. do not ship this to prod. πtry_first_passβ before it prompts the user for their password, the module first tries the previous stacked module's password, in case that satisfies this module as well.use_first_passβ forces the module to use a previous stacked module's password and will never prompt the user. if no password is available, or the password is not appropriate, the user gets denied access. no retries, no mercy πalways_promptβ if set, don't attempt to do a lookup to determine whether the user has a YubiKey configured; instead, prompt for one no matter what. this is useful in the case whereldap_bind_as_useris enabled but this module is being used to read the user's password (in a YubiKey+OTP auth scenario).nullokβ don't fail when there are no tokens declared for the user in the authorization mapping files or in LDAP. you can use this to make YubiKey authentication optional, unless the user has associated tokens. very "it's fine either way" energy πldap_starttlsβ if set, issue aSTARTTLScommand to the LDAP connection before attempting to bind to it. super common setup for servers that only listen on port389but still require TLS.ldap_bind_as_userβ use the user logging in to bind to LDAP. this uses the password the user provided via PAM. if this is set,ldapdnanduid_attrmust also be set. enabling this will causeldap_bind_userandldap_bind_passwordto be ignored.urllist=listβ a list of URL templates to be used. this is set by callingykclient_set_url_bases. the list should be in the format:
https://api1.example.com/wsapi/2.0/verify;https://api2.example.com/wsapi/2.0/verify
url=urlβ > bestie, this option should not be used, please use theurllistoption instead. it sets the URL template to use, set by callingykclient_set_url_template. the URL should be set in the format:
https://api.example.com/wsapi/2.0/verify?id=%d&otp=%s
capath=pathβ the path where X509 certificates are stored. this is required ifhttpsorldapsare used inurlandldap_uri, respectively. don't forget it, she's important πcainfo=fileβ option to allow for usage of a CA bundle instead of a path.proxy=proxyβ the proxy to connect to the validation server. valid schemes arehttp://,https://,socks4://,socks4a://,socks5://orsocks5h://.socks5hasks the proxy to do the DNS resolving. if no scheme or port is specified, HTTP proxy port1080will be used. example:
socks5h://user:pass@10.10.0.1:1080
verbose_otpβ show the One-Time Password when it is entered, i.e. to enable terminal echo of entered characters. > you are advised to not use this if you are using two factor authentication, because that will display your password on the screen π± this requires the service using the PAM module to display custom fields. this option can not be used with OpenSSH.ldap_uri=uriβ the LDAP server URI (e.g.ldap://localhost).ldap_server=serverβ the LDAP server host (default LDAP port is used). > deprecated. useldap_uriinstead, she's the upgraded version πldapdn=dnβ the distinguished name (DN) where the users are stored (eg:ou=users,dc=domain,dc=com). ifldap_filteris used, this is the base from which the subtree search will be performed.ldap_clientcertfile=clientcertfileβ the path to a client cert file to use when talking to the LDAP server. note this requiresldap_clientkeyfileto be set as well. they're a package deal π«Άldap_clientkeyfile=clientkeyfileβ the path to a key to be used with the client cert when talking to the LDAP server. note this requiresldap_clientcertfileto be set as well. yeah, same deal, other direction.user_attr=attrβ the LDAP attribute used to store user names (eg:cn).yubi_attr=attrβ the LDAP attribute used to store the YubiKey ID.yubi_attr_prefix=prefixβ the prefix of the LDAP attribute's value, in case of a generic attribute, used to store several types of IDs.token_id_length=lengthβ length of the ID prefixing the OTP (this is12if using the YubiCloud).ldap_bind_user=userβ the user to attempt a LDAP bind as.ldap_bind_password=passwordβ the password to use on LDAP bind.ldap_filter=filterβ a LDAP filter to use for attempting to find the correct object in LDAP. in this string%uwill be replaced with the username.ldap_cacertfile=cacertfileβ CA certitificate file for the LDAP connection. (yes, that's exactly how the original spells it, and yes, i'm keeping it, we don't erase history here π)chalresp_path=pathβ path of a system-wide directory where challenge-response files can be found for users. default location is$HOME/.yubico/.mysql_server=mysqlserverβ hostname/adress of mysql server. example10.0.0.1.mysql_port=mysqlportβ network port of mysql server.mysql_user=mysqluserβ user for accessing to the database. > strongly recommended to use a specific user with read only access. protect yourself, bestie π₯mysql_password=mysqlpasswordβ mysql password associated to the user.mysql_database=mysqldatabaseβ the name of the database. example:otp
β EXAMPLES β
here's the tea, straight from the source:
auth sufficient pam_yubico.so id=16 debug
auth required pam_yubico.so mode=challenge-response
auth required pam_yubico.so id=16 ldap_uri=ldaps://ldap.example.com ldap_filter=(uid=%u) yubi_attr=yubiKeyId
π¦ FILES π¦
$HOME/.yubico/authorized_yubikeysβ ifauthfileis not set, this file is used for the mapping between YubiKey public ID and in client mode.$HOME/.yubico/challenge,$HOME/.yubico/challenge-serial_numberβ ifchalresp_pathis not set, these files are used to hold the next challenge and the expected response for the user in challenge-response mode. ifchalresp_pathis set, the filename will beusernameinstead ofchallenge.
π BUGS π
found a bug? report yubico-pam bugs in the issue tracker: https://github.com/Yubico/yubico-pam/issues β the maintainers will love you for it, fr fr π
π SEE ALSO π
the yubico-pam home page: https://developers.yubico.com/yubico-pam/ β¨
YubiKeys can be obtained from Yubico: http://www.yubico.com/ π
okay bestie that's the whole page, and you ate it π
this was yubico-pam, Version 2.27, living in section 8 of the manual, PAM_YUBICO(8). go forth and authenticate, no cap πΈπ«Ά
π¦ where this page comes from
- alpine 3.24: yubico-pam-doc 2.27-r3 Β· BSD-2-Clause
- debian trixie: libpam-yubico 2.27-1+b1 Β· BSD-2-Clause
- epel 10: pam_yubico 2.27-7.el10_1 Β· LicenseRef-Callaway-BSD
- fedora 43: pam_yubico 2.27-9.fc43 Β· LicenseRef-Callaway-BSD
- fedora 43: pam_yubico 2.27-9.fc43 Β· LicenseRef-Callaway-BSD
- fedora 44: pam_yubico 2.27-10.fc44 Β· LicenseRef-Callaway-BSD
- fedora 44: pam_yubico 2.27-10.fc44 Β· LicenseRef-Callaway-BSD
- ubuntu questing: libpam-yubico 2.27-2
- ubuntu resolute: libpam-yubico 2.27-3 Β· BSD-2-Clause
- ubuntu stonking: libpam-yubico 2.27-3 Β· BSD-2-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms