Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
except Exception as e:
traceback.print_exc()
finally:
transport.close()
return SusTCPHandler
class ThreadedTCPServer(socketserver.ThreadingMixIn, socketserver.TCPServer):
pass
if __name__ == '__main__':
HOST, PORT, HOST_KEY_FILENAME = '0.0.0.0', 22, 'host.key'
host_key = paramiko.RSAKey(filename=HOST_KEY_FILENAME)
SusTCPHandler = build_sus_tcp_handler(host_key)
server = ThreadedTCPServer((HOST, PORT), SusTCPHandler)
server.serve_forever()