I want to connect to a device via SSH with Paramiko (python library) but my device needs 2 step connection as below picture:
here is my code :
import paramiko
ssh_client =paramiko.SSHClient()
ssh_client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh_client.connect(hostname='10.240.235.167',username='cli', password='')
stdin, stdout, stderr = ssh_client.exec_command('admin')
stdin, stdout, stderr = ssh_client.exec_command('Admin123\n')
stdin.write('admin123\n')
stdin,stdout,stderr=ssh_client.exec_command('my command')
but it's not working, I want to know how to connect and store result of my command.