I can't make working a scp command with sshpass when using a custom identity file and a custom port. When activate verbose mode (sshpass -v) I can see scp (or something) is asking for the private key passphrase.
The scp alone is working fine, when I enter the passphrase:
scp -P 30001 -i /home/debian/sshkey-withpass_rsa file.txt debian@server.net:/home/debian/
Enter passphrase for key '/home/debian/sshkey-withpass_rsa':
file.txt 100% ...
But it does not work with sshpass (version 1.09). There is no error, it just hang... If I active verbose (sshpass -v) I can see the "Enter passphrase for key..." message.
The password is the first line of file /home/debian/sshkey-withpass_rsa.txt.
sshpass -f /home/debian/sshkey-withpass_rsa.txt scp -P 30001 -i /home/debian/sshkey-withpass_rsa file.txt debian@server.net:/home/debian/
Any idea ? Thanks