Skip to content

Instantly share code, notes, and snippets.

@ikkebr
Created February 26, 2018 02:57
Show Gist options
  • Save ikkebr/6a32a8814e51ecbbccd3fcffe2644ba2 to your computer and use it in GitHub Desktop.
Save ikkebr/6a32a8814e51ecbbccd3fcffe2644ba2 to your computer and use it in GitHub Desktop.
import paramiko
client = paramiko.SSHClient()
client.load_system_host_keys()
client.set_missing_host_key_policy(paramiko.WarningPolicy())
server_add = "127.0.0.1"
username = "yyy"
password = "xxx"
client.connect(server_add, port=22, username= username, password= password)
stdin, stdout, stderr = client.exec_command("ls")
print stdout.read()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment