'\" te .\" To view license terms, attribution, and copyright for OpenSSH, the default path is /var/sadm/pkg/SUNWsshdr/install/copyright.If the Solaris operating environment has been installed anywhere other than the default, modify the given path to access the file at the installed location. .\" Portions Copyright (c)2007, Sun Microsystems, Inc. All Rights Reserved. .TH scp 1 "2007 年 6 月 22 日" "SunOS 5.11" "用户命令" .SH 名称 scp \- 安全复制(远程文件复制程序) .SH 用法概要 .LP .nf \fBscp\fR [\fB-pqrvBC46\fR] [\fB-F\fR \fIssh_config\fR] [\fB-S\fR \fIprogram\fR] [\fB-P\fR \fIport\fR] [\fB-c\fR \fIcipher\fR] [\fB-i\fR \fIidentity_file\fR] [\fB-o\fR \fIssh_option\fR] [ [\fIuser\fR@]\fIhost1\fR:]\fIfile1\fR []... [ [\fIuser\fR@]\fIhost2\fR:]\fIfile2\fR .fi .SH 描述 .sp .LP \fBscp\fR 实用程序会在网络上的主机间复制文件。它使用 \fBssh\fR(1) 进行数据传输,所使用的验证与提供的安全性与 \fBssh\fR(1) 相同。与 \fBrcp\fR(1) 不同,如果验证时需要,\fBscp\fR 会要求用户提供口令或口令短语。 .sp .LP 任何文件名称可能包含一个主机和用户规范,以指示将文件复制到主机或从主机复制文件。允许在两个远程主机间复制。 .SH 选项 .sp .LP 支持以下选项: .sp .ne 2 .mk .na \fB\fB-4\fR\fR .ad .RS 20n .rt 强制 \fBscp\fR 仅使用 IPv4 地址。 .RE .sp .ne 2 .mk .na \fB\fB-6\fR\fR .ad .RS 20n .rt 强制 \fBscp\fR 仅使用 IPv6 地址。 .RE .sp .ne 2 .mk .na \fB\fB-B\fR\fR .ad .RS 20n .rt 选择批量模式。(防止询问口令或口令短语。) .RE .sp .ne 2 .mk .na \fB\fB-c\fR \fIcipher\fR\fR .ad .RS 20n .rt 选择用于加密数据传输的密钥。此选项将直接传递到 \fBssh\fR(1)。 .RE .sp .ne 2 .mk .na \fB\fB-C\fR\fR .ad .RS 20n .rt 启用压缩。将 \fB-C\fR 标志传递到 \fBssh\fR(1) 以启用压缩。 .RE .sp .ne 2 .mk .na \fB\fB-F\fR \fIssh_config\fR\fR .ad .RS 20n .rt 为 \fBssh\fR(1.) 指定备用的每用户配置文件。 .RE .sp .ne 2 .mk .na \fB\fB-i\fR \fIidentity_file\fR\fR .ad .RS 20n .rt 从读取 \fBRSA\fR 验证的身份(私钥)的位置选择文件。此选项将直接传递到 \fBssh\fR(1)。 .RE .sp .ne 2 .mk .na \fB\fB-o\fR \fIssh_option\fR\fR .ad .RS 20n .rt 给定的选项将直接传递到 \fBssh\fR(1)。 .RE .sp .ne 2 .mk .na \fB\fB-p\fR\fR .ad .RS 20n .rt 保留原始文件的修改时间、访问时间和模式。 .RE .sp .ne 2 .mk .na \fB\fB-P\fR \fIport\fR\fR .ad .RS 20n .rt 指定所要连接的远程主机上的端口。请注意,此选项以大写 "P" 写入,这是因为已经保留了 \fB-p\fR 来保留 \fBrcp\fR(1) 中文件的时间和模式。 .RE .sp .ne 2 .mk .na \fB\fB-q\fR\fR .ad .RS 20n .rt 禁用进度指示器。 .RE .sp .ne 2 .mk .na \fB\fB-r\fR\fR .ad .RS 20n .rt 递归复制整个目录。 .RE .sp .ne 2 .mk .na \fB\fB-S\fR \fIprogram\fR\fR .ad .RS 20n .rt 指定使用加密连接的程序名称。程序必须理解 \fBssh\fR(1) 选项。 .RE .sp .ne 2 .mk .na \fB\fB-v\fR\fR .ad .RS 20n .rt 详细模式。促使 \fBscp\fR 和 \fBssh\fR(1) 输出有关其进度的调试消息。这有助于调试连接、验证和配置问题。 .RE .SH 操作数 .sp .LP 支持下列操作数: .sp .ne 2 .mk .na \fB\fIhost1, host2,\fR...\fR .ad .RS 20n .rt 文件复制来源或目标的主机的名称。 .RE .sp .ne 2 .mk .na \fB\fIfile1, file2,\fR...\fR .ad .RS 20n .rt 要复制的文件。 .RE .SH 退出状态 .sp .LP 将返回以下退出值: .sp .ne 2 .mk .na \fB\fB0\fR\fR .ad .RS 5n .rt 成功完成。 .RE .sp .ne 2 .mk .na \fB\fB1\fR\fR .ad .RS 5n .rt 出现错误。 .RE .SH 属性 .sp .LP 有关下列属性的说明,请参见 \fBattributes\fR(5): .sp .sp .TS tab() box; cw(2.75i) |cw(2.75i) lw(2.75i) |lw(2.75i) . 属性类型属性值 _ 可用性network/ssh _ 接口稳定性Committed(已确定) .TE .SH 另请参见 .sp .LP \fBrcp\fR(1)、\fBssh\fR(1)、\fBssh-add\fR(1)、\fBssh-agent\fR(1)、\fBssh-keygen\fR(1)、\fBsshd\fR(1M)、\fBssh_config\fR(4)、\fBattributes\fR(5) .SH 附注 .sp .LP 一般情况下,将 \fBscp\fR 与口令或键盘交互式验证方法以及两个远程主机一起使用时不会起作用。与 \fBpubkey\fR、\fBhostbased\fR 或 \fBgssapi-keyex\fR 验证方法一起使用时会起作用。对于 \fB pubkey\fR 验证方法,需要使用未受口令短语保护的私钥,或显式 \fBssh\fR 代理转发。\fBgssapi-keyex\fR 验证方法将与 \fBkerberos_v5\fR GSS-API 机制配合运行,但是仅限于启用了 \fBGSSAPIDelegateCredentials\fR 选项的情况。