blob: 89ebf7089abc1b995067400a2f983c05755a84d4 [file] [log] [blame]
Damien Miller32aa1441999-10-29 09:15:49 +10001.\" -*- nroff -*-
2.\"
3.\" scp.1
4.\"
5.\" Author: Tatu Ylonen <ylo@cs.hut.fi>
6.\"
7.\" Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
8.\" All rights reserved
9.\"
10.\" Created: Sun May 7 00:14:37 1995 ylo
11.\"
Damien Miller2eb26e82003-02-24 11:51:32 +110012.\" $OpenBSD: scp.1,v 1.26 2003/01/28 17:24:51 stevesk Exp $
Damien Miller32aa1441999-10-29 09:15:49 +100013.\"
14.Dd September 25, 1999
15.Dt SCP 1
16.Os
17.Sh NAME
18.Nm scp
19.Nd secure copy (remote file copy program)
20.Sh SYNOPSIS
21.Nm scp
Damien Miller8e121472003-01-24 11:37:38 +110022.Op Fl pqrvBC1246
Ben Lindstrom1e243242001-09-18 05:38:44 +000023.Op Fl F Ar ssh_config
Damien Miller7b28dc52000-09-05 13:34:53 +110024.Op Fl S Ar program
Damien Miller32aa1441999-10-29 09:15:49 +100025.Op Fl P Ar port
26.Op Fl c Ar cipher
27.Op Fl i Ar identity_file
Damien Miller8ee66a22003-02-24 11:50:50 +110028.Op Fl l Ar limit
Ben Lindstrom14c62eb2001-08-15 23:25:46 +000029.Op Fl o Ar ssh_option
Damien Miller32aa1441999-10-29 09:15:49 +100030.Sm off
31.Oo
32.Op Ar user@
33.Ar host1 No :
34.Oc Ns Ar file1
35.Sm on
36.Op Ar ...
37.Sm off
38.Oo
39.Op Ar user@
40.Ar host2 No :
41.Oc Ar file2
42.Sm on
Damien Miller22c77262000-04-13 12:26:34 +100043.Sh DESCRIPTION
Damien Miller32aa1441999-10-29 09:15:49 +100044.Nm
Damien Miller450a7a12000-03-26 13:04:51 +100045copies files between hosts on a network.
46It uses
Damien Miller32aa1441999-10-29 09:15:49 +100047.Xr ssh 1
48for data transfer, and uses the same authentication and provides the
49same security as
50.Xr ssh 1 .
51Unlike
52.Xr rcp 1 ,
53.Nm
54will ask for passwords or passphrases if they are needed for
55authentication.
56.Pp
57Any file name may contain a host and user specification to indicate
Damien Miller450a7a12000-03-26 13:04:51 +100058that the file is to be copied to/from that host.
59Copies between two remote hosts are permitted.
Damien Miller32aa1441999-10-29 09:15:49 +100060.Pp
61The options are as follows:
62.Bl -tag -width Ds
63.It Fl c Ar cipher
Damien Miller450a7a12000-03-26 13:04:51 +100064Selects the cipher to use for encrypting the data transfer.
65This option is directly passed to
Damien Miller32aa1441999-10-29 09:15:49 +100066.Xr ssh 1 .
67.It Fl i Ar identity_file
68Selects the file from which the identity (private key) for RSA
Damien Miller450a7a12000-03-26 13:04:51 +100069authentication is read.
70This option is directly passed to
Damien Miller32aa1441999-10-29 09:15:49 +100071.Xr ssh 1 .
Damien Miller8ee66a22003-02-24 11:50:50 +110072.It Fl l Ar limit
73Limits the used bandwidth, specified in Kbit/s.
Damien Miller32aa1441999-10-29 09:15:49 +100074.It Fl p
75Preserves modification times, access times, and modes from the
76original file.
77.It Fl r
78Recursively copy entire directories.
79.It Fl v
Damien Miller450a7a12000-03-26 13:04:51 +100080Verbose mode.
81Causes
Damien Miller32aa1441999-10-29 09:15:49 +100082.Nm
Damien Miller22c77262000-04-13 12:26:34 +100083and
Damien Miller32aa1441999-10-29 09:15:49 +100084.Xr ssh 1
Damien Miller450a7a12000-03-26 13:04:51 +100085to print debugging messages about their progress.
86This is helpful in
Damien Miller32aa1441999-10-29 09:15:49 +100087debugging connection, authentication, and configuration problems.
88.It Fl B
89Selects batch mode (prevents asking for passwords or passphrases).
90.It Fl q
91Disables the progress meter.
92.It Fl C
Damien Miller450a7a12000-03-26 13:04:51 +100093Compression enable.
94Passes the
Damien Miller32aa1441999-10-29 09:15:49 +100095.Fl C
96flag to
97.Xr ssh 1
98to enable compression.
Ben Lindstrom1e243242001-09-18 05:38:44 +000099.It Fl F Ar ssh_config
100Specifies an alternative
101per-user configuration file for
102.Nm ssh .
103This option is directly passed to
104.Xr ssh 1 .
Damien Miller32aa1441999-10-29 09:15:49 +1000105.It Fl P Ar port
Damien Miller450a7a12000-03-26 13:04:51 +1000106Specifies the port to connect to on the remote host.
107Note that this option is written with a capital
Damien Miller32aa1441999-10-29 09:15:49 +1000108.Sq P ,
109because
110.Fl p
111is already reserved for preserving the times and modes of the file in
112.Xr rcp 1 .
Damien Miller7b28dc52000-09-05 13:34:53 +1100113.It Fl S Ar program
114Name of
115.Ar program
Damien Miller874d77b2000-10-14 16:23:11 +1100116to use for the encrypted connection.
117The program must understand
Damien Millerad833b32000-08-23 10:46:23 +1000118.Xr ssh 1
119options.
Ben Lindstrom14c62eb2001-08-15 23:25:46 +0000120.It Fl o Ar ssh_option
121Can be used to pass options to
122.Nm ssh
Ben Lindstrom3072aae2002-06-21 01:02:39 +0000123in the format used in
124.Xr ssh_config 5 .
125This is useful for specifying options
Ben Lindstrom14c62eb2001-08-15 23:25:46 +0000126for which there is no separate
127.Nm scp
Damien Miller2eb26e82003-02-24 11:51:32 +1100128command-line flag.
Damien Miller8e121472003-01-24 11:37:38 +1100129.It Fl 1
130Forces
131.Nm
132to use protocol 1.
133.It Fl 2
134Forces
135.Nm
136to use protocol 2.
Damien Miller34132e52000-01-14 15:45:46 +1100137.It Fl 4
138Forces
139.Nm
140to use IPv4 addresses only.
141.It Fl 6
142Forces
143.Nm
144to use IPv6 addresses only.
Damien Miller37023962000-07-11 17:31:38 +1000145.El
Damien Miller07a2d422002-02-05 12:16:15 +1100146.Sh DIAGNOSTICS
147.Nm
148exits with 0 on success or >0 if an error occurred.
Damien Miller32aa1441999-10-29 09:15:49 +1000149.Sh AUTHORS
150Timo Rinne <tri@iki.fi> and Tatu Ylonen <ylo@cs.hut.fi>
151.Sh HISTORY
152.Nm
153is based on the
154.Xr rcp 1
155program in BSD source code from the Regents of the University of
156California.
157.Sh SEE ALSO
158.Xr rcp 1 ,
Damien Miller33804262001-02-04 23:20:18 +1100159.Xr sftp 1 ,
Damien Miller32aa1441999-10-29 09:15:49 +1000160.Xr ssh 1 ,
161.Xr ssh-add 1 ,
162.Xr ssh-agent 1 ,
163.Xr ssh-keygen 1 ,
Ben Lindstromc06bf702002-06-23 00:34:37 +0000164.Xr ssh_config 5 ,
Damien Miller32aa1441999-10-29 09:15:49 +1000165.Xr sshd 8