in reply to Using Expect.pm and username/password to ssh to a host

You say that empty pass phrase SSH identity keys are not allowed, but if you're going to hardcode in passwords anyway, perhaps you could simply automate loading the ssh key and then you could avoid having to Expect the ssh login.

# Run your perl script inside of an ssh-agent(1) context $ENV{SSH_ASKPASS} = "/path/to/script/that/echos/password"; system("ssh-add id_filename </dev/null"); # Continue with your process

Otherwise, assuming that you read the docs and are dead set on doing this anyway, I think you're looking for IPC::Open3.


If anyone needs me I'll be in the Angry Dome.

Replies are listed 'Best First'.
Re: Re: Using Expect.pm and username/password to ssh to a host
by BUU (Prior) on May 10, 2004 at 23:16 UTC
    Unless I'm badly confused, I don't think IPC::Open3 will work. I assume Expect would try every method available to ipc::open3, plus a few more, and he's already mentioned that expect doesn't work.