Operating System - HP-UX
1829540 Members
3024 Online
109992 Solutions
New Discussion

remotely execute a process

 
Gaoping Yu
New Member

remotely execute a process

I have a process, A, which is been called from another process, B, on the same HP UNIX box (HP-UX 11.0) using execlp commend. Now the process B needs to be moved to a different HP UNIX box running the same operating system. Both processes are written in ANSI C.

My questions are
(1) How to execute A from B (on a different box)?
(2) What settings do I need on both boxes in order to make the remote execution work?

Thanks in advance for your help.
5 REPLIES 5
Patrick Wallek
Honored Contributor

Re: remotely execute a process

Although they are generally seen as a security risk, you can use the 'r*' commands to do this. 'rexec' or 'remsh' may a good alternative for you. For this to work you must have either an /etc/hosts.equiv file or an .rhosts in the users home directory on the remote machine set up.

See 'man rexec', 'man remsh' and 'man rhosts' for more information.
Ramkumar Devanathan
Honored Contributor

Re: remotely execute a process

Yu,
use remsh ("/usr/bin/remsh") and pass the commandss to be run as arguments.

say if you wish to run "cat /tmp" on a remote node, run as follows -

"remsh" " cat /tmp"

....... ...............
binary arguments

use remsh with -l option to specify the userid with which to login as, instead of as current user id of the executing process.

for this, the files /etc/hosts.equiv need to be populated with details of equivalent users on both machines.

see man rhosts for more info.

Should work - i have never tried it out anyhow.

- ramd.
HPE Software Rocks!
Dario_1
Trusted Contributor

Re: remotely execute a process

You can use remsh to do that. Do a man remsh for more details. In order to use remsh, you must have an /etc/hosts.equiv file OR an .rhosts in the home directory of the user on the remote server.

Regards,

DR
Wilfred Chau_1
Respected Contributor

Re: remotely execute a process

config .rhosts on host A
# vi
# add "B " (without quote)

then on the system B, logon as user B

remsh A -l ls /tmp
Rory R Hammond
Trusted Contributor

Re: remotely execute a process

ssh has features like remote shell but is much more secure.

Rory
There are a 100 ways to do things and 97 of them are right