Question on input password on ssh prompt
- From: Mav <mluvw47@xxxxxxxxx>
- Date: Sat, 15 Sep 2007 22:20:54 -0000
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
.
- Follow-Ups:
- Re: Question on input password on ssh prompt
- From: Jim Gibson
- Re: Question on input password on ssh prompt
- From: Ben Morrow
- Re: Question on input password on ssh prompt
- Prev by Date: Re: how to remove parentheses from a line in a file - need help!
- Next by Date: Re: $string =~ /$pattern/i
- Previous by thread: FAQ 4.21 How do I remove consecutive pairs of characters?
- Next by thread: Re: Question on input password on ssh prompt
- Index(es):
Relevant Pages
|
|