I have been trying to figure out how to manually run a sudo command with Exscript, but the way to do so escapes me. I'm trying to use send() to send the sudo command, but I can't seem to detect the password prompt after I do so.
I think send() may be the wrong way to invoke a sudo, but I can't find another way when I use SSH2().
There's probably some exscript automation that could handle the sudo in a "black box" manner, but I'd like to have full control over what happens when I try to sudo... so I'd prefer to do something along the lines of manual send(), expect(), etc...
I have been trying to figure out how to manually run a sudo command with Exscript, but the way to do so escapes me. I'm trying to use
send()
to send the sudo command, but I can't seem to detect the password prompt after I do so.I think
send()
may be the wrong way to invoke a sudo, but I can't find another way when I useSSH2()
.There's probably some exscript automation that could handle the sudo in a "black box" manner, but I'd like to have full control over what happens when I try to sudo... so I'd prefer to do something along the lines of manual
send()
,expect()
, etc...I'm running exscript 2.6.3 / Python 3.8.12 / macOS Catalina...
Could someone give me a pointer on how to fix this script?