diff --git a/ledgergw/management/commands/cba_sync.py b/ledgergw/management/commands/cba_sync.py index b2118e8dc..2014f6f94 100644 --- a/ledgergw/management/commands/cba_sync.py +++ b/ledgergw/management/commands/cba_sync.py @@ -40,7 +40,7 @@ def handle(self, *args, **options): print ("removing "+lbf) os.remove(local_bank_directory+lbf) - result = subprocess.check_output('echo "ls '+remote_bank_directory+'" | sftp -o StrictHostKeyChecking=no -i /tmp/bank.key '+sftp_username+'@'+sftp_host, shell=True, text=True) + result = subprocess.check_output('echo "ls '+remote_bank_directory+'" | sftp -o HostKeyAlgorithms=+ssh-rsa -o PubkeyAcceptedAlgorithms=+ssh-rsa -o StrictHostKeyChecking=no -i /tmp/bank.key '+sftp_username+'@'+sftp_host, shell=True, text=True) sftpfiles = result.split("\n") for file in sftpfiles: sftp_file = file.strip() @@ -53,7 +53,7 @@ def handle(self, *args, **options): print ("File already exists not downloading "+file_only) else: print ('downloading file '+file_only) - get_resp = subprocess.check_output('echo "get '+sftp_file+' '+local_bank_directory+'" | sftp -o StrictHostKeyChecking=no -i /tmp/bank.key '+sftp_username+'@'+sftp_host, shell=True, text=True) + get_resp = subprocess.check_output('echo "get '+sftp_file+' '+local_bank_directory+'" | sftp -o HostKeyAlgorithms=+ssh-rsa -o PubkeyAcceptedAlgorithms=+ssh-rsa -o StrictHostKeyChecking=no -i /tmp/bank.key '+sftp_username+'@'+sftp_host, shell=True, text=True) #print (get_resp) os.remove('/tmp/bank.key') except Exception as e: