# --*-- coding:utf-8 --*-- import paramiko ip = '192.168.1.200' port = 22 username = 'pi' password = 'raspberry' session_timeout = 60 client = paramiko.SSHClient() #client.get_host_keys().add('ssh.example.com', 'ssh-rsa', key) client.set_missing_host_key_policy(paramiko.AutoAddPolicy()) client.connect(ip, username=username, password=password) stdin, stdout, stderr = client.exec_command('ls') for line in stdout: print '... ' + line.strip('\n') client.close()