The code below runs grep in one machine through SSH and prints the results:
import sys, os, string
import paramiko
cmd = \"grep -h \'king\' /opt/data/horror
In my case i have to execute commands on server with one ip and port and after complete need to do sftp to other ip and different port.Condition is one connection should be live while doing sftp to another ip due to port forwarding.
Both connection are working separably but while combining both second sftp connection is not working.