Re: What is the command to copy files from A to B when ssh c…

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Eric Shubert
Date:  
To: plug-discuss
Subject: Re: What is the command to copy files from A to B when ssh connected?
Nice, Ben.

Two things to add:
.) -p option on scp will preserve attributes as well
.) if security is not a concern (on a local home network), you can omit
the '-e "ssh -l username"' and simply provide the remote user name (if
different that the current user name) like
':/dest/location'
The transfer would be a little more efficient (but not necessarily
faster) w/out encryption.

Ben Trussell wrote:
> If you need to preserve attributes such as uid/gid (owner, group) and
> timestamps etc, you can use rsync:
>
> rsync -av -e "ssh -l username" /some/dir/locationA
> remote.host.name:/dest/location
>
> preserving extended attributed and ACLs? try using
>
> rsync -avAX -e "ssh -l username" /some/dir/locationA
> remote.host.name:/dest/location
>
> Want to try it out first to see what *would* happen (test run)?
>
> rsync --dry-run -avAX -e "ssh -l username" /some/dir/locationA
> remote.host.name:/dest/location
>
> On Tue, Aug 3, 2010 at 11:20 AM, Bryan O'Neal
> <> wrote:
>> With SCP only one box has to run an SSH server and it does not mater
>> which, destination or source, but it does change the syntax.
>>
>> On Tue, Aug 3, 2010 at 11:18 AM,
>> <> wrote:
>>> There is not a "command to copy files from computer A to computer B when ssh
>>> logged in...", but you can use SSH as a "transport" (regardless of which
>>> computer you are logged-in-how, providing the the destination computer is
>>> running an SSH server and you have the appropriate credentials) using:
>>> Scenario 1:
>>> scp user@remotebox:/file/I/want /where/I/want/it
>>> or
>>> Scenario 2:
>>> scp /file/I/want user@remotebox:/where/I/want/it
>>> YMMV... :)
>>> ET
>>>
>>> writes:
>>>> What is the correct command syntax to copy files from computer A
>>>> to computer B when ssh logged in to comuter B from computer A?
>>>>
>>>> ---------------------------------------------------
>>>> PLUG-discuss mailing list -
>>>> To subscribe, unsubscribe, or to change your mail settings:
>>>> http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss
>>> ---------------------------------------------------
>>> PLUG-discuss mailing list -
>>> To subscribe, unsubscribe, or to change your mail settings:
>>> http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss
>>>
>> ---------------------------------------------------
>> PLUG-discuss mailing list -
>> To subscribe, unsubscribe, or to change your mail settings:
>> http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss
>>



--
-Eric 'shubes'

---------------------------------------------------
PLUG-discuss mailing list -
To subscribe, unsubscribe, or to change your mail settings:
http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss