Operating System - HP-UX
1820553 Members
2399 Online
109626 Solutions
New Discussion юеВ

how do I run a shell script from another server using a shell script

 
Dhandu Subramanian
Occasional Contributor

how do I run a shell script from another server using a shell script

Hi folks,
How do I run a script that's there in one unix server from another unix server using a shell script
thanks..
9 REPLIES 9
Mark Greene_1
Honored Contributor

Re: how do I run a shell script from another server using a shell script

If you have login access setup on the second system, you can run "rksh" on the first system to do it, or you can "rlogin" to the second system as well.

run "man rksh" and "man rlogin" for more information.

HTH
mark
the future will be a lot like now, only later
Jeff Machols
Esteemed Contributor

Re: how do I run a shell script from another server using a shell script

use the remsh command

server a script
remsh server_b script2

You need .rhosts file in the home directory of the user that will be running this on BOTH machines

/home/user/.rhosts

the file will look like this

servera userid
serverb userid

Craig Rants
Honored Contributor

Re: how do I run a shell script from another server using a shell script

The secure shell version would be:

ssh hostname "shellscript.sh"

This ofcourse would be where hostname is trusted to your localhost by a .shosts or key encryption trust.

I would recommend ssh over the r commands for security reasons.

Happy scripting,
C
"In theory, there is no difference between theory and practice. But, in practice, there is. " Jan L.A. van de Snepscheut
Helen French
Honored Contributor

Re: how do I run a shell script from another server using a shell script

Hi,

You can use the 'remsh' command. See man remsh for more information. You need to have the /etc/hosts.equiv and .rhosts files setup for doing this.

HTH,
Shiju
Life is a promise, fulfill it!
James R. Ferguson
Acclaimed Contributor

Re: how do I run a shell script from another server using a shell script

Hi:

Have a look at the man pages for 'remsh' (man remsh) and for 'remshd' (man 1M remshd). Pay particular attention to the '/etc/hosts.equiv' and '$HOME/.rhost' file discussion.

Regards!

...JRF...
Deshpande Prashant
Honored Contributor

Re: how do I run a shell script from another server using a shell script

HI
Remsh and Rexec commands will help you run command on remote machines as long as .rhosts file allows you to run it.

#remsh "/usr/bin/bdf"

Thanks.
Prashant.
Take it as it comes.
Mark Fenton
Esteemed Contributor

Re: how do I run a shell script from another server using a shell script

I'm with Craig -- ssh is definately better than remsh for most all these types of things, and is easy to set up, and works even if nis is not set up in your environment.

Yogeeraj
Advisor

Re: how do I run a shell script from another server using a shell script

Hi,

i've used remsh and it works fine.


I would like to try ssh. Where do i get this?

regards
Yogeeraj
Darrell Allen
Honored Contributor

Re: how do I run a shell script from another server using a shell script

Hi,

You can get OpenSSH from one of the HPUX software porting centers. I use: http://hpux.cs.utah.edu

Darrell
"What, Me Worry?" - Alfred E. Neuman (Mad Magazine)