Ka0sFact0r has asked for the wisdom of the Perl Monks concerning the following question:

Hi! I am using a perl script to connect to establish an ssh connection to a remote server. From there I establish a secondary connection to remote devices. The initial connection works fairly well except for one thing... I don't know how to get it to wait for the password prompt and send a stored password. In the past this has not been an issue but I now need to design a straight GUI application instead of using the cmd prompt to launch. So my question is can someone point me to something that can watch for the password prompt and then send a password? I tried looking at some of the SSH modules out there but none of them seemed to do exactly what I needed it to do.

Replies are listed 'Best First'.
Re: connect to remote server
by mr_mischief (Monsignor) on Jun 20, 2014 at 20:09 UTC
Re: connect to remote server
by blue_cowdawg (Monsignor) on Jun 20, 2014 at 19:29 UTC

    I'm not sure I'm getting your requirement here. Are you trying to:

    home host --- ssh connection ---> intermidiate host -- ssh --> h +osta h +ostb h +ostc
    If it is, why not cut out the middle man?

    As far as using a module to connect where a password is required I am positive there are CPAN modules that do that since I've written quite a few scrips over the years that use that behavior.

    Wait until CPAN comes back and check out http://search.cpan.org using "ssh" as a search term.


    Peter L. Berghold -- Unix Professional
    Peter -at- Berghold -dot- Net; AOL IM redcowdawg Yahoo IM: blue_cowdawg