Executing a script in remote server

Hi All,

I have 2 servers A and B. I need to connect to server B from server A and execute a shell script in B which will create some files and i need to copy those files back to server A.

Required easiest possible for perfoming above task.

Use ssh from one server to the other, to execute the script; then use scp to retrieve the generated files.

Moved thread from Shell Programming & Scripting.