Run second server's program from the first server's program

Hi, i have 2 servers (linux). I have perl programs in both the servers. how can I run a perl program of server-2 from the perl program of server-1. Both the servers are connected to the net. They have IP's.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

From the same user-ID (number & string), you can do this
using rsh; this way:
from server1:
   rsh server2 /usr/bin/perl /path/on/server2/to/prog2
and from server2:
   rsh server1 /usr/bin/perl /path/on/server2/to/prog1
vijayakumar_m10Author Commented:
if i tried the above one i am getting the message that connection timmed out
Try to do a "rsh remotehost". If you get a "Password:" prompt, then add "+host1" to $HOME/.rhosts on host2,
and add "+host2" to $HOME/.rhosts on host1.

Otherwise (if you do not get "Password:" prompt),
check whether there is a listener for this service
(edit /etc/xinetd.d/rsh file and set "enabled = yes",
and then "kill -1 xinetd"). Then try again.

If you have no root permissions, use may try to use ssh (secure shell), or more unsecure solution: using "expect" with "telnet" to 'speak' with remote system.
Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

Use ssh in either case; rsh (as well as telnet) is deprecated.
vijayakumar_m10Author Commented:
If i tried "rsh remotehost" i am getting the message as connectio refused. Now what i have to do
vijaya, please don't use rsh.  As I mentioned above, it's an obsolete service -- and in fact, it's not going to work anyway if the remote machine is not running the rsh server.

Use an ssh server on the remote host, and an ssh client on the local (client) host.
vijayakumar_m10Author Commented:
How can i run the program of the other server by using ssh client
ssh remotehost "remote_command here"

man ssh

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
ssh works well; though you will have to properly set up the keys.

1) create a key with no password.
2) on the destination host put the public key in the ~/.ssh/authorized_keys
3) log in manually once to test the connection.
No comment has been added lately, so it's time to clean up this TA.
I will leave the following recommendation for this question in the Cleanup topic area:

Split: jimbb {http:#8090838} & rduta {http:#8131351}

Please leave any comments here within the next seven days.

EE Cleanup Volunteer
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux OS Dev

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.