scp [ -a source-ip-address ] [ -force-receive-pubkey ] [ [ -port server-port ] | [ public-net | vpn-instance vpn-instance-name ] | [ identity-key identity-key-type ] | [ user-identity-key user-key ] | -r | -c | [ -cipher cipher ] | [ -prefer-kex { prefer-kex } ] ] * source-filename destination-filename
scp ipv6 [ [ vpn-instance vpn-instance-name ] | public-net ] [ -force-receive-pubkey ] [ [ -port server-port ] | [ identity-key identity-key-type ] | [ user-identity-key user-key ] | [ [ -a source-ipv6-address ] | [ -oi { interface-name | interface-type interface-number } ] ] | -r | -c | [ -cipher cipher ] | [ -prefer-kex { prefer-kex } ] ] * source-filename destination-filename
scp -i { interface-name | interface-type interface-number } [ -force-receive-pubkey ] [ [ -port server-port ] | [ identity-key identity-key-type ] | [ user-identity-key user-key ] | -r | -c | [ -cipher cipher ] | [ -prefer-kex { prefer-kex } ] ] * source-filename destination-filename
Parameter | Description | Value |
---|---|---|
-a source-ip-address |
Specifies the source IPv4 address. |
The value is in dotted decimal notation. |
-a source-ipv6-address |
Specifies the source IPv6 address. |
The value is a 32-digit hexadecimal number, in the format of X:X:X:X:X:X:X:X. |
-force-receive-pubkey |
Indicates that a server forcibly receives public key authentication. |
- |
-port server-port |
Specifies the port number of the remote SCP server. |
The value is an integer ranging from 1 to 65535. The default value is 22. |
public-net |
Specifies the public network where the server resides. |
- |
vpn-instance vpn-instance-name |
Specifies the VPN instance name on the remote SCP server. |
The value is a string of 1 to 31 characters. |
identity-key identity-key-type |
Specifies a public key algorithm for server authentication. |
Currently, the RSA_SHA2_512, RSA_SHA2_256, RSA, DSA, SM2, and ECC algorithms are supported. The default algorithm is ECC. To ensure high security, do not use the RSA algorithm whose length is less than 2048 digits. You are advised to use RSA SHA2-512 or RSA SHA2-256 authentication algorithm which ensures higher security. |
user-identity-key user-key |
Specifies a public key algorithm for user authentication. |
Currently, the RSA_SHA2_512, RSA_SHA2_256, RSA, DSA, SM2, and ECC algorithms are supported. The default algorithm is ECC. To ensure high security, do not use the RSA algorithm whose length is less than 2048 digits. You are advised to use RSA SHA2-512 or RSA SHA2-256 authentication algorithm which ensures higher security. |
-r |
Uploads or downloads files in batches. |
- |
-c |
Enables compression. |
- |
-cipher cipher |
Specifies an encryption algorithm for file upload or download. |
Encryption algorithms supported depend on the ssh client cipher command settings. |
-prefer-kex prefer-kex |
Specifies the preferred key exchange algorithm. |
Preferred algorithms for key exchange supported depend on the ssh client key-exchange command settings. |
source-filename |
Specifies the name of the source file to be uploaded or downloaded. |
The value is a string of 1 to 256 characters. |
destination-filename |
Specifies the name of the destination file to uploaded or downloaded. |
The value is a string of 1 to 256 characters. |
ipv6 |
Specifies the IPv6 SCP. |
- |
-oi |
Specifies the source interface for the IPv6 client, including the name, type and number of the interface. The IPv6 address configured in this interface view is the source IPv6 address of the packet. If no IPv6 address is configured for the source interface, the connection cannot be set up. |
- |
interface-type |
Specifies the type the outbound interface. |
- |
interface-number |
Specifies the number of the outbound interface. |
- |
-i interface-name |
Specifies the name of the outbound interface. |
- |
Usage Scenario
SCP is a secure file transfer method based on SSH2.0. Different from SFTP, SCP supports batch file upload or download.
Files on the SCP server are in the format of username@hostname:[ path ] [ filename ].
If filename and path are not specified, the system uploads files to the root directory of the working directory on the SCP server. If filename is specified, the system uploads files to the SCP server If hostname is an IPv6 address, the IPv6 address must be included in square brackets ([ ]), for example, john@[2001:db8:1::1]:.
Prerequisites
A VPN instance has been configured.
The SCP service function has been enabled using the scp server enable command.
Precautions
<HUAWEI> system-view [~HUAWEI] ip vpn-instance vpn1 [*HUAWEI-vpn-instance-vpn1] quit [*HUAWEI] scp -a 10.1.1.1 -port 1026 vpn-instance vpn1 -cipher aes256_ctr license.txt john@10.10.10.1: Trying 10.10.10.1 ... Press CTRL+K to abort Connected to 10.10.10.1 ... Enter password: license.txt 100% 38529827Bytes 165Kb/s