Hi,

Sometimes I need to "su root" and execute some command, I tried to use the
chan = invoke_shell(), chan.send("su root") , wait the output and finally
send the passwd. After that, I use the chan.send("whoami") to check if it's
successful executed.
Bu I found the behavior is a bit different from the formal exec_command()
call, basically because of the channel management. For the exec_command
style, seems like each time a new channel is produced, I can easily set a
timeout to close it. But for the invoke_shell() style I need to reuse that
channel and I can't simply close the channel, because if it's closed, then I
need to invoke_shell() and "su root" again.

So is there a way to "su root" only one time to make each exec_command take
the advantage of root privilege?

Thanks.

-- 
>: ~
_______________________________________________
paramiko mailing list
paramiko@lag.net
http://www.lag.net/cgi-bin/mailman/listinfo/paramiko

Reply via email to