public
Created

beginnings of a duo unix homebrew formula

  • Download Gist
duo_unix-homebrew-beginnings.rb
Ruby
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
require 'formula'
 
class DuoUnix < Formula
url 'https://github.com/downloads/duosecurity/duo_unix/duo_unix-1.6.tar.gz'
homepage 'http://www.duosecurity.com/docs/duounix'
md5 'e4bd9bb7026a5ffb870a59ba4190ad15'
 
# depends on 'curl' and 'openssl', both installed by default
 
# strip'ing, which is part of the cleaning step, fails because
# make install needs to run as sudo, so don't clean
skip_clean :all
 
def install
system "./configure", "--disable-dependency-tracking",
"--prefix=#{prefix}",
"--with-privsep-user=_sshd"
system "make"
 
# From the README: login_duo will be installed setuid root by
# default in order to keep the Duo integration and secret keys
# in your configuration files secret.
system "sudo make install"
 
# add it to the server config
system "sudo sh -c 'echo \"ForceCommand /usr/local/sbin/login_duo\" >> /etc/sshd_config'"
 
# log into your admin account
system "open https://admin-eval.duosecurity.com"
 
# enter your keys
# interactive shell doesn't work :(
# system "sudo $EDITOR /etc/duo/login_duo.conf"
 
end
end

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.