我写了一个脚本,使用ssh连接(单点登录服务器)从那里我想连接一个节点的单个连接服务器。但我的问题是,当我通过ssh invoke_shell发送命令时,我可以在输出中看到它,但命令没有执行。任何有关单连接和paramiko的帮助将不胜感激。使用paramiko SSH到singleconnect(SSO)服务器
#!/usr/bin/env python
import paramiko
import time
ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh.connect("host",port=2222,username="username",password="pass")
remote_con = ssh.invoke_shell()
print "Interactive SSH session established"
output = remote_con.recv(5000)
remote_con.send("device_ip_here_to_connect_from_SSO \n")
print output
time.sleep(3)
output = remote_con.recv(5000)
print output
请[编辑]你的问题,包括这个脚本或它的相关部分。 – Kenster
编辑了添加的问题和脚本。 –