mirror of
https://github.com/telekom-security/tpotce.git
synced 2025-07-02 01:27:27 -04:00
Installer upgrade
This commit is contained in:
31
installer/home/2fa_enable.sh
Executable file
31
installer/home/2fa_enable.sh
Executable file
@ -0,0 +1,31 @@
|
||||
#!/bin/bash
|
||||
|
||||
########################################################
|
||||
# T-Pot Community Edition #
|
||||
# Two-Factor authentication enable script #
|
||||
# #
|
||||
# v0.20 by mo, DTAG, 2015-01-27 #
|
||||
########################################################
|
||||
|
||||
echo "### This script will enable Two-Factor-Authentication based on Google Authenticator for SSH."
|
||||
while true
|
||||
do
|
||||
echo -n "### Do you want to continue (y/n)? "; read myANSWER;
|
||||
case $myANSWER in
|
||||
n)
|
||||
echo "### Exiting."
|
||||
exit 0;
|
||||
;;
|
||||
y)
|
||||
break
|
||||
;;
|
||||
esac
|
||||
done
|
||||
if [ -f /etc/pam.d/sshd.bak ];
|
||||
then echo "### Already enabled. Exiting."
|
||||
exit 1;
|
||||
fi
|
||||
sudo sed -i.bak '\# PAM#aauth required pam_google_authenticator.so' /etc/pam.d/sshd
|
||||
sudo sed -i.bak 's#ChallengeResponseAuthentication no#ChallengeResponseAuthentication yes#' /etc/ssh/sshd_config
|
||||
google-authenticator -t -d -f -r 3 -R 30 -w 21
|
||||
echo "### Please do not forget to run the ssh_enable script."
|
32
installer/home/ssh_enable.sh
Executable file
32
installer/home/ssh_enable.sh
Executable file
@ -0,0 +1,32 @@
|
||||
#!/bin/bash
|
||||
|
||||
########################################################
|
||||
# T-Pot Community Edition #
|
||||
# SSH enable script #
|
||||
# #
|
||||
# v0.21 by mo, DTAG, 2015-01-27 #
|
||||
########################################################
|
||||
|
||||
if ! [ -f /etc/init/ssh.override ];
|
||||
then echo "### SSH is already enabled. Exiting."
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
echo "### This script will enable the ssh service (default port tcp/64295)."
|
||||
echo "### Password authentication is disabled by default."
|
||||
|
||||
while true
|
||||
do
|
||||
echo -n "### Do you want to continue (y/n)? "; read myANSWER;
|
||||
case $myANSWER in
|
||||
n)
|
||||
echo "### Exiting."
|
||||
exit 0;
|
||||
;;
|
||||
y)
|
||||
break
|
||||
;;
|
||||
esac
|
||||
done
|
||||
sudo rm /etc/init/ssh.override
|
||||
sudo service ssh start
|
Reference in New Issue
Block a user