Re: how can I input password in popen("ssh...") ?

From: Alexander Klimov (alserkli_at_inbox.ru)
Date: 06/28/05

  • Next message: Richard Jones: "OpenSSH, Kerberos, GSSAPI, and windows clients"
    Date: Tue, 28 Jun 2005 09:16:28 +0300 (IDT)
    To: huang bo <bhuang@qubit-star.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 ?

    http://search.cpan.org/~ivan/Net-SSH-0.08/SSH.pm:
    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
    

  • Next message: Richard Jones: "OpenSSH, Kerberos, GSSAPI, and windows clients"