Can I do it using python?? about xterm and telnet

Network Ninja jeremiah.bess at gmail.com
Sun Jul 2 15:20:51 EDT 2006


valpa wrote:
> I'm a net admin for about 20 unix servers, and I need to frequently
> telnet on to them and configure them.
> It is a tiring job to open a xterm and telnet, username, password to
> each server.
>
> Can I  do it automatically by python? After that, there have 20 xterm
> consoles opened and telneted to their corresponding servers. Then I
> could start to type command in these xterms.


I often have to add users/delete local user accounts on routers and
switches. Each account is a local account, and I got tired of it. My
very first python program was created to use the telnetlib, and either
add, delete, or show a list of user accounts. It was very effective,
because it would change the same accounts on each router and switch.
Saved me a bunch of time, and got me hooked on python. If you are not
concerned about security, the telnetlib in python will help you.
Otherwise, use ssh, as it is more secure. You can even impliment
public/private keys for password-less log on. If you want some help
with the code for the telnetlib, let me know.




More information about the Python-list mailing list