Skip to content

Commit

Permalink
Updated sshserver.py
Browse files Browse the repository at this point in the history
  • Loading branch information
huashengdun committed May 30, 2018
1 parent 5f52977 commit cbeca1c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/sshserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
print('Read key: ' + u(hexlify(host_key.get_fingerprint())))

banner = u'\r\n\u6b22\u8fce\r\n'
event_timeout = 5


class Server(paramiko.ServerInterface):
Expand Down Expand Up @@ -131,12 +132,12 @@ def run_ssh_server(port=2200, running=True):
username = t.get_username()
print('{} Authenticated!'.format(username))

server.shell_event.wait(2)
server.shell_event.wait(timeout=event_timeout)
if not server.shell_event.is_set():
print('*** Client never asked for a shell.')
continue

server.exec_event.wait(2)
server.exec_event.wait(timeout=event_timeout)
if not server.exec_event.is_set():
print('*** Client never asked for a command.')
continue
Expand Down

0 comments on commit cbeca1c

Please sign in to comment.