Skip to content

Commit 531cea3

Browse files
committed
Cleaned up. Fixed issues with sms. check out Changelog for more information
1 parent 4e7a9b1 commit 531cea3

6 files changed

+45
-23
lines changed

Changelog.md

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
## 9/29/16
2+
# Tauth 1.4
3+
- Added support for users prefered shell
4+
- Implemented support for secure ssms with the "AllowSMS email" option WARNING: NO ERROR CHECKING
5+
- Changed default sms method to 'email'
6+
- Changed textbelt syntax. Apparently it doesnt support verizon. Or at least mine. Its ok. User sms "Allowsms email" anyway, way more secure
7+
- Updated readme. command changed from 'TAUTH' to 'tauth'
8+
- Added Changelog!!
9+
- Disabled logging, Ill get around to fixing that later
10+
- Changed name of 'conf' to 'tauth_config'. That is the name it will be when on a server.

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@ After installation restart your SSH server
2121

2222
After installing TAUTH, all management is handled with
2323

24-
$ TAUTH [command]
24+
$ tauth [command]
2525

2626
To enable TAUTH for a user
2727

28-
$ TAUTH add [user]
28+
$ tauth add [user]
2929

3030
To remove TAUTH from a specific user
3131

32-
$ TAUTH remove [user]
32+
$ tauth remove [user]
3333

34-
Note: You can manually remove a user from TAUTH by removing "/home/user/.tauth",However "/home/user/.tauth/user_config" is marked as immutable
34+
Note: You can manually remove a user from TAUTH by removing "/home/user/.tauth",However "/home/user/.tauth/user_config" is marked as immutable

tauth-install.sh

+6-6
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ EMAIL_User=""
1616
EMAIL_Pass=""
1717
EMAIL_Serv="smtps://smtp.gmail.com:465"
1818
AllowEmail="yes"
19-
AllowSMS="web"
19+
AllowSMS="email"
2020
PhoneCarrier="$TAUTH_ROOT/Phoneinfo"
2121
logs="$TAUTH_CONF_ROOT/tauth.log"
2222

@@ -48,8 +48,8 @@ echo "#Whether or not to allow sms. Set to 'no' 'web' or 'email'. Web is insecur
4848
echo "AllowSMS $AllowSMS" >> $TAUTH_CONF
4949
echo "#location of the phone carrier information file" >> $TAUTH_CONF
5050
echo "PhoneCarrier $PhoneCarrier" >> $TAUTH_CONF
51-
echo "#Location of the log file" >> $TAUTH_CONF
52-
echo "Log $logs" >> $TAUTH_CONF
51+
#echo "#Location of the log file" >> $TAUTH_CONF
52+
#echo "Log $logs" >> $TAUTH_CONF
5353
green "Settings written to $TAUTH_CONF!"
5454
}
5555

@@ -105,9 +105,9 @@ read -p "Enter Gmail password: " -s EMAIL_Pass
105105
cp $SSH_CONF "$SSH_CONF.bac"
106106
echo "ForceCommand $TAUTH_ROOT/tauth-login.sh" >> $SSH_CONF
107107
#create default log file
108-
echo "STATUS"$'\t'"TIME"$'\t'"USER"$'\t'"IP"$'\t'"HOSTNAME" >> $logs
109-
chmod 666 $logs
110-
chattr +a $logs
108+
#echo "STATUS"$'\t'"TIME"$'\t'"USER"$'\t'"IP"$'\t'"HOSTNAME" >> $logs
109+
#chmod 666 $logs
110+
#chattr +a $logs
111111
write_settings
112112
green "Install Successfull!"
113113
green "Please restart SSH server"

tauth-login.sh

+21-10
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/bin/bash
2+
# Author Micah Martin - Knif3
23

34
VERSION="1.0"
45
TAUTH_CONF_ROOT="/etc/tauth"
@@ -49,9 +50,9 @@ if [[ -f $TAUTH_CONF ]]; then
4950
EMAIL_Pass=$(cat $TAUTH_CONF | grep EmailPass | awk '{print $2}')
5051
EMAIL_Serv=$(cat $TAUTH_CONF | grep EmailServer | awk '{print $2}')
5152
ALLOW_EMAIL=$(cat $TAUTH_CONF | grep AllowEmail | awk '{print $2}')
52-
ALLOW_EMAIL=${EMAIL_Only,,}
53+
ALLOW_EMAIL=${ALLOW_EMAIL,,}
5354
ALLOW_SMS=$(cat $TAUTH_CONF | grep AllowSMS | awk '{print $2}')
54-
ALLOW_SMS=${EMAIL_Only,,}
55+
ALLOW_SMS=${ALLOW_SMS,,}
5556
PHONEINFO=$(cat $TAUTH_CONF | grep PhoneCarrier | awk '{print $2}')
5657
LOG=$(cat $TAUTH_CONF | grep AllowEmail | awk '{print $2}')
5758
# if [ $SSH_CONF == "" | $EMAIL_Only == "" ]; then
@@ -77,11 +78,13 @@ while true; do
7778
send "email"
7879
break;;
7980
"sms" | "SMS" | "s" )
80-
if [ "$EMAIL_Only" = "yes" ]; then
81-
red "No SMS service! Sending email..."
82-
send "email"
81+
if [ "$ALLOW_SMS" == "web" ]; then
82+
send "sms"
83+
elif [ "$ALLOW_SMS" == "email" ]; then
84+
send "ssms"
8385
else
84-
send "sms"
86+
red "No SMS service! Sending email..."
87+
send "email"
8588
fi
8689
break;;
8790
* ) echo "Please choose SMS or EMAIL";;
@@ -98,10 +101,10 @@ SFIN="$SHOST [$SIP]"
98101

99102
log() {
100103
#log a command with status of $1
101-
echo "$1"$'\t'"$(date +"%m-%d-%y_%H:%M:%S")"$'\t'"$(whoami)"$'\t'"$SIP"$'\t'"$SHOST" >> $LOG
104+
#echo "$1"$'\t'"$(date +"%m-%d-%y_%H:%M:%S")"$'\t'"$(whoami)"$'\t'"$SIP"$'\t'"$SHOST" >> $LOG
102105
}
103106

104-
#send mode[sms|email]
107+
#send mode[ssms|sms|email]
105108
send() {
106109

107110
if [ $1 == "email" ]; then
@@ -120,6 +123,12 @@ elif [ $1 == "sms" ]; then
120123
red "Sending code failed!! Restart to try Email"
121124
exit
122125
fi
126+
# secure sms setup with email to text
127+
elif [ $1 == "ssms" ]; then
128+
echo -e "Subject: TAUTH code\n\nCode: $code\nFrom: $SFIN" > /tmp/mail.txt
129+
curl -sS --url "$EMAIL_Serv" --ssl-reqd --mail-from "$EMAIL_User" --mail-rcpt "$PHONE$CARRIER" --upload-file /tmp/mail.txt --user "$EMAIL_User:$EMAIL_Pass" --insecure
130+
green "Text sent to $(whoami)"
131+
rm /tmp/mail.txt
123132
else
124133
red "No email to text service!"
125134
exit
@@ -161,8 +170,10 @@ fi
161170

162171
tauth_login() {
163172
if [ $1 == $code ]; then
164-
/bin/bash
165-
blue "Thank you for using t-auth"
173+
# /bin/bash
174+
# testing users preffered shell
175+
$(getent passwd $USER | cut -d: -f7)
176+
blue "Thank you for using tauth"
166177
exit
167178
else
168179
red "Incorrect! Removing from server..."

tauth-manager.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
VERSION="1.3"
3+
VERSION="1.4"
44
#Colors for display
55
NOCOLOR='\033[0m'
66
TAUTHROOT="/usr/local/tauth"

conf tauth_config

+3-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ EmailServer smtps://smtp.gmail.com:465
55
#Whether or not to allow email. Set to yes or no
66
AllowEmail yes
77
#Whether or not to allow sms. Set to 'no' 'web' or 'email'. Web is insecure if the network that the server is on can be sniffed, However, this does not require Phone Carriers
8-
AllowSMS web
8+
AllowSMS email
99
#location of the phone carrier information file
1010
Phoneinfo /etc/tauth/Phoneinfo
1111
#Location of the log file
12-
Log /var/log/tauth/tauth.log
12+
#Log /var/log/tauth/tauth.log
13+
#Logging disabled for now

0 commit comments

Comments
 (0)