Re: how can I input password in popen("ssh...") ?
From: Alexander Klimov (alserkli_at_inbox.ru)
Date: Tue, 28 Jun 2005 09:16:28 +0300 (IDT) To: huang bo <email@example.com>
On Mon, 27 Jun 2005, huang bo wrote:
> I'm new to openssh.
It does not mean that you can use search -- this question is asked and
answered quite often here. Should we add it to FAQ?
> I used sshv2 with OpenSSH_3.8.1p1 and I can only use password
> authentication in my server.
Ok, using public/private key pair is the preferred solution.
BTW: What prevents you from creating .ssh/authorized_keys?
> I forked a process to execute ssh , but I can't input password, how can I do it ?
Q: How do you supply a password to connect with ssh within a perl
script using the Net::SSH module?
A: You don't. Use RSA or DSA keys. See the ssh-keygen(1) manpage.
But ``Net::SSH::Perl enables you to simply and securely execute
commands on remote machines, and receive the STDOUT, STDERR, and exit
status of that remote command. It contains built-in support for
various methods of authenticating with the server (password
authentication, RSA challenge-response authentication, etc.).''
You can also use `expect' for this.
-- Regards, ASK