0

I wonder if we have a way of enabling the following this:
Python script running on Machine1

Machine1 -------pass sudo commands, ssh password, sudo password------> Machine2
Machine1 <--------Get output and store in python variable--------- Machine2

Can we do this without using paramiko?

bipster
  • 404
  • 1
  • 8
  • 20
  • Possible duplicate of [Perform commands over ssh with Python](https://stackoverflow.com/questions/3586106/perform-commands-over-ssh-with-python) – ayrusme Oct 19 '17 at 12:35
  • `paramiko` is the way. What's wrong with it? From the python docs: "Paramiko is a native Python implementation of SSH. " – kabanus Oct 19 '17 at 12:36
  • 1
    Possible duplicate of [What is the simplest way to SSH using Python?](https://stackoverflow.com/questions/1233655/what-is-the-simplest-way-to-ssh-using-python) – kabanus Oct 19 '17 at 12:37
  • this might be possible using subprocess.Popen with piping stdout and stdin, and processing stdout in real-time, without using `.communicate()`. But if want actually do that thing: WAT ? – Yaroslav Surzhikov Oct 19 '17 at 12:39

0 Answers0