使用子进程-python-windows为ssh密钥注入密码

问题描述

我正在编写一个脚本,用于通过互联网自动连接和执行命令。我想使用这个脚本连接到我的树莓派:

def establish_connection(cmd=" ssh pi@00.0.000.000",*args):
   passphrase = "my_passphrase "
   proc = subprocess.popen(cmd,stdout=subprocess.PIPE,stdin=subprocess.PIPE,shell=True)

   # at this point "Enter passphrase for key 'C:\Users\.../id_rsa':" pops out in the therminal and im not able 
   # to pass that passphrase 

我尝试了很多东西,但找不到适用于 Windows 的正确答案

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)