Re: Question on input password on ssh prompt
- From: Ben Morrow <ben@xxxxxxxxxxxx>
- Date: Sun, 16 Sep 2007 11:31:49 +0100
Quoth Mav <mluvw47@xxxxxxxxx>:
Hi, all<snip>
I am writing a perl script running on the XP, the machine already
have openssh installed. The script would call ssh command and send a
command to the remote host.
The code like.
However right after I made the system call for ssh, it prompts for the
password.
c:\>perl my.pl
Invoke command on host : somehost
enter password: <--- my program stopped right here waiting.
I understood that perl provides pm packages (in this case SSH) to
get this work done, but the script I am going to run, only will get
the perl installed and perl.dll, not extra module.
You can use PAR (from CPAN) to package a script plus all dependant
modules up into a single file that can be run with just perl installed.
It's really not worth avoiding the use of modules.
My question is:
1) Is that a way I can feed it the password without install any
module?, if so, how?
No. However, you can switch to public-key authentication, which doesn't
require you enter the password.
2) Or where I can find out more regarding input after prompt
waiting?
Err... under Unix, the answer is 'use a pty'. I don't know if it is even
possible to emulate this under Win32: it depends on exactly how ssh
prompts for the password.
Ben
.
- Follow-Ups:
- References:
- Question on input password on ssh prompt
- From: Mav
- Question on input password on ssh prompt
- Prev by Date: Re: `command 2>&1 > file` without the shell?
- Next by Date: Re: strange behaviour with 'use open IN => ":byte"
- Previous by thread: Question on input password on ssh prompt
- Next by thread: Re: Question on input password on ssh prompt
- Index(es):
Relevant Pages
|