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.
With stdin.write
stdin, stdout, stderr = ssh.exec_command('./sum')
stdin.write('8 9\n')
stdin.flush()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With