【发布时间】:2016-06-22 06:56:24
【问题描述】:
我想通过 SSH -vvv host 命令使用不需要密码的 python 脚本检查一堆 IP 地址的身份验证方法(公钥或密码或两者)。
基本上我对结果的下面一行感兴趣:
debug1: Authentications that can continue: publickey,password
这是我尝试过的,但由于它要求输入密码,所以它不起作用。
process = subprocess.Popen("ssh -vvv host", shell=True,
stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
output,stderr = process.communicate()
status = process.poll()
print output
有人可以帮忙吗?
【问题讨论】: