python3 subprocess run sudo cmd in remote failed
Hello, I use python3.5 and found no way to solve this problem
>from subprocess import Popen, PIPE
>ps = Popen('ssh -o \'StrictHostKeyChecking no\' hello at 192.168.80.11 \'sudo
sysctl -w vm.drop_caches=3\', stdin=PIPE, stdout=PIPE, stderr=PIPE,
> hello at 192.168.80.11's password:
what I tried many times like enter password, but it failed.
I just want to use ps.stdin.write(password) to send password, but it always
jump password prompt immediately.
How to solve this