For Programmers: Free Programming Magazines  


Home > Archive > Unix Programming > September 2007 > Re: Control stdin/stdout of an other program.. How can I do that ?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: Control stdin/stdout of an other program.. How can I do that ?
Pascal Bourguignon

2007-09-24, 8:09 am

Benoit Lefebvre <benoit.lefebvre@gmail.com> writes:

> Hi,
> I know that ssh keys exists.. I know about ssh_agent and all these
> things..
> But I'm limited in my environment and I won't be able to change
> these things to put an ssh key everywhere.
>
> What I want to do is connect to a list of servers via ssh (OpenSSH)
> and only get prompted for the password once (assuming the password is
> the same for all the servers).
>
> I would like my program to start ssh, get the "password:" prompt and
> then issue the password. Once this is done, leave the session to me.
> Like if I could send keys to a system() call.
> Actually, this thing will be used to issue commands to many servers
> at the same time to do basic administration.. like creating a user on
> many systems.
>
> I've seen in the past some softwares reading/writing to the passwd
> command.. for example P-Synch from MTechIT.. the problem is that I
> haven't seen the source code and I'm having problems finding what I am
> looking for with the stdin/stdout/read/write keywords..
>
> Anyone can refer me to an open source application that do soemthing
> similar or a basic script example.
>
> PS: I'm planning on developping in c/c++ on an AIX 5L environment


I think ssh-agent is designed to do what you want.
http://linuxmafia.com/pub/os2/stahl.../ssh-agent.html

--
__Pascal Bourguignon__ http://www.informatimago.com/
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2010 codecomments.com