Below is the python program which will connect to SFTP server, upload a file to SFTP server and delete a specific file from SFTP server. Here is the code: import paramiko from paramiko.ssh_exception import SSHException import os import time hostname = 'hostname here' username = 'username here' password = 'password here' port = PORT_NO SSH_Client = paramiko.SSHClient() SSH_Client.set_missing_host_key_policy(paramiko.AutoAddPolicy()) SSH_Client.connect(hostname=hostname, port=port, username=username, password=password, look_for_keys=False) sftp_client = SSH_Client.open_sftp() print("Connection successfully established ... ") remoteFilePath = "/home" # Output: lists of files ['my-directory', 'my-file'] print(f"li...
Blog which contains C#, asp.net, asp.net MVC, Selenium webdriver with core java, Bootstrap, Jquery and many more