Skip to content
Discussion options

You must be logged in to vote

Hey @pankajkoti - I ended up changing it to not use the SFTPHook and got it to work.

def send_to_sftp(filename):
    var_key = Variable.get("Key")
    ssh = paramiko.SSHClient()
    ssh.set_missing_host_key_policy(paramiko.client.WarningPolicy)
    host = "host.com"
    key = paramiko.RSAKey.from_private_key(io.StringIO(var_key))
    ssh.connect(host, port=###, username='xxxxxxxx', pkey=key, disabled_algorithms=dict(pubkeys=["rsa-sha2-512", "rsa-sha2-256"]))
    sftp = ssh.open_sftp()
    sftp.put('./'+filename,filename)
    print('File uploaded')

Replies: 8 comments 4 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
4 replies
@pankajkoti
Comment options

@ryanczarny
Comment options

@ryanczarny
Comment options

Answer selected by ryanczarny
@pankajkoti
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants
Converted from issue

This discussion was converted from issue #31300 on May 16, 2023 15:01.