我寫了一個腳本,使用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
編輯了添加的問題和腳本。 –