Closed matthieumarrast closed 2 months ago
We installed an sftpsend plugin configured with an ECDSA key pair.
But we face the below error while connecting to the sftp server:
2024-09-16T14:40:56.970012Z [WARNING] (mfdata.plugin.main#1565142) Exception: unpack requires a buffer of 4 bytes during SFTP connect {hostname=server user=user}
As per the code https://github.com/metwork-framework/mfdata/blob/master/plugins/sftpsend/main.py the key is read with code: key = paramiko.RSAKey.from_private_key_file(self.sftp_key_file) where it should be paramiko.ecdsakey for an ecdsa key... cf. https://docs.paramiko.org/en/latest/api/keys.html#module-paramiko.ecdsakey
key = paramiko.RSAKey.from_private_key_file(self.sftp_key_file)
paramiko.ecdsakey
maybe we should add a config for the plugin to identify which class must be used:
# SFTP ssh key algorithm (rsa, ecdsa) # default: rsa sftp_key_algorithm=rsa
We installed an sftpsend plugin configured with an ECDSA key pair.
But we face the below error while connecting to the sftp server:
As per the code https://github.com/metwork-framework/mfdata/blob/master/plugins/sftpsend/main.py the key is read with code:
key = paramiko.RSAKey.from_private_key_file(self.sftp_key_file)
where it should beparamiko.ecdsakey
for an ecdsa key... cf. https://docs.paramiko.org/en/latest/api/keys.html#module-paramiko.ecdsakeymaybe we should add a config for the plugin to identify which class must be used: