entre tu reactor.listeTCP(puerto, factory) y reactor.run():
from twisted.conch import manhole, manhole_ssh from twisted.cred import portal, checkers def getManholeFactory(namespace, **passwords): realm = manhole_ssh.TerminalRealm() def getManhole(_): return manhole.Manhole(namespace) realm.chainedProtocolFactory.protocolFactory = getManhole p = portal.Portal(realm) p.registerChecker( checkers.InMemoryUsernamePasswordDatabaseDontUse(**passwords)) f = manhole_ssh.ConchFactory(p) return f reactor.listenTCP(2222, getManholeFactory(globals(), admin='aaa'))
Los aplausos para este tutorial.