Answer the question
In order to leave comments, you need to log in
Why doesn't paramico list files?
import paramiko
host = '***.***.***.***'
user = '********'
secret = '********'
port = 22
client = paramiko.SSHClient()
client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
client.connect(hostname=host, username=user, password=secret, port=port)
stdin, stdout, stderr = client.exec_command('cd /')
stdin, stdout, stderr = client.exec_command('ls')
data = stdout.read() + stderr.read()
print data
client.close()
stdin, stdout, stderr = client.exec_command('ping localhost -c 3')
data = stdout.read() + stderr.read()
print data
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question