Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #! /usr/bin/python
- import getpass
- import sys
- import telnetlib
- HOST = "IP DEL ROUTER"
- user = "USUARIO DEL ROUTER"
- password = "CONTRASEÑA DEL ROUTER"
- tn = telnetlib.Telnet(HOST)
- tn.read_until("Login: ")
- tn.write(user + "\n")
- if password:
- tn.read_until("Password: ")
- tn.write(password + "\n")
- tn.write("save_and_reboot\n")
- tn.write("exit\n")
- print tn.read_all()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement