mirror of https://github.com/jumpserver/jumpserver
Use thread replace process
parent
b4c6499139
commit
0d25a8f5b7
|
@ -92,7 +92,6 @@ class SSHServer(paramiko.ServerInterface):
|
||||||
})
|
})
|
||||||
return paramiko.AUTH_SUCCESSFUL
|
return paramiko.AUTH_SUCCESSFUL
|
||||||
else:
|
else:
|
||||||
self.client.close()
|
|
||||||
logger.info('Authentication password failed for %(username)s from %(host)s port %(port)s ' % {
|
logger.info('Authentication password failed for %(username)s from %(host)s port %(port)s ' % {
|
||||||
'username': username,
|
'username': username,
|
||||||
'host': self.addr[0],
|
'host': self.addr[0],
|
||||||
|
@ -275,10 +274,6 @@ class JumpServer:
|
||||||
'host': addr[0],
|
'host': addr[0],
|
||||||
'port': addr[1],
|
'port': addr[1],
|
||||||
})
|
})
|
||||||
raise IndexError
|
|
||||||
dir(client)
|
|
||||||
client.close()
|
|
||||||
return False
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
client_channel = self.get_client_channel(client, addr)
|
client_channel = self.get_client_channel(client, addr)
|
||||||
|
@ -360,9 +355,9 @@ class JumpServer:
|
||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
client, addr = sock.accept()
|
client, addr = sock.accept()
|
||||||
process = Process(target=self.handle_ssh_request, args=(client, addr))
|
thread = threading.Thread(target=self.handle_ssh_request, args=(client, addr))
|
||||||
process.daemon = True
|
thread.daemon = True
|
||||||
process.start()
|
thread.start()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error('Bind failed: ' + str(e))
|
logger.error('Bind failed: ' + str(e))
|
||||||
traceback.print_exc()
|
traceback.print_exc()
|
||||||
|
|
Loading…
Reference in New Issue