in reply to mixing perl expect ssh and local commands

Common SSH clients read the password from the TTY, not from STDIN. Try using a certificate to authenticate yourself or check (man ssh or ssh --help) if your SSH client could be forced to read the password from STDIN.

Note that your program contains clear-text password and due to this it is a high security risk.

  • Comment on Re: mixing perl expect ssh and local commands