-1

I have successfully created public private keys to make passwordless ssh connection. I need to make connection with remote server, go to a particular path, and append some input to sample.log file. Currently I am using os.system("ssh [email protected]") and then the steps to append the input to sample.log file. But my script stops only aftwr making connection with using os.system("ssh [email protected]").

Barmar
  • 741,623
  • 53
  • 500
  • 612

1 Answers1

0

Paramiko Module is best suited for it.

I use it personally to make connections and execute comand from one device to another.

You can find more detailed information of paramiko on https://www.paramiko.org

  • I can not install any python package. BTW i got the solution, we can use cat script.py | ssh xx.xxx.xxx.xxx python - In script we can use os.system("ssh xx.xxx.xxx.xxx") – Fahad Naseem Feb 02 '22 at 06:07