Kevin
Kevin

Reputation: 557

Input Redirection for Password in Perl Script from Command Prompt

I am using a Windows System Command Prompt to call on a Perl Script. At one point and time, the Perl Script calls on svn+ssh to update a repo. The repository that is called asks the for user input - specifically a password.

I am trying to automate the execution of the Perl Script, but it continually gets hung up on the call to svn. I have tried many forms of input redirection (specifically < with an external file, | with cat, and the windows power shell use of the @ symbol to specify a multi-lined string). Is there a way to input a password for this Perl script?

For purposes of this problem, I do not have access to the Perl Script and I will need to implement a work around.

Upvotes: 0

Views: 693

Answers (1)

Moritz Both
Moritz Both

Reputation: 1628

You don't mention the svn+ssh implementation the script uses, but my guess is that the problem is this:

SSH clients tend to ask for passwords directly from the terminal. Password prompts often don't read from stdin, so you can't redirect input. For example, the OpenSSH client does it that way. It is designed that way to prevent users from doing insecure things - like storing passwords in files, environment variables or shell variables.

The common recommandation in this situation is to use public key authentication.

Without knowing your script, it will not be possible to come up with a workaround I think.

Upvotes: 2

Related Questions