python3 subprocess run sudo cmd in remote failed

Eli the Bearded * at eli.users.panix.com
Tue Sep 17 19:34:37 EDT 2019


In comp.lang.python, lampahome  <pahome.chen at mirlab.org> wrote:
> 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.

Passwords are frequently read from stderr, not stdin, so that tools can
get a human answered password from inside a pipleline providing stdin
to something downstream.

> How to solve this

Use some sort of out-of-band authentication. Jenkins (when I looked at
it) used ssh-agent. Ansible used sshpass. And you've already had
key-pairs suggested in a different reply.

Elijah
------
likes ssh-agent and key-pairs



More information about the Python-list mailing list