execute remote commands with rsh

Hi,

I earlier determined I cannot use FTP to execute remote commands on a server.

My problem, I need to use a second server to get/put files via ftp onto my primary server and various tertiary servers.

my server(A) ---> server (B) ----> server blah(c), server balh(C)

I cannot directly ftp to server C from A due to network restrictions.

Can anyone let me know how to use / script rsh commands?

I have simple tried without success, command is a script I ahve written

rsh user@ipaddrservB command

EDIT - I guess it isn't connecting to the host - i know my ip is right?

rsh -l username hostname /bin/sh <your-script.sh

Replace /bin/sh with whatever shell is appropriate for hostname

For automatic execution without password, you'd have to setup .rhosts or hosts.equiv. But you may have to pass an option the daemon side to allow such things (as they are commonly considered to be insecure).