25.02.2013 Views

TCP/IP Tutorial and Technical Overview - IBM Redbooks

TCP/IP Tutorial and Technical Overview - IBM Redbooks

TCP/IP Tutorial and Technical Overview - IBM Redbooks

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Both the user ID needed to gain access to the remote host <strong>and</strong> the location of the<br />

remote host are specified as part of the file name. For example, assume a user<br />

wants to copy a file from the host remote.host. The file is in the /tmp directory <strong>and</strong><br />

is named yourdata. Additionally, this user has a user ID on the host of myId, <strong>and</strong><br />

wants to copy the file to the /localfolder directory as mydata. In order to achieve<br />

this using SCP, the user issues the following comm<strong>and</strong>:<br />

scp myId@remote.host:/tmp/yourdata /localfolder/mydata<br />

Similarly, this user can upload a copy of mydata to remote.host, using the<br />

following comm<strong>and</strong>:<br />

scp /localfolder/mydata myId@remote.host:/tmp/yourdata<br />

Many implementations of SCP also include additional flags that allow further<br />

configuration of the SCP comm<strong>and</strong>. Although currently there are not RFC<br />

architected st<strong>and</strong>ards, the open source community has established the following<br />

flags for use with the protocol:<br />

-c cipher Selects the cipher to use for encrypting the data transfer.<br />

-i identity_file Selects the file from which the identity (private key) for RSA<br />

authentication is read.<br />

-p Preserves modification times, access times, <strong>and</strong> modes from<br />

the original file.<br />

-r Recursively copies entire directories.<br />

-v Verbose mode. Causes scp <strong>and</strong> ssh(1) to print debugging<br />

messages about their progress. This is helpful in debugging<br />

connection, authentication, <strong>and</strong> configuration problems.<br />

-B Selects batch mode.<br />

-q Disables the progress meter.<br />

-C Passes the -C flag to ssh(1) to enable compression.<br />

-F ssh_config Specifies an alternative per-user configuration file for SSH.<br />

-P port Specifies the port to connect to on the remote host.<br />

-S program Specifies the name of program to use for the encrypted<br />

connection. The program must underst<strong>and</strong> ssh(1) options.<br />

-o ssh_option Can be used to pass options to SSH in the format used in<br />

ssh_config(5). This is useful for specifying options for which<br />

there is no separate scp comm<strong>and</strong>-line flag. For example,<br />

forcing the use of protocol version 1 is specified using scp<br />

-oProtocol=1.<br />

-4 Forces scp to use <strong>IP</strong>v4 addresses only.<br />

-6 Forces scp to use <strong>IP</strong>v6 addresses only.<br />

534 <strong>TCP</strong>/<strong>IP</strong> <strong>Tutorial</strong> <strong>and</strong> <strong>Technical</strong> <strong>Overview</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!