# Multiple SCP from remote machine

**URL:** <https://www.ruby-forum.com/t/multiple-scp-from-remote-machine/55436>\
**Category:** Ruby\
**Created:** [March 21, 2006, 1:13am UTC](https://www.ruby-forum.com/t/multiple-scp-from-remote-machine/55436 "2006-03-21T01:13:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![beth](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/94ad74/32.png) [@beth](https://www.ruby-forum.com/u/beth)\
**Post date:** [March 21, 2006, 1:13am UTC](https://www.ruby-forum.com/t/multiple-scp-from-remote-machine/55436/1 "2006-03-21T01:13:54Z")

</div>

I’m a nuby who needs help solving a problem trying to copy from  
multiple remote servers

I need to ssh into a remote machine (Machine X). Once in Machine X I  
need to SCP a file from machine Y. I’m not sure how to do this as it  
seems that the process hangs while waiting for the first ssh to exit.  
I’ve tried:

system("bash ./sample.sh " ) --(which uses a simple shell script to  
execute the above described commands)

I’ve also tried `ssh user@10.10.0.1`– which hangs untill an exti is  
entered.

Can anyone help?

Thanks in advance,

Beth

---

<div class="post-metadata">

**Author:** ![beth](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/94ad74/32.png) [@beth](https://www.ruby-forum.com/u/beth)\
**Post date:** [March 21, 2006, 2:13am UTC](https://www.ruby-forum.com/t/multiple-scp-from-remote-machine/55436/2 "2006-03-21T02:13:59Z")

</div>

ssh -t host1 scp host2:/path /localpath

should work just fine.

–Matt
