[clue] scp help?

David L. Willson DLWillson at TheGeek.NU
Sat Sep 8 10:47:28 MDT 2012


I think adding your id to the appropriate server stanza in your .ssh/config file makes sense, and will allow you not to need to specify it on the command-line.

scp /source-dir/source-file user at server:/dest-folder

I think you can add your user-name to the server-stanza, too, which would allow you to simplify it further, to:

scp /source-dir/source-file server:/dest-folder

The remote file(s), whether they're the source or destination, must be phrased that way (server:pathspec(s)).

ie: If your username on the remote system is different, you need to specify it or put it in your .ssh/config. Same with the key.

You always need to specify the server-name as a reference to a server-stanza in your .ssh/config or such that it resolves to an FQDN. You always need to follow the server-name with a colon, followed by as much path as you need. Your default folder on the remote system, if you want to use a relative path, is your home-folder.

So, to copy things from my local Documents/ to the same location on another box, where I have a different user-name, it would look like:

scp Documents/Resume_2012-09.doc dlwillson at mailman.thegeek.nu:Documents/

or this:

scp Documents/Resume_2012-09.doc mailman.thegeek.nu:Documents/

or this:

scp Documents/Resume_2012-09.doc mailman:Documents/

--
David L. Willson
Trainer, Engineer, Enthusiast
RHCE Network+ A+ Linux+ LPIC-1 Ubuntu
Mobile 720-333-LANS(5267)

This is a good time for a r3VOLution.

----- Original Message -----
> On Sat, 2012-09-08 at 10:11 -0600, Mike Bean wrote:
> > scp (some file) -i [path to my cert] mylogin:someserver
> > (destination
> > directly on some server)
> 
> scp <options> <source> <dest>
> 
> Put the source file after the options (-i, etc.).  If scp is using
> getopts then finding the source file before the options terminates
> option processing.
> --
> Michael J. Hammel
> mjhammel at graphics-muse.org / http://www.graphics-muse.org
> ------------------------------------------------------------------------------
> I have no special talents.  I am only passionately curious. -- Albert
> Einstein
> 
> _______________________________________________
> clue mailing list: clue at cluedenver.org
> For information, account preferences, or to unsubscribe see:
> http://cluedenver.org/mailman/listinfo/clue
> 


More information about the clue mailing list