​import paramiko #SCP Init ssh = paramiko.SSHClient() ssh.load_system_host_keys() ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) ssh.connect(scp_ipaddress, username="root", password="") sftp = ssh.open_sftp() #Your windows/Linux/MAC PC local path where your file is stored localpath = os.getcwd() + '\\your_local_file_directory\\' #Your Linux PC file path, where you want to transfer the file remotepath = '/your_remote_directory/' #Your file name file_name = "sample.txt" #Put file into the remote path from local path #sftp.put(source, target) sftp.put(os.path.join(localpath + '//' + file_name), remotepath + '/' + file_name) #Get file from the remote path and put it into local path #sftp.get(source, target) sftp.get(remotepath + '/' + file_name, os.path.join(localpath + '//' + file_name))