By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,409 Members | 1,043 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,409 IT Pros & Developers. It's quick & easy.

Telnet server implementation

P: n/a
Hi all,

I want to write a telnet server for an embedded linux box using
python.The problem is that it doesn't give a shell ( just a limited
CLI commands for configuring it . )My requirement is to write a telnet
server ( residing on the box) listening on some specific port where it
can listen to telnet requests from clients and provide them an
interactive command line session. I tried using the python's
async_chat module but it is very limited ..any wrappers around this
module so that it can be used more interactively ?? . Any pointers
would be highly appreciated . The current available CLI on this box
allows me to write python scripts remotely , ftp it and run them, so
executing them won't be problem.

Thanks
kumar
Jul 18 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
On Tue, Dec 02, 2003 at 03:49:23AM -0800, kumar wrote:
Hi all,

I want to write a telnet server for an embedded linux box using
python.The problem is that it doesn't give a shell ( just a limited
CLI commands for configuring it . )My requirement is to write a telnet
server ( residing on the box) listening on some specific port where it
can listen to telnet requests from clients and provide them an
interactive command line session. I tried using the python's
async_chat module but it is very limited ..any wrappers around this
module so that it can be used more interactively ?? . Any pointers
would be highly appreciated . The current available CLI on this box
allows me to write python scripts remotely , ftp it and run them, so
executing them won't be problem.


You should be able to use Twisted's telnet implementation for this. There's
an implementation included where the command line session is a pseudo-python
interactive interpreter, which is implemented in twisted/manhole/telnet.py,
the Shell and ShellFactory classes.

You easily can see this in action by running Twisted's mktap and twistd
commands:

mktap telnet --port 4040 --username foo --password bar
twistd -nf telnet.tap

You should be able to figure out how to implement your own telnet command
interpreter in Twisted by reading that code -- if not, please ask for help
on tw************@twistedmatrix.com

-Andrew.
Jul 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.