Paramiko | Script básico para conectarse a un dispositivo Cisco via SSH
import paramiko
import time
host = '192.168.1.10'
username = 'usuario_ssh'
password = 'password_ssh'
port = 22
command = 'show int status\n'
ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh.connect(hostname=host,username=username, password=password, port=port, look_for_keys=False, allow_agent=False)
stdin, stdout, stderr = ssh.exec_command(command)
output = stdout.readlines()
print(' '.join(map(str, output)))
Comentarios
Publicar un comentario