how to use execv system call to launch remote application on redhat 5?
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
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.
how to use execv system call to launch remote application on redhat 5?
Hi
I am trying to use system call execv to launch an application on remote machine.
code snippet:
:
:
char* cmd[] = {"usepwdutility", (char*)0};
ret = execv("/xyz/root/pwdcheck/usepwdutility", cmd);
:
:
where xyz is remote machine name. i also tried substituting ipaddress of the machine in place of machine name. Error it gives is ENOENT
Distribution: approximately NixOS (http://nixos.org)
Posts: 1,900
Rep:
You cannot just simply run applications on remote computers. If what you tried worked, you could put any name there and execute arbitrary code on arbitrary Internet-connected computers.. a clear security problem.
Probably execvp("ssh", "ssh", "user@host", "command to run");. It is supposed to be ru in terminal; ssh will ask password from user. This, of course, implies that you know a login name of the user on the remote host.
is there any other method to launch application on remote machine?
the scenario is:
Therez an application running on m/c 'A'which tells a deamon process on m/c 'B' to run a program. Now this program and parameters required by it are passed by the application on m/c 'A' to the deamon process running on m/c 'B'. the deamon process waits for the program to complete and sends back the exxit value of the program to the application running on m/c 'A'.
Please let me know the approach to implement above mentioned functionality.
Let me know in case of any clarification required.
Thanks
-i allows you to specify "identity" - a secret key. If corresponding public key is added to ~/.ssh/authorize_keys of target user on target computer, and identity file is not protected by password, no password entering is required. Also, SSH returns exit code of remote process as own exit code.
Read "man ssh" and "man sshd".
What you need to keep in mind, though, is that the daemon in your design needs a way to be sure that the application is your nice application, not some spammer trying to send spam using your bandwidth. For ssh thi means that you want to protect your identity files well.
i want to achieve mentioned functionality programatically. suppose i have remoteapplicationlauncher named out file. using this application i want to programatically send program name and its parameters thati want to run on remote machine.
suppose the application i want to run on remote m/c is usepwdcheckutility and parameters it take is const char* and int. with examples mentioned let me know the code snippet that will be used to achieve the requirement.
Thanks
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.