Re: Executing Unix commands on a remote host using C
From: Pascal Bourguignon (spam_at_mouse-potato.com)
Date: 09/28/05
- Next message: Bjorn Reese: "Re: How can a server know its own IP address"
- Previous message: usenet_at_sta.samsung.com: "POSIX based Timer class, occasional crash"
- In reply to: Bader: "Executing Unix commands on a remote host using C"
- Next in thread: Måns Rullgård: "Re: Executing Unix commands on a remote host using C"
- Reply: Måns Rullgård: "Re: Executing Unix commands on a remote host using C"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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/
- Next message: Bjorn Reese: "Re: How can a server know its own IP address"
- Previous message: usenet_at_sta.samsung.com: "POSIX based Timer class, occasional crash"
- In reply to: Bader: "Executing Unix commands on a remote host using C"
- Next in thread: Måns Rullgård: "Re: Executing Unix commands on a remote host using C"
- Reply: Måns Rullgård: "Re: Executing Unix commands on a remote host using C"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]