[paramiko] su: must be run from a terminal

Eri Ramos Bastos bastos.eri at gmail.com
Mon Nov 9 06:49:51 PST 2009


Thanks, Eric.
I'm still struggling, though.

> shell.sendall('su -c "cat /var/spool/cron/%s" \n' % SOURCE_CLIENT_NAME )
> shell.sendall("root_password" + '\n')
>
> result = shell.recv(1024)
>
> result should contain more or less what you expect.

print result returns:

su -c "cat /var/spool/cron/user" \r\nroot_password\r\n

I tried to increase the recv size to 4096 but got nothing.

Also I checked the other recv_* methods and they don't look to return
the command. This recv looks like the right one, but it comes out
empty.


> Sys Admin and programmers are not living far away from each other.
> You'll be soon be speaking Greek fluently :-)

Yeah... I started use Python due to bash script limitations and I loved it. ;)
Still having problems like understanding documentation, but I'll learn
sooner or latter.

[]'s
Eri Ramos Bastos



More information about the paramiko mailing list