Re: Question on input password on ssh prompt




Quoth Mav <mluvw47@xxxxxxxxx>:
Hi, all
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.
<snip>

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

.



Relevant Pages

  • Re: Need help installing WWW-Search-Ebay-2.193 Module...
    ... One of the O'Reilly Books has a script that calls this ... perl Makefile.PL ... you may need to find and install command-line versions of tar and gzip ... > ActivePerl for Linux under Cygwin ...
    (comp.lang.perl.misc)
  • Cross-platform install - searching for a method (without java)
    ... Can interact with the system - that is, execute native ... Essentially, I had the idea of using Perl, sans-modules, ... Put the minimum I need to run a perl script into the ... it and kick off the real install script. ...
    (comp.programming)
  • multi-platform support for perl
    ... the way we install our product has to change. ... I have chosen Perl as the scripting language to do this. ... immediately downloaded the latest Perl source and built it on HP-UX. ... I have my .pm files stored in the same directory as my script. ...
    (comp.lang.perl.misc)
  • Re: shared libraries compatibility
    ... >> I want to write a perl script which will run on diverse client ... I don't want to force the clients to install any perl ... so I want to package them with my script. ...
    (comp.lang.perl.misc)
  • Re: perl ssh vnc tunnel
    ... >>of course this doesn't work because it tryes to run vncviewer localhost on ... >>ssh server rather then on my box. ... > you don't need Perl for this. ... You can easily use a bash script which will ...
    (perl.beginners)