How to scp with a second remote host

I don’t know of any way to copy the file directly in one single command, but if you can concede to running an SSH instance in the background to just keep a port forwarding tunnel open, then you could copy the file in one command. Like this: # First, open the tunnel ssh -L 1234:remote2:22 … Read more

scp or sftp copy multiple files with single command

Copy multiple files from remote to local: $ scp [email protected]:/some/remote/directory/\{a,b,c\} ./ Copy multiple files from local to remote: $ scp foo.txt bar.txt [email protected]:~ $ scp {foo,bar}.txt [email protected]:~ $ scp *.txt [email protected]:~ Copy multiple files from remote to remote: $ scp [email protected]:/some/remote/directory/foobar.txt \ [email protected]:/some/remote/directory/ Source: http://www.hypexr.org/linux_scp_help.php

Ant, download fileset from remote machine

Since you haven’t specified I’ll assume that your local and remote systems are unix based and therefore support rsync and ssh. A more cross-platform solution is challenging… Example Configure SSH Generate an SSH key (specify an empty passphrase): ssh-keygen -f rsync This will generate 2 files, corresponding to the private and public keys: |– rsync … Read more

Transferring files over SSH [closed]

You need to scp something somewhere. You have scp ./styles/, so you’re saying secure copy ./styles/, but not where to copy it to. Generally, if you want to download, it will go: # download: remote -> local scp user@remote_host:remote_file local_file where local_file might actually be a directory to put the file you’re copying in. To … Read more