any telnetlib equivalent in Python for rlogin?

Francis Avila francisgavila at yahoo.com
Wed Nov 12 09:40:54 EST 2003


"walala" <mizhael at yahoo.com> wrote in message
news:bopo66$rev$1 at mozo.cc.purdue.edu...
> Dear all,
> Considering I am quite new to Python, is there any way that I can easily
> change this program to be used on "rlogin"? For example, is there a
library
> called "RLOGIN" that I can simply use         self.tn = tn =
> rloginlib.Rlogin(self.host), or something like that?

Yes: replicate the public interface of telnetlib, and use the rlogin
protocol instead of the telnet protocol behind-the-curtain.  Much of the
telnetlib public interface will be redundant, because these protocols don't
have many escape or control characters, and hence do very little data
cooking.

As for the behind-the-covers implementation, you can either go expect-like
and communicate with an rlogin/ssh subshell through os.popen2/3, or
reimplement an rlogin/ssh client in Python.  Reimplementing the rlogin
client looks pretty easy--its a simple protocol (rfc1282).  Reimplementing
ssh is _far_ more ambitious--I think communicating with a subshell is
probably a better idea for that.

It seems odd to me that your network supports rlogin but not telnet--rlogin
is iirc far more insecure because of the .rhosts nonsense.  I think ssh is
certainly a better choice here, even though using it will be messier.
--
Francis Avila





More information about the Python-list mailing list