python - No response in ssh.exec_command in paramiko -


i trying use python paramiko execute commands on remote server. when run following commands prompt , appears have succeeded prompt back

>>> import paramiko >>> ssh = paramiko.sshclient() >>> ssh.set_missing_host_key_policy(paramiko.autoaddpolicy()) >>> ssh.connect('a.b.c.d', username='server', password='xyz') >>> 

the response when try execute command []

>>> stdin, stdout, stderr = ssh.exec_command("host") >>> stdout.readlines() [] 

almost command gives same output. command "host" when ssh executed shell gives several lines of usage output

i error if don't give password

>>> ssh.connect('a.b.c.d', username='server') traceback (most recent call last):  file "<stdin>", line 1, in <module>  file "build\bdist.win32\egg\paramiko\client.py", line 307, in connect  file "build\bdist.win32\egg\paramiko\client.py", line 520, in _auth  paramiko.ssh_exception.sshexception: no authentication methods available 

i don't know if ssh connection through , why commands not being executed.

should added authentication? missing something?


Comments

Popular posts from this blog

OpenCV OpenCL: Convert Mat to Bitmap in JNI Layer for Android -

android - org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope -

python - How to remove the Xframe Options header in django? -