connecting to another unix box

Hi gurus,
I am entirely new to unix. So if my questions are foolish, please bear with me.
I have two unix boxes A and B. Is it possible to execute a command or a shell script in box B standing in box A. I mean if i log in to box A and execute a shell script, it should be able to login to B and execute a command there and exit. Please let me know if you need some more details.

thanks
bade_miya

try:

man remsh
man rlogin
man rexec

Choose the one that you want.

Hi there.

I don't know if U are using the RSH of SSH (more secure) way of conntecting.
Any case. Try using this

[rsh/ssh] [other server] [command]

eg. rsh A date
or
ssh B /u/bin/hop.sh

It will run the command from the orher server and exit again. U can also copy stuff rcp / scp file1 A:/u/bin/ or something like it.

Hope it helps.

Hi Jim,
Thanks for the help. I created a sample shell script using the data you provided. It looks something like this.

#!/bin/ksh
remsh boxname -l username 
cd mydir
./myscript

The problem is where do we specify the password. If i try to run this script, its prompting me for a password. But if i am to automate this process, i should figure out a way to automatically give the password while execution.

Thanks a ton,
bade_miya

Sorry, i forgot to tell you guys that the user name in which i am logged in the first machine is different from the second machine.
Hi Blooper,
Thanks for the reply. i am using rsh.

thanks
bade_miya

if you do a man on rlogin, rlogin uses a .rhosts file to have these entries stored., however this is not a secure way. use ssh instead.

Hi linuxpenguin,
please tell me which directory i should put the .rhosts file with the entries.

thanks
bade_miya

.rhosts file in your home directory