You want to get data from your server. you use it.
ssh_key_location = "/your/private/key/location.pem"
server_ip = "user server ip"
username = "your user name"
password = "your password" # If you will use private key, you don't have fill it.
You can choice to use many or one command.
print("Executing {$",command,"}")
stdin , stdout, stderr = con.exec_command(command)
print(stdout.readlines())
print("===== Errors ======")
print(stderr.readlines())
for command in commands:
print("Executing {$", f"{command}", "}")
stdin , stdout, stderr = con.exec_command(command)
print(stdout.read())
print("===== Errors ======")
print(stderr.read())
I will update to add connect sftp and get file to local ASAP.
http://www.paramiko.org/index.html http://docs.paramiko.org/en/latest/index.html