Created
May 8, 2016 17:02
-
-
Save mgax/2f1a3e275a85558764c71e00389a2843 to your computer and use it in GitHub Desktop.
Homebrew formula for google-authenticator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class GoogleAuthenticator < Formula | |
desc "Google Authenticator PAM module" | |
homepage "https://github.com/google/google-authenticator" | |
head "https://github.com/google/google-authenticator.git" | |
depends_on "autoconf" => :build | |
depends_on "automake" => :build | |
depends_on "libtool" => :build | |
def install | |
cd "libpam" do | |
system "./bootstrap.sh" | |
system "./configure", "--prefix=#{prefix}" | |
system "make", "install" | |
end | |
end | |
def caveats; <<-EOS.undent | |
For SSH two-factor authentication, add the following line to /etc/pam.d/sshd: | |
auth required /usr/local/lib/security/pam_google_authenticator.so nullok | |
Create a token: | |
google-authenticator --time-based --disallow-reuse --minimal-window --rate-limit=3 --rate-time=30 -f | |
EOS | |
end | |
test do | |
system "#{bin}/google-authenticator", "-h" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment