# SCP Ruby

**URL:** <https://www.ruby-forum.com/t/scp-ruby/109041>\
**Category:** Ruby\
**Created:** [July 10, 2007, 8:36pm UTC](https://www.ruby-forum.com/t/scp-ruby/109041 "2007-07-10T20:36:55Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ari\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a698b9/32.png) [@Ari\_B](https://www.ruby-forum.com/u/Ari_B)\
**Post date:** [July 10, 2007, 8:36pm UTC](https://www.ruby-forum.com/t/scp-ruby/109041/1 "2007-07-10T20:36:55Z")

</div>

Hey all,  
What would be the best way to use SCP through ruby?  
I’m looking to use it to connect to an AFP port on a mac.

THanks,  
~ Ari  
English is like a pseudo-random number generator - there are a  
bajillion rules to it, but nobody cares.

---

<div class="post-metadata">

**Author:** ![Ari\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a698b9/32.png) [@Ari\_B](https://www.ruby-forum.com/u/Ari_B)\
**Post date:** [July 10, 2007, 9:39pm UTC](https://www.ruby-forum.com/t/scp-ruby/109041/2 "2007-07-10T21:39:04Z")

</div>

On Jul 10, 12:35 pm, Ari B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Hey all,  
> What would be the best way to use SCP through ruby?  
> I’m looking to use it to connect to an AFP port on a mac.

Will net-sftp work for you? Otherwise you’re looking at a custom  
‘expect’ solution (unless someone has already rolled one out that I  
don’t know about).

Regards,

Dan

---

<div class="post-metadata">

**Author:** ![Ari\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a698b9/32.png) [@Ari\_B](https://www.ruby-forum.com/u/Ari_B)\
**Post date:** [July 10, 2007, 10:12pm UTC](https://www.ruby-forum.com/t/scp-ruby/109041/3 "2007-07-10T22:12:08Z")

</div>

> > ```
> > What would be the best way to use SCP through ruby?
> > 
> > ```

Yes, my bad there earlier - sftp would indeed be easier than scp as sftp  
has  
ruby bindings, whereas scp does not seem to.

Requirements are that ssh is allowed through the firewall and that you  
haven’t made manual edits to the ssh config file (/etc/sshd\_config) to  
turn  
off the sftp subsystem.

[http://groups.google.com/group/ruby-talk-google/browse\_thread/thread/674a6f6](http://groups.google.com/group/ruby-talk-google/browse_thread/thread/674a6f6)  
de15ceb49

That link may help implementing as the library apparently is a bit  
sparse in  
regards to documentation.

HTH,

Felix

---

<div class="post-metadata">

**Author:** ![Ari\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a698b9/32.png) [@Ari\_B](https://www.ruby-forum.com/u/Ari_B)\
**Post date:** [July 11, 2007, 2:24am UTC](https://www.ruby-forum.com/t/scp-ruby/109041/4 "2007-07-11T02:24:30Z")

</div>

On Jul 10, 2007, at 3:37 PM, Daniel B. wrote:

> Will net-sftp work for you? Otherwise you’re looking at a custom  
> ‘expect’ solution (unless someone has already rolled one out that I  
> don’t know about).

Currently, that’s what I’ve hacked together. But what I’m doing is  
connecting to an AFP (Apple Filing Protocol) port. I’ve been told  
that I can do it through SCP, so I’ve been using SFTP.

Not sure if it works yet, tho. Testing it now…  
~ Ari  
English is like a pseudo-random number generator - there are a  
bajillion rules to it, but nobody cares.
