1

I'm trying to set a new password on a router using paramiko. In Ubuntu terminal it looks like that:

admin:~$ ssh admin@IP_address
IP_address's password: password
You logged in: router command line :
router_1>set_password
Changing admin's password
type old password :
type new password :
retype new password :

So when I'm trying to do the same with python as soon as it comes to set password

import paramiko
ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh.connect(hostname='IPaddress', username='admin', password='password')
stdin, stdout, stderr = ssh.exec_command(command='set_password')

it pops out a window or a line asking to input old password Is it possible to input thous passwords automatically ?

  • *"pops out a window or a line"* - I do not see how your code can popup a window or a line. Your code does not do anything apart from starting the command. – Martin Prikryl Dec 13 '17 at 07:10

0 Answers0