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