scp in reverse?

Lisa Kachold lisakachold at obnosis.com
Sun Apr 1 09:53:37 MST 2012


On Sat, Mar 31, 2012 at 8:11 PM, Michael Havens <bmike1 at gmail.com> wrote:

> I was wondering.... could you do this via ipaddress?
>
> On Thu, Mar 15, 2012 at 12:01 PM, kitepilot at kitepilot.com <
> kitepilot at kitepilot.com> wrote:
>
>> Yes, scp (like cp) will copy back or forth, the 2 commands below are
>> legal:
>> scp myuser at remotebox:/that/file /this/path
>> scp /this/path myuser at remotebox:/that/file
>> 1st one will 'retrieve' /that/file from 'remotebox' into /this/path
>> 2nd one will copy /this/path to /that/file in 'remotebox'.
>> ET
>>
>> joe at actionline.com writes:
>>
>>>
>>> This is interesting.  Does this really mean that
>>> scp in reverse is possible by using a similar syntax
>>> with the dot at the end to extract a file from a remote
>>> computer to my local computer?
>>> -----------------
>>> Mike Ballon wrote (in part) ... scp in reverse:
>>> scp 192.168.0.4:Pictures/2009-**Move.from.Florida .
>>> I'm guessing the path of the pictures and take note of the dot at the
>>> end
>>>
>>>
>>>
Correct,

I setup a firewall one time for an "eccentric" entrepreneur, who insisted
that we use the same root password on everything, and didn't want a Bridged
iptables (passthrough) with FORWARD tables, just INPUT tables (so he could
run daemons and access from either side on the firewall [easy to fuzz]).
This wonderfully obsessive man was also known to be a bit dyslexic and
entered the scp syntax backwards (recursively sending a whole directory to
the /), therefore overwrote the firewall configurations.

Be careful with the "."

So, the syntax is:
GET STUFF from OTHER BOX:

scp root at otherbox.someplacegood.com:/etc/shadow /tmp/johnhackfile


PUT STUFF from THIS BOX:

scp myfile.tgz root at otherbox.someplacegood.com:/tmp/

Get or put a whole directory:

*scp -r  clown at laughaminute.com:MyDir/09 ./r9/*

 copy directory ``MyDir/09/'' recursively (i.e., the directory and all its
contents) from
laughaminute.com (where you are "clown" into a new directory ``r9/'' in
your current working directory on localmachine.

*scp -r ./r9/ **clown at laughaminute.com:MyDir/09*

       Copy directory ./r9 recursively (i.e. the directory and all its
contents) from localmachine to
       laughaminute.com using the clown users' path settings and permissions.


Sometimes a better alternative is to ssh to the remote computer, bundle the
files you want into a single
tar<http://en.wikipedia.org/wiki/Tar_%28file_format%29>file, scp that
file over, and unpack it where you want the files.

-- 
(503) 754-4452 Android
(623) 239-3392 Skype
(623) 688-3392 Google Voice
**
it-clowns.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.PLUG.phoenix.az.us/pipermail/plug-discuss/attachments/20120401/8ce74789/attachment.html>


More information about the PLUG-discuss mailing list