Spaces:
Running
Running
File size: 508 Bytes
af4a00b |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
import paramiko
# create ssh client
ssh_client = paramiko.SSHClient()
# remote server credentials
host = "s1.serv00.com"
username = "hashir672"
password = "gVlwXbMsxPAA36%!OSIm"
port = 22
ssh_client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh_client.connect(hostname=host,port=port,username=username,password=password)
ftp = ssh_client.open_sftp()
files = ftp.listdir()
print("Listing all the files and Directory: ",files)
# print('connection established successfully')
ssh_client.close() |