微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

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

如何解决使用子进程-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 举报,一经查实,本站将立刻删除。