Paramiko and Python 2.6
Hi, I am using paramiko to try and ssh2 into my linux box and run some cli commands(NOT a linux shell). Is this possible, because the following code segment is not working:
Code:
in, out, err = sshObj.exec_command(cmdStr) Thanks in advance. |
What is cmdStr set to, and how are you initialising sshObj? Essentially, can you give us a complete piece of code that runs properly, the output you get when running it, and the output you expect?
EDIT: Wait, are you trying to run a 'sudo' command? In which case the 'Password:' prompt is not the last line of the login, but a request for the sudo password. Just add: Code:
in.write('password\n') |
All times are GMT -5. The time now is 08:56 PM. |