Re: ssh in C++

From: Manungu Kiveni <mkiveni_at_physics.syr.edu>
Date: Wed, 13 Aug 2008 13:23:39 -0400


Hi Tom,

The option C seem to be the one to go forward with. I am using linux operating system and have root installed in it. My concer is how to have sshfs setup before trying to mount the remore com puter. I have spend time trying to figure out this, but still no break. Suggestions are much appreciated.

Joseph

> Manungu Kiveni wrote:
>> I am writing an application that need to access files remotely, open and
>> read the file. The aim is to ptoduce a .dat file format and bring this
>> file to my computer (using scp for e.g). My question is how to use ssh
>> in
>> C++ to access remote machines.
>
> There are several possibilities, ranging from difficult to simple and
> straightforward:
> A) Compile the ssh libraries into your code and write C++ code
> to use them directly.
> B) Use the system() function to run scp on the local computer,
> explicitly transferring files to and from local copies.
> C) Before starting Root, use sshfs to mount the remote computer's
> directory locally and then just read and write its files (they
> appear as if they were local; scp is used to transfer them in
> a manner hidden to you).
> D) Run root completely locally, using scp manually to transfer
> files.
>
> As long as both machines can do (C), I highly recommend that method --
> it's by far the simplest of A-C, and the most general. It has overheads,
> but on modern hardware with a reasonably fast network they are not
> obtrusive unless you use very large files. A major virtue of (C) and (D)
> is that they are transparent for systems that require a manual
> cryptocard or other access device for authentication. You will likely
> find other applications for (C)....
>
> Any reasonably modern Linux or Mac OS machine can be configured to do
> (C); setup requires root access, but once set up an authorized non-root
> user can use it. I don't know about Windows. Google can find sshfs (it
> is based on fuse - file system in user space).
>
>
> Tom Roberts
>
Received on Wed Aug 13 2008 - 19:23:52 CEST

This archive was generated by hypermail 2.2.0 : Wed Aug 13 2008 - 23:50:01 CEST