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:08:49 -0700
For security reasons, ssh opens /dev/tty for reading user input (like
passwords).

You will need to use something like "expect" to script ssh sessions.

On 6/27/05, huang bo <bhuang@qubit-star.com> wrote:
Hello!

    I'm new to openssh.I used sshv2 with OpenSSH_3.8.1p1 and I can only use 
password authentication
in my server.

    I forked a process to execute ssh , but I can't input password, how can I 
do it ?

   Below is my code:

   char *passwd = "xxxxxx\n"
   fp = popen("/usr/bin/ssh falls@192.168.10.234 ls /etc", "w");
   sleep(1)
   if ( fp )
       fwrite(passwd , strlen(passwd) , 1 ,fp)   // enter password here


Best Regards
falls huang



-- 
END OF LINE
       -MCP

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