Re: how can I input password in popen("ssh...") ?
From: Robert Hajime Lanning (robert.lanning_at_gmail.com)
Date: Tue, 28 Jun 2005 09:08:49 -0700 To: firstname.lastname@example.org
For security reasons, ssh opens /dev/tty for reading user input (like
You will need to use something like "expect" to script ssh sessions.
On 6/27/05, huang bo <email@example.com> wrote:
> 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 firstname.lastname@example.org ls /etc", "w");
> if ( fp )
> fwrite(passwd , strlen(passwd) , 1 ,fp) // enter password here
> Best Regards
> falls huang
-- END OF LINE -MCP