Re: ssh in C++

From: Margar Simonyan <Margar.Simonyan_at_cern.ch>
Date: Wed, 13 Aug 2008 19:57:21 +0200


Hello

I have read this e-mail and tried it just for fun. It works out of box on ubuntu 7.10, one command to install sshfs and other to mount remote filesystem, no configuration was required.

Margar



 Margar Simonyan ------ post-doctoral researcher  LAPP, 9 Chemin de Bellevue, BP 110 F-74941, Annecy-le-Vieux  Tel: +33450091785 +41227671123 (CERN)

On Wed, Aug 13, 2008 at 7:23 PM, Manungu Kiveni <mkiveni_at_physics.syr.edu> wrote:
> 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:57:27 CEST

This archive was generated by hypermail 2.2.0 : Thu Aug 14 2008 - 17:50:01 CEST