LOGIN_DUO(8)
β¨ LOGIN_DUO β¨
okay bestie, gather round, because we're talking about login_duo β the manual page lives in section 8 (system manager's manual territory, iykyk) and it's literally the second-factor bouncer for your login. no cap. π
πΈ NAME πΈ
login_duo β second-factor authentication via Duo login service
π¦ SYNOPSIS π¦
login_duo [-d] [-c file] [-h host] [-f user] [command [args...]]
π DESCRIPTION π
So here's the vibe: login_duo gives you secondary authentication through the Duo authentication service, and it only runs the user's login shell (or whatever command) if that auth actually succeeds. like, no passing go, no collecting $200, no shell. π
the following options are available, bestie:
-cβ point it at an alternate configuration file to load. the default is/etc/duo/login_duo.conf.-dβ debug mode, babes. logs go tostderrinstead ofsyslog.-hβ specify the remote IP address for this login (normally it's taken from theSSH_CONNECTIONenvironment variable, if that's set).-fβ specify an alternate Duo user to authenticate as.
π¨ if login_duo is installed setuid root (which is the default, jsyk), these options are only available to the super-user. so don't come for them unless you're root, periodt.
After successful Duo authentication, the user's login shell gets invoked β or, if an alternate command or the SSH_ORIGINAL_COMMAND environment variable is specified, that gets executed via the user's shell with a -c option. cute, efficient, iconic. π
π§ CONFIGURATION π§
the INI-format configuration file must have a "duo" section with the following options. mandatory. non-negotiable. the way that config file needs a duo sectionβ¦ π
hostβ Duo API host (required). yes bestie, required.ikeyβ Duo integration key (required). also required, don't skip it.skeyβ Duo secret key (required). required!! three for three.groupsβ if you set this, Duo authentication is only required for users whose primary group or supplementary group list matches one of the space-separated pattern-lists (peep the "PATTERNS" section below π).failmodeβ on service or configuration errors that prevent Duo authentication, fail "safe" (allow access) or "secure" (deny access). default is "safe".pushinfoβ send the command to be approved via Duo Push authentication. default is "no".http_proxyβ use the specified HTTP proxy, same format as theHTTP_PROXYenvironment variable.autopushβ upon successful first-factor authentication, automatically send a login request to the primary second-factor (usually Duo Push). can be "yes" or "no". default is "no".verified_pushβ enable support for Duo Verified Push authentication. cannot be used together withautopush. default is "no".motdβ print the contents of/etc/motdto screen after a successful login. either "yes" or "no." default is "no".promptsβ number of login attempts a user gets. default is 3. if you're usingautopush, it's recommended to setpromptsto 1.accept_env_factorβ look for factor selection or passcode in theDUO_PASSCODEenvironment variable, before prompting the user. can overrideautopush. default is "no".fallback_local_ipβ if it's unable to determine the authentication user's IP address, fall back on the IP address of the server. default is "no".https_timeoutβ set to the number of seconds to wait for HTTPS responses from Duo Security. if Duo Security takes longer than the configured number of seconds to respond to the preauth API call, the configuredfailmodeis triggered. other network operations such as DNS resolution, TCP connection establishment, and the SSL handshake have their own independent timeout and retry logic. default is 0, which disables the HTTPS timeout.
an example configuration file, for the girlies who like a visual π:
[duo]
host = api-deadbeef.duosecurity.com
ikey = SI9F...53RI
skey = 4MjR...Q2NmRiM2Q1Y
pushinfo = yes
autopush = yes
If installed setuid root (the default), login_duo performs Duo authentication as a dedicated privilege separation user, requiring that the configuration file be owned and readable only by this user. so lock that file down, bestie, it's giving security girlie. π
π PATTERNS π
a pattern consists of zero or more non-whitespace characters, * (a wildcard that matches zero or more characters), or ? (a wildcard that matches exactly one character).
a pattern-list is a comma-separated list of patterns. patterns within pattern-lists may be negated by preceding them with an exclamation mark (!). for example, to specify Duo authentication for all users (except those that are also admins), and for guests:
groups = users,!wheel,!*admin guests
see how that works? the ! is the "not her" of the pattern world. π
π₯ EXAMPLES π₯
login_duo can be enabled system-wide by specifying its full path as a ForceCommand in sshd_config(5) to capture any SSH remote login (including subsystems, remote commands, and interactive login). obsessed with a one-liner that does all that:
ForceCommand /usr/local/sbin/login_duo
similarly, a group of administrators could require two-factor authentication for login to a shared root account by specifying login_duo as the forced command for each public key in ~root/.ssh/authorized_keys:
command="/usr/local/sbin/login_duo -f alice"
ssh-rsa AAAAB2...19Q== alice@example.net
command="/usr/local/sbin/login_duo -f bob"
ssh-dss AAAAC3...51R== bob@example.net
and a user without root access could configure their own account to require Duo authentication via the same ~/.ssh/authorized_keys forced command mechanism and a user-installed (non-setuid) login_duo. main character energy fr fr. π
π FILES π
/etc/duo/login_duo.confβ default configuration file path
π AUTHORS π
login_duo was written by Duo Security <support@duosecurity.com>
π NOTES π
when used to protect remote SSH access, only interactive sessions support interactive Duo login. for scp(1), sftp(1), rsync(1), and other ssh(1) remote commands, login_duo automatically tries the user's default out-of-band factor (smartphone push or voice callback) and disables real-time login progress reporting to provide a clean shell environment. so don't panic when you don't see the little progress dance β it's intentional, bestie. π
that's the whole page, and this one's from the Debian crowd, dated September 3, 2010 β yes, 2010, a true elder icon in section 8 of the System Manager's Manual. thanks for coming to my ted talk, go forth and second-factor responsibly π«Άπ
π¦ where this page comes from
- epel 10: duo_unix 2.2.3-1.el10_2 Β· GPL-2.0-with-classpath-exception AND Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND BSD-4-Clause AND FSFAP AND FSFULLR AND GPL-1.0-only AND LicenseRef-URLEnc-MIT AND MIT AND SSH-short
- epel 9: duo_unix 2.2.3-1.el9 Β· GPL-2.0-with-classpath-exception AND Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND BSD-4-Clause AND FSFAP AND FSFULLR AND GPL-1.0-only AND LicenseRef-URLEnc-MIT AND MIT AND SSH-short
- fedora 43: duo_unix 2.2.3-1.fc43 Β· GPL-2.0-with-classpath-exception AND Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND BSD-4-Clause AND FSFAP AND FSFULLR AND GPL-1.0-only AND LicenseRef-URLEnc-MIT AND MIT AND SSH-short
- fedora 43: duo_unix 2.2.3-1.fc43 Β· GPL-2.0-with-classpath-exception AND Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND BSD-4-Clause AND FSFAP AND FSFULLR AND GPL-1.0-only AND LicenseRef-URLEnc-MIT AND MIT AND SSH-short
- fedora 44: duo_unix 2.2.3-1.fc44 Β· GPL-2.0-with-classpath-exception AND Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND BSD-4-Clause AND FSFAP AND FSFULLR AND GPL-1.0-only AND LicenseRef-URLEnc-MIT AND MIT AND SSH-short
- fedora 44: duo_unix 2.2.3-1.fc44 Β· GPL-2.0-with-classpath-exception AND Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND BSD-4-Clause AND FSFAP AND FSFULLR AND GPL-1.0-only AND LicenseRef-URLEnc-MIT AND MIT AND SSH-short
- nixos 26.05: duo-unix 2.2.1
- nixpkgs unstable: duo-unix 2.2.3
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms