Paramiko session times out, but i need to execute a lot of commands

后端 未结 2 1169
野趣味
野趣味 2020-12-22 09:08

I\'m working on a script (python 2.7) that is wotking with a remote device running Cisco IOS, so I need to execute a lot of commands through ssh. Few commands have no output

2条回答
  •  旧时难觅i
    2020-12-22 09:35

    You need to properly chain the commands together, as in a shell script:

    stdin, stdout, stderr = ssh.exec_command('''
    command1
    && command2
    && command3
    ''')
    

提交回复
热议问题