Ethical Hacking

Learn to find vulnerabilities before the bad guys do! Gain real world hands on hacking experience in our state of the art hacking lab. Course designed and taught by expert instructors with years of penetration testing experience. 12 student maximum in every class. Certification attempt included in every package.
Computer Forensics Training at InfoSec Institute

Gain the in-demand skills of a certified computer examiner, learn to recover trace data left behind by fraud, theft, and cybercrime perpetrators. Discover the source of computer crime and abuse at your organization so that it never happens again. All of our class sizes are guaranteed to be 12 students or less to facilitate one-on-one interaction with one of our expert instructors.




Network Security Secure-Shell
[Top] [All Lists]

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

Subject: Re: how can I input password in popen("ssh...") ?
Date: Tue, 28 Jun 2005 09:16:28 +0300 (IDT)
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

<Prev in Thread] Current Thread [Next in Thread>