Created
February 23, 2013 04:40
-
-
Save jasonmorganson/5018468 to your computer and use it in GitHub Desktop.
Download and install PAM modules
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
function isdone() { | |
if [ $? -eq 0 ];then | |
echo "done." | |
else | |
echo "" | |
echo "Something went wrong!" | |
exit 1 | |
fi | |
} | |
echo "" | |
echo "Setup PAM security modules" | |
echo "" | |
# | |
# PAM Auto Blacklist (pam_abl) | |
# | |
echo "* PAM Auto Blacklist (pam_abl):" | |
# Download PAM Auto Blacklist (pam_abl) | |
echo -n " Downloading... " | |
curl -s -O -L http://downloads.sourceforge.net/project/pam-abl/pam-abl/pam-abl-0.5.0.tar.gz | |
isdone | |
# Extract PAM Auto Blacklist (pam_abl) | |
echo -n " Extracting... " | |
tar -xf pam-abl-0.5.0.tar.gz | |
isdone | |
# CMake PAM Auto Blacklist (pam_abl) | |
echo -n " CMake... " | |
cd pam-abl | |
mkdir -p cmake_build | |
cd cmake_build | |
cmake -DCMAKE_INSTALL_PREFIX:PATH=/ ../ >/dev/null 2>&1 | |
isdone | |
# Make PAM Auto Blacklist (pam_abl) | |
echo -n " Make... " | |
make >/dev/null 2>&1 | |
isdone | |
# Install PAM Auto Blacklist (pam_abl) | |
echo -n " Install.. " | |
mkdir -p /var/lib/abl | |
make install >/dev/null 2>&1 | |
isdone | |
# Cleanup PAM Auto Blacklist (pam_abl) | |
echo -n " Cleanup... " | |
cd ../../ | |
rm pam-abl-0.5.0.tar.gz | |
rm -r pam-abl | |
isdone | |
# | |
# Google Authenticator PAM Module | |
# | |
echo "* Google Authenticator PAM Module:" | |
# Download Google Authenticator PAM Module | |
echo -n " Downloading... " | |
curl -s -O -L https://google-authenticator.googlecode.com/files/libpam-google-authenticator-1.0-source.tar.bz2 | |
isdone | |
# Extract Authenticator PAM Module | |
echo -n " Extracting... " | |
tar -xjf libpam-google-authenticator-1.0-source.tar.bz2 | |
isdone | |
# Install Authenticator PAM Module | |
echo -n " Install.. " | |
cd libpam-google-authenticator-1.0 | |
make install >/dev/null 2>&1 | |
isdone | |
# Cleanup Authenticator PAM Module | |
echo -n " Cleanup... " | |
cd ../ | |
rm libpam-google-authenticator-1.0-source.tar.bz2 | |
rm -r libpam-google-authenticator-1.0 | |
isdone | |
# | |
# Duo Security PAM Module | |
# | |
echo "* Duo Security PAM Module:" | |
# Download Duo Security PAM Module | |
echo -n " Downloading... " | |
curl -s -O -L https://dl.duosecurity.com/duo_unix-latest.tar.gz | |
isdone | |
# Extract Duo Security PAM Module | |
echo -n " Extracting... " | |
tar zxf duo_unix-latest.tar.gz | |
isdone | |
# Configure Duo Security PAM Module | |
echo -n " Configure... " | |
cd duo_unix-1.9 | |
./configure --with-pam --prefix=/usr >/dev/null 2>&1 | |
isdone | |
# Make Duo Security PAM Module | |
echo -n " Make... " | |
make >/dev/null 2>&1 | |
isdone | |
# Install Duo Security PAM Module | |
echo -n " Install.. " | |
make install >/dev/null 2>&1 | |
isdone | |
# Cleanup Duo Security PAM Module | |
echo -n " Cleanup... " | |
cd ../ | |
rm duo_unix-latest.tar.gz | |
rm -r duo_unix-1.9 | |
isdone |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment