🍺 BREW Explorer

← all formulae

google-authenticator-libpam

brew install google-authenticator-libpam v1.11 Apache-2.0

PAM module for two-factor authentication

38
30-day installs · #5256
115
90-day · #5277
468
365-day · #5263
2.0k
★ GitHub stars · updated 5mo ago

Runtime dependencies

Build dependencies

GitHub topics

2fa google-authenticator pam pam-module

Links

Caveats

Add 2-factor authentication for ssh:
  echo "auth required $HOMEBREW_PREFIX/opt/google-authenticator-libpam/lib/security/pam_google_authenticator.so" \
  | sudo tee -a /etc/pam.d/sshd

Add 2-factor authentication for ssh allowing users to log in without OTP:
  echo "auth required $HOMEBREW_PREFIX/opt/google-authenticator-libpam/lib/security/pam_google_authenticator.so" \
  "nullok" | sudo tee -a /etc/pam.d/sshd

(Or just manually edit /etc/pam.d/sshd)
Raw metadata
{
  "aliases": [],
  "alternatives": [],
  "build_dependencies": [
    "autoconf",
    "automake",
    "libtool"
  ],
  "categories": [],
  "caveats": "Add 2-factor authentication for ssh:\n  echo \"auth required $HOMEBREW_PREFIX/opt/google-authenticator-libpam/lib/security/pam_google_authenticator.so\" \\\n  | sudo tee -a /etc/pam.d/sshd\n\nAdd 2-factor authentication for ssh allowing users to log in without OTP:\n  echo \"auth required $HOMEBREW_PREFIX/opt/google-authenticator-libpam/lib/security/pam_google_authenticator.so\" \\\n  \"nullok\" | sudo tee -a /etc/pam.d/sshd\n\n(Or just manually edit /etc/pam.d/sshd)\n",
  "conflicts_with": [],
  "dependencies": [
    "qrencode"
  ],
  "deprecated": 0,
  "deprecation_reason": null,
  "desc": "PAM module for two-factor authentication",
  "disable_reason": null,
  "disabled": 0,
  "enrichment_fetched_at": "2026-06-20T23:38:18+00:00",
  "first_seen": "2026-06-20T23:34:18+00:00",
  "full_name": "google-authenticator-libpam",
  "github_default_branch": "master",
  "github_last_commit_at": "2026-02-27T13:47:34Z",
  "github_readme_excerpt": "# Google Authenticator PAM module\n\nExample PAM module demonstrating two-factor authentication for logging\ninto servers via SSH, OpenVPN, etc\u2026\n\nThis project is not about logging in to Google, Facebook, or other\nTOTP/HOTP second factor systems, even if they recommend using the\nGoogle Authenticator apps.\n\nHMAC-Based One-time Password (HOTP) is specified in\n[RFC 4226](https://tools.ietf.org/html/rfc4226) and \nTime-based One-time Password (TOTP) is specified in\n[RFC 6238](https://tools.ietf.org/html/rfc6238).\n\n[![Build Status](https://travis-ci.org/google/google-authenticator-libpam.svg?branch=master)](https://travis-ci.org/google/google-authenticator-libpam)\n\n## Build \u0026 install\n```shell\n./bootstrap.sh\n./configure\nmake\nsudo make install\n```\n\nIf you don\u0027t have access to \"sudo\", you have to manually become \"root\" prior\nto calling \"make install\".\n\n## Setting up the PAM module for your system\n\nFor highest security, make sure that both password and OTP are being requested\neven if password and/or OTP are incorrect. This means that *at least* the first\nof `pam_unix.so` (or whatever other module is used to verify passwords) and\n`pam_google_authenticator.so` should be set as `required`, not `requisite`. It\nprobably can\u0027t hurt to have both be `required`, but it could depend on the rest\nof your PAM config.\n\nIf you use HOTP (counter based as opposed to time based) then add the option\n`no_increment_hotp` to make sure the counter isn\u0027t incremented for failed\nattempts.\n\nAdd this line to your PAM configuration file:\n\n`  auth required pam_google_authenticator.so no_increment_hotp`\n\n## Setting up a user\n\nRun the `google-authenticator` binary to create a new secret key in your home\ndirectory. These settings will be stored in `~/.google_authenticator`.\n\nIf your system supports the \"libqrencode\" library, you will be shown a QRCode\nthat you can scan using the Android \"Google Authenticator\" application.\n\nIf your system does not have this library, you can either follow the URL that\n`google-auth",
  "github_repo": "google/google-authenticator-libpam",
  "github_stars": 1988,
  "github_topics": [
    "2fa",
    "google-authenticator",
    "pam",
    "pam-module"
  ],
  "homepage": "https://github.com/google/google-authenticator-libpam",
  "homepage_og_description": null,
  "homepage_og_image": null,
  "homepage_title": null,
  "installs_30d": 38,
  "installs_365d": 468,
  "installs_90d": 115,
  "keg_only": 0,
  "keg_only_reason": null,
  "last_seen": "2026-06-20T23:34:18+00:00",
  "license": "Apache-2.0",
  "llm_generated_at": null,
  "llm_model": null,
  "name": "google-authenticator-libpam",
  "oldnames": [],
  "one_liner": null,
  "optional_dependencies": [],
  "rank_30d": 5256,
  "rank_365d": 5263,
  "rank_90d": 5277,
  "raw_hash": "280f20e9f201f584",
  "recommended_dependencies": [],
  "revision": 0,
  "ruby_source_path": "Formula/g/google-authenticator-libpam.rb",
  "tap": "homebrew/core",
  "test_dependencies": [],
  "uses_from_macos": [],
  "version_head": null,
  "version_stable": "1.11",
  "versioned_formulae": [],
  "why_use_this": null
}