2 # Copyright (c) Twisted Matrix Laboratories.
3 # See LICENSE for details.
7 Support module for making a telnet server with twistd.
10 from twisted.manhole import telnet
11 from twisted.python import usage
12 from twisted.application import strports
14 class Options(usage.Options):
15 synopsis = "[options]"
16 longdesc = "Makes a telnet server to a Python shell."
18 ["username", "u", "admin","set the login username"],
19 ["password", "w", "changeme","set the password"],
20 ["port", "p", "4040", "port to listen on"],
23 compData = usage.Completions(
24 optActions={"username": usage.CompleteUsernames()}
27 def makeService(config):
28 t = telnet.ShellFactory()
29 t.username, t.password = config['username'], config['password']
30 s = strports.service(config['port'], t)