how to make remote login and remote installation via libssh
ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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 ?
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.