google-authenticator-libpam 1.05 (new formula)

Closes #19177.

Signed-off-by: ilovezfs <ilovezfs@icloud.com>
This commit is contained in:
jabenninghoff 2017-10-08 09:22:31 -05:00 committed by ilovezfs
parent 90e26113ed
commit 286c1534d4

View file

@ -0,0 +1,38 @@
class GoogleAuthenticatorLibpam < Formula
desc "PAM module for two-factor authentication"
homepage "https://github.com/google/google-authenticator-libpam"
url "https://github.com/google/google-authenticator-libpam/archive/1.05.tar.gz"
sha256 "862412d6927ee1a19d81150006d53c21935897ba6d033616c31fc4d6aaa4db08"
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "libtool" => :build
depends_on "qrencode"
def install
system "./bootstrap.sh"
system "./configure", "--disable-dependency-tracking",
"--disable-silent-rules",
"--prefix=#{prefix}"
system "make", "install"
end
def caveats; <<~EOS
Add 2-factor authentication for ssh:
echo "auth required #{opt_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 #{opt_lib}/security/pam_google_authenticator.so" \\
"nullok" | sudo tee -a /etc/pam.d/sshd
(Or just manually edit /etc/pam.d/sshd)
EOS
end
test do
system "#{bin}/google-authenticator", "--force", "--time-based",
"--disallow-reuse", "--rate-limit=3", "--rate-time=30",
"--window-size=3"
end
end