Re: Executing Unix commands on a remote host using C

From: Pascal Bourguignon (spam_at_mouse-potato.com)
Date: 09/28/05


Date: Wed, 28 Sep 2005 21:27:30 +0200


"Bader" <baderA@gmail.com> writes:

> How can I implement the following in C/C++:
> 1. Create a sub-process

  fork(2)

> to start

  exec(2)

> an SSH session to a remote host

  ssh(1)

> 2. Then using the created session within my program I need to
> issue/send multiple commands

  popen(2)
  pipe(2)
  write(2)

> to the remote host to run different
> programs.
>
> In particular I don't know how to send multiple commands using the same
> SSH session (sub-process already created) in 1.

  write(2)

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