I have a script that works on different clients, and need to SCP files to different hosts. Depending on the combination of client & server, I may need to use password authentication or public key authentication. I cannot really know in advance which one to use.
There are 2 CPAN libraries for SCP that I use:
- Net::SCP: works with public key authentication only
- Net::SCP::Expect: works with password authentication only
The problem is that neither library works for both authentications, and I don't know which one to use in advance. Do you know of any way to work with both authentication schemes?