Re: Executing remote command with paramiko

2009-08-03 Thread Piet van Oostrum
> Hussein B (HB) wrote: >HB> Hey, >HB> I'm trying to run a sudo guarded command over SSH using paramiko >HB> +++ >HB> s = paramiko.SSHClient() >HB> s.load_system_host_keys() >HB> s.connect(hostname, port, username, passwd) >HB> stdin, stdout, stderr = s.exec_command('sudo -s')

Executing remote command with paramiko

2009-08-03 Thread Hussein B
Hey, I'm trying to run a sudo guarded command over SSH using paramiko +++ s = paramiko.SSHClient() s.load_system_host_keys() s.connect(hostname, port, username, passwd) stdin, stdout, stderr = s.exec_command('sudo -s') stdin.write('password\n') stdin.flush() print 'Flushing' stdin,