import paramiko |
ssh = paramiko.SSHClient() |
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) |
ssh.connect(hostname = "example.com" , username = "username" , password = "password" ) |
stdin, stdout, stderr = ssh.exec_command( "ls -l" ) |
for line in stdout.readlines(): |
print (line.strip()) |
ssh.close() |