Help using telnetlib to install/remove rpms
Markus Schaber
markus at schabi.de
Thu Aug 2 18:00:56 EDT 2001
Hello,
Rebecca Hepper <Rebecca.R.Hepper at seagate.com> schrub:
> max_wait = 30
>
> tn=Telnet(ipAddress)
> tn.read_until("login: ", max_wait)
> tn.write("username\n")
> tn.read_until("Password: ", max_wait)
> tn.write("password\n")
>
> # change to superuser, can't install rpm as normal user
> tn.write("su\n")
> tn.read_until("Password: ", max_wait)
> tn.write("password\n")
>
> tn.write("rpm -e myrpm-7.00-1\n")
> tn.write("rpm -i myrpm-7.01-1.i386.rpm\n")
> tn.write("exit\n")
For debugging reasons, it would be nice to see the responses from the
telnet server - may be you should use TCPDump or ethereal and capture
the packets on the net, so we can see what really happens on the net.
Does the su work? Did you try some commands like "echo" or so to test
whether the shell accepts other commands?
markus
--
Defend democrathy and freedom!
More information about the Python-list
mailing list