0

I devloped a code that is to transfer files from local to AWS server using SSH. The code is worked locally but issue is after converting python package to executable(.exe) file when i run that executable file (file not found)error is raised. That error is key_filename path issue. Here is my code :

import paramiko
from captured_images import function_name
import os

HOST = Host
COMMAND = "ls"
ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())

def imgfun():
    while True:
        newimg = function_name()
        x = newimg.run()
        ssh.connect(hostname=IP, username=username, key_filename=Key_filename)
        sftp_client = ssh.open_sftp()
    
        sftp_client.put(scource path, destination path)
    
        sftp_client.close()
        ssh.close()
        
imgfun()

Here the error is path issue. So is there any other way to connect AWS server for transferring files from local to AWS server without key_filename.

Thanks all Swaroop

0 Answers0