def main():
args = parse_args()
log.info('Requesting remote shell from {}', args.hostname)
with PenguinDomeServerPeer(
'server', local_port=get_setting('local_port'),
logger=log, client_hostname=args.hostname) as remote, \
TerminalPeer() as terminal:
host = args.hostname
script = '#!/bin/bash\npython client/endpoints/shell.py {}\n'.format(
remote.pipe_id)
patch_hosts('client/commands/shell-{}'.format(remote.pipe_id),
patch_content=script.encode('ascii'),
hosts=host)
broker = InteractionBroker(terminal, remote, poll_interval=0.2)
print('Waiting for client to connect (once connected, use "~." to '
'disconnect)...')
remote.poll()
curses.wrapper(interact, broker)
评论列表
文章目录