我使用了
subprcess.Popen("ssh -qTfNg -D 8999 user@hostname", shell = True, stdin = subprocess.PIPE, stdout = subprocess.PIPE, stderr = subprocess.PIPE)
但是还是没有办法得到获取到ssh命令要求password的那个提示,也没法输入密码orz,现在用pexpect模块实现了我想要的功能,但是还是很好奇为什么subprocess不可以。
subprcess.Popen("ssh -qTfNg -D 8999 user@hostname", shell = True, stdin = subprocess.PIPE, stdout = subprocess.PIPE, stderr = subprocess.PIPE)
但是还是没有办法得到获取到ssh命令要求password的那个提示,也没法输入密码orz,现在用pexpect模块实现了我想要的功能,但是还是很好奇为什么subprocess不可以。
