in reply to Re: Expect OpenSSH sudo login is failing
in thread Expect OpenSSH sudo login is failing

Well since I am passing in several arguments, and the password contains spaces, that is where I'm using the escapes:

In the example below, the final argument is the root password that contains spaces

<blocktext>
user@host:> perl perlscript.pl one two three four root\ pass\ word
</blocktext>

btw, I have tested the password when manually connected to the remote system and the password is correct

Replies are listed 'Best First'.
Re^3: Expect OpenSSH sudo login is failing
by archeman2 (Novice) on Apr 20, 2017 at 21:55 UTC

    I suspect that I may have found the root cause, at least it is 'kind of' working now that I have made the following change:

    [ qr/$rootpassword/ => sub { shift->send("$password\n");} ],

    Changed to:

    [ qr/$rootpassword/ => sub { shift->send("$rootpassword\n");} +],

    So it may have in fact been the wrong password