def exec_command(self, command, bufsize=-1): #print \"Executing Command: \"+command chan = self._transport.open_session() chan.exec_command(command)
cmd = 'ls /home/dir' self.ssh_stdin, self.ssh_stdout, self.ssh_stderr = self.ssh.exec_command(cmd) print self.ssh_stdout.read() cmd2 = 'cat /home/dir/test.log' self.ssh_stdin2, self.ssh_stdout2, self.ssh_stderr2 = self.ssh.exec_command(cmd2) print self.ssh_stdout2.read()