
On 9/28/07, Jean-Paul Calderone <exarkun@divmod.com> wrote:
On Thu, 27 Sep 2007 15:00:14 -0500, paul_s_johnson@mnb.uscourts.gov wrote:
Here's the line that instaniates my SSH object (also repeated at the end of my code):
myssh = SSH("my.host.com", "myusername", "mypasswd", ["id; su - root; myrootpasswd; id", "pwd", "ls -l"])
I suspect the list element which includes "su - root; myrootpasswd;" won't achieve the desired affect. Even if su weren't careful to try to read from a pty, "myrootpasswd" won't be sent to its stdin, it'll be executed by the shell after "su - root" exits, which it probably won't since nothing is going to write a password to it.
What you'll do is on the channel object which runs these commands, you'll use the .write() method to send the root password to su. -p -- Paul Swartz paulswartz at gmail dot com http://z3p.livejournal.com/ AIM: z3penguin