Commit 76d9a919 authored by Alexander Withers's avatar Alexander Withers

fail2ban test script updated

parent 221f350d
......@@ -10,7 +10,7 @@ from datetime import datetime
host='localhost'
file = open("/tmp/ssh.txt","a+")
file = open("/tmp/ssh.txt","a+",0)
def handle_intr(signal, frame):
print('Ctrl+C caught, exiting...')
......@@ -45,9 +45,9 @@ def show_ssh(topic, who, messagedata):
rec['additional_data']['password'] = rec['additional_data']['fingerprint']
if 'password' in rec['additional_data']:
out += " {duser}:{password} using {client_version}".format(**rec['additional_data'])
print(prefix, out)
# this is confusing: time that event was logged, not when it occured
logtime = datetime.now().strftime('%Y-%m-%d %H:%M:%S')
print(logtime, prefix, out)
# this is confusing: time that event was logged, not when it occured
file.write(logtime+" "+prefix+" "+out+"\n")
def main():
......
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