LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   how to make remote login and remote installation via libssh (http://www.linuxquestions.org/questions/programming-9/how-to-make-remote-login-and-remote-installation-via-libssh-582904/)

vdx 09-07-2007 07:13 AM

how to make remote login and remote installation via libssh
 
helo frnds,

I want to login into a remote system and install a package remotely,
for tht I found "libssh".

If is there any good tutorial or how to remote install and remote login via "libssh", then plz let me kno...abt tht...

thnx in advance....

theNbomr 09-07-2007 08:24 AM

It isn't clear from your question whether you want to write a program that uses ssh/ssl to perform a login & install procedure, or whether you want to use a ready-made tool to do this. If the latter, the ssh client can be used to login to a remote host (that must have a ssh daemon running). If the former, please provide more details of specifically what your application must do, and at least let us know what programming language you intend to implement it with. Many common libraries have bindings to numerous programming languages. It seems likely that an existing ssh client plus some shell scripting can be used to do most, if not all, of your objective.
--- rod.

vdx 09-08-2007 02:06 AM

dear theNbomr

thnx for ur replay.

Let me explain in brief.

I am using C (gcc) language for development of programs.

I am using RHEL5 distro and I wanna develop a program(daemon) tht can install a package to a remote PC.

for tht I have to first login into remote host and then have to install a desired package into it.

for tht I think tht libssh-0.2 can help me a lot.

so the question is, how to perform remote login and after tht the remote installation procedure in remote PC using my program.

Means my daemon works like this,
After each and every 1 hour, my program looks into a directory, and if it finds packeges then it installs it to a remote PC.
thts all.

so programatically how can I accomplish this ?

Is there any good tutorial for libssh ? or Any sample program ?

theNbomr 09-08-2007 11:13 AM

I took a look at the online documentation for the library, and I thought it looked pretty good. As for how to perform a software installation on the remote host, I think you will have to create a system that feeds command strings into your ssh connections, and then reads the responses. You will have to go through a number of manual installation sessions to see what strings are required (what stuff you would manually type).

Alternatively, you could simply set up a script or program on the remote host, and invoke it with a ssh session in a cron job. This sounds a lot easier, and more conventional.

Using either method, you will need to set up ssl keys on the respective machines to eliminate interactive password entry. If you haven't already done that, it would be the best place to start. You may learn something that is generally useful, even beyond the parameters of this project.

Get a start on your project and come back with some more specific questions.

--- rod.

vdx 09-09-2007 01:35 AM

dear theNbomr

thnx for reply me.

and the ssl key sounds me better hint for my project

so thnx once again...

I will work on tht and will give u good news soon...

chrism01 09-10-2007 10:23 PM

Re ssl key; don't you mean ssh auth-keys?
BTW, you could probably use eg rsync to put files across (rsync can use ssh protocol).


All times are GMT -5. The time now is 03:23 PM.