Reputation: 399
There is a command, basically a c
program, when executed on the remote machine. After executing that command it expects some inputs. Just like:
./sum
Enter two value: 8 9
sum is 17
How do I do this with paramiko
after ssh.exec_command("./sum")
? How to send the inputs 8 and 9 to it.
Upvotes: 4
Views: 6320
Reputation: 2672
With stdin.write
stdin, stdout, stderr = ssh.exec_command('./sum')
stdin.write('8 9\n')
stdin.flush()
Upvotes: 6