in reply to Send password in Net::SSH::Expect
Perhaps use the existing ssh-copy-id that comes with most of the *NIX ssh implementations?
Update: Aaah, I missed you're trying to put the key from box B onto box C run from A ( A =hop=> B =hop=> C). It'd be a cleaner thing to run than your cat | ssh cat >>... but it's still going to prompt for the remote password going to the third box C.
Second update: Never used it, but reading over the docs I think you want to do something like this with send rather than exec:
## ... setup through to your login call the same $ssh->send( qq{ssh-copy-id bkpuser\@10.11.12.13} ); $ssh->waitfor( qq{Password:} ); $ssh->send( $epass );
The cake is a lie.
The cake is a lie.
The cake is a lie.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Send password in Net::SSH::Expect
by gafaman (Novice) on Jan 23, 2020 at 08:41 UTC | |
by gafaman (Novice) on Jan 23, 2020 at 08:51 UTC | |
by Corion (Patriarch) on Jan 23, 2020 at 09:03 UTC | |
by gafaman (Novice) on Jan 23, 2020 at 09:24 UTC | |
by Corion (Patriarch) on Jan 23, 2020 at 09:36 UTC | |
|