Running Sudo Command with paramiko

前端 未结 4 840
北荒
北荒 2020-11-30 08:25

I am trying to execute a sudo command on a remote machine using python-paramiko, when I execute the command, I bind it with 3 streams, and I use the input stream to pass the

4条回答
  •  粉色の甜心
    2020-11-30 08:54

    I was able to implement this solution which was found in other Stackoverflow threads.

    https://www.reddit.com/r/learnpython/comments/60taz7/execute_sudo_su_and_input_password_with_paramiko/df94q7s/

    The solution for me was to use invoke_shell() when requiring the use of commands with sudo.

提交回复
热议问题