如何让paramiko等到自定义提示出现?

2024-04-26 20:49:39 发布

您现在位置:Python中文网/ 问答频道 /正文

我有一个基于linux的自定义框,它有一个类似横幅的东西(我也不确定它是否是横幅),它出现在登录时,然后是带有paramiko的自定义提示sshclient.connect连接()脚本甚至在自定义提示出现之前就从ssh会话中出来了,有没有办法等到自定义提示出现后再运行执行命令?你知道吗

横幅是这样的

Command Line Interface is starting up, please wait ...

   Welcome to the Platform Command Line Interface

VMware Installation:
        2 vCPU: Intel(R) Xeon(R) CPU E5-2690 v2 @ 3.00GHz
        Disk 1: 146GB, Partitions aligned
        10240 Mbytes RAM

admin:

一旦出现“命令行接口正在启动,请稍候…”行,paramiko就会退出ssh会话


Tags: 脚本paramikoislinuxconnectline执行命令ssh