当前通过SSH自动化终端,并能够使用Paramiko成功连接。作为最后一步的一部分,需要发送我无法发送的暂停键
示例代码(不完整)
client = paramiko.SSHClient()
client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
client.connect(hostname=ip,username=username,password=password)
remote_connection = client.invoke_shell()
....
remote_connections.send(chr(13))
...
output = remote_connection.recv(2000)
print(output)
client.close()
能够为换行发送Chr(10)或为回车发送Chr(13),但不知道要为“暂停”键发送的相应代码。
如果我通过第三方工具宏记录SSH会话,我会看到以下命令用于暂停,即chr(27)+“〜[C”,但在.send中使用相同的命令实际上会将字符发送到屏幕,即不执行它。
请咨询。