I created a new key pair using ssh-keygen and added the public key on the server. Using sftp -i private_key_file user@server
I can successfully open a connection to the server and put files.
However, when I try to use the Ant scp task I receive:
com.jcraft.jsch.JSchException: invalid privatekey: [B@5e9d5728
The relevant part of the Ant script:
<scp file="local-file.zip"
trust="true"
sftp="true"
todir="user@server:/dir/to/put/files"
keyfile="private_key_file"
verbose="true"/>
Does anyone have an idea ?