Skip to Content
SSH, The Secure Shell: The Definitive Guide, 2nd Edition
book

SSH, The Secure Shell: The Definitive Guide, 2nd Edition

by Daniel J. Barrett, Richard E. Silverman, Robert G. Byrnes
May 2005
Intermediate to advanced
666 pages
21h 5m
English
O'Reilly Media, Inc.
Book available
Content preview from SSH, The Secure Shell: The Definitive Guide, 2nd Edition

Secure Copy with scp

The secure copy program, scp, obeys keywords in your client configuration file just as ssh does. In addition, scp provides other features and options that we’ll cover in this section. Remember that scp supports several options for logging and debugging, so you can watch what’s going on when it runs. [7.3]

7.5.1 Full Syntax of scp

So far, we’ve described the syntax of scp only in general: [2.2.1]

    scp name-of-source name-of-destination

Each of the two names, or path specifications, on the command line represents files or directories in the following manner (it is fairly consistent with the behavior of Unix cp or rcp):

  • If name-of-source is a file, name-of-destination may be a file (existing or not) or a directory (which must exist). In other words, a single file may be copied to another file or into a directory.

  • If name-of-source is two or more files, one or more directories, or a combination, name-of-destination must be an existing directory into which the copy takes place.[115] In other words, multiple files and directories may be copied only into a directory.

Both name-of-source and name-of-destination may have the following form from left to right:

  • The username of the account containing the file or directory, followed by @. This part is optional, and if omitted, the value is the username of the user invoking scp.

  • The hostname of the host containing the file or directory, followed by a colon. This part is optional, if the path is present, and the username isn’t; if ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Linux Basics for Hackers

Linux Basics for Hackers

OccupyTheWeb .

Publisher Resources

ISBN: 0596008953Errata Page