# Executing a script in remote server

**URL:** <https://community.unix.com/t/executing-a-script-in-remote-server/335978>\
**Category:** UNIX for Dummies Questions & Answers\
**Created:** [October 28, 2013, 10:06am UTC](https://community.unix.com/t/executing-a-script-in-remote-server/335978 "2013-10-28T10:06:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Girish19](https://community.unix.com/letter_avatar/girish19/32/6_449c533f586939b6e5f246632a46421f.png) [@Girish19](https://community.unix.com/u/Girish19)\
**Post date:** [October 28, 2013, 10:06am UTC](https://community.unix.com/t/executing-a-script-in-remote-server/335978/1 "2013-10-28T10:06:08Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Scott](https://community.unix.com/letter_avatar/scott/32/6_449c533f586939b6e5f246632a46421f.png) [@Scott](https://community.unix.com/u/Scott)\
**Post date:** [October 28, 2013, 12:32pm UTC](https://community.unix.com/t/executing-a-script-in-remote-server/335978/2 "2013-10-28T12:32:34Z")

</div>

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.
