Commit b6ac28c7 authored by zador-blood-stained's avatar zador-blood-stained
Browse files

UNTESTED: Install 2FA packages only when requested

parent 60c40e60
...@@ -1064,6 +1064,12 @@ function jobs () ...@@ -1064,6 +1064,12 @@ function jobs ()
# phone # phone
if [[ " ${my_array[*]} " == *" PhoneAuthentication "* ]]; then if [[ " ${my_array[*]} " == *" PhoneAuthentication "* ]]; then
if ! check_if_installed libpam-google-authenticator ; then
debconf-apt-progress -- apt-get -y install libpam-google-authenticator
fi
if ! check_if_installed qrencode ; then
debconf-apt-progress -- apt-get -y install qrencode
fi
MergeParameter="keyboard-interactive" MergeParameter="keyboard-interactive"
sed -i "s/^#\?ChallengeResponseAuthentication.*/ChallengeResponseAuthentication yes/" /etc/ssh/sshd_config sed -i "s/^#\?ChallengeResponseAuthentication.*/ChallengeResponseAuthentication yes/" /etc/ssh/sshd_config
sed -i -n '/password updating/{p;:a;N;/@include common-password/!ba;s/.*\n/auth required pam_google_authenticator.so nullok\n/};p' /etc/pam.d/sshd sed -i -n '/password updating/{p;:a;N;/@include common-password/!ba;s/.*\n/auth required pam_google_authenticator.so nullok\n/};p' /etc/pam.d/sshd
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment