4

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.

1 Answer 1

6

With stdin.write

stdin, stdout, stderr = ssh.exec_command('./sum')
stdin.write('8 9\n')
stdin.flush()
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.