Question on input password on ssh prompt



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.

#my.pl
$user = "user";
$passwd = "mypasswd";
$ipaddress = "somehost";
$command = "ls -la";
..
print ("Invoke command on host : $ipaddress);
system("ssh $user\@$ipaddress $command");
#check for error message come back from the system call.
#Todo: need to input the password.
...
---end here ---

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.

My question is:
1) Is that a way I can feed it the password without install any
module?, if so, how?
2) Or where I can find out more regarding input after prompt
waiting?
3) is that a way I can get the command (in this case ls -la) return
result?

Thanks for any input,

Regards,
Mav

.



Relevant Pages

  • Scripts using SSH and SSH_ASKPASS
    ... To test SSH scripts you better destroy the control TTY. ... The trick is to run YOUR script on YOUR local ... As for the password relaying command: this needs not be an X command. ... # we read one line from a temporary pipe. ...
    (comp.security.ssh)
  • Re: Question on input password on ssh prompt
    ... I am writing a perl script running on the XP, ... command to the remote host. ... Is that a way I can feed it the password without install any ... into linux entry thru ssh command. ...
    (comp.lang.perl.misc)
  • Re: Question on input password on ssh prompt
    ... I am writing a perl script running on the XP, ... However right after I made the system call for ssh, ... Is that a way I can feed it the password without install any ...
    (comp.lang.perl.misc)
  • Re: remote server backup script
    ... > Just type away at the command line. ... Make a backup of whatever you want ... > command line, in a script. ... >>the server ssh key on the clients machine). ...
    (comp.os.linux.misc)
  • RE: Using LWP to Browse a Perl Page
    ... On running the command install Crypt::SSLeay I found that the scripts ... the address points to a Perl script. ... Did you view source for the frame or the original page? ...
    (perl.beginners)