Alright, so i am trying to implement paramiko in my python script.
The aim is to connect to another PC in the same LAN and execute the command through python.
My python version:
Python 2.7.6 (default, Oct 26 2016, 20:30:19)
[GCC 4.8.4] on linux2
I have a basic code here:
import paramiko
client = paramiko.SSHClient()
host = '192.168.xx.xx'
username = 'username'
password = 'password'
client.connect(host, username=username, password=password)
stdin, stdout, stderr = client.exec_command('ls')
for line in stdout:
print('... ' + line.strip('\n'))
client.close()
But then I get the following error:
No handlers could be found for logger "paramiko.transport"
Traceback (most recent call last):
File "testbed.py", line 8, in <module>
client.connect(host, username=username, password=password)
File "/usr/local/lib/python2.7/dist-packages/paramiko/client.py", line 385, in connect
t.start_client(timeout=timeout)
File "/usr/local/lib/python2.7/dist-packages/paramiko/transport.py", line 543, in start_client
raise e
TypeError: 'type' object is not iterable