Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

file copy

Syntax

Description

Copy files from one location to another location on the local device or to a location on a remote device reachable by the local device.

For information on valid file name and URL formats, see Format for Specifying Filenames and URLs in Junos OS CLI Commands.

CAUTION:

Starting with Junos OS Release 15.1, the sslv3-support option is not available for configuration with the set system services xnm-ssl and file copy commands. SSLv3 is no longer supported and available.

For all releases prior to and including Junos OS Release 14.2, SSLv3 is disabled by default at runtime. The sslv3-support option is hidden and deprecated in Junos OS Release 14.2 and earlier releases. However, you can use the set system services xnm-ssl sslv3-support command to enable SSLv3 for a Junos XML protocol client application to use as the protocol to connect to the Junos XML protocol server on a router, and you can use the file copy source destination sslv3-support command to enable the copying of files from an SSLv3 URL.

Using SSLv3 presents a potential security vulnerability, and we recommend that you not use SSLv3. For more details about this security vulnerability, see the Juniper Networks Knowledge Base articlehere.

Note:

If you define an ordered set of ciphers, key exhange methods, or message authentication codes (MACs) at the [edit system services ssh] hierarchy level, the newly-defined set is used when copying files using secure copy protocol (scp). For more information, see Configuring the SSH Service to Support Legacy Cryptography.

Options

source

Specify the source URL.

destination

Specify the destination URL.

source-addresssource-address

(Optional) Specify the local address to use in originating the connection.

staging-directory directory-location

(Optional) Specify the staging directory on Routing Engine

Note:

If you are using a literal IPv6 address in your command entry, the address must be enclosed in [ ] brackets. This conforms to RFC 2732.

Required Privilege Level

maintenance

Sample Output

Following are some file copy examples.

Copy a File from the Local Device to a Personal Computer

Copy a Configuration File between Routing Engines

The following sample command copies a configuration file from Routing Engine 0 to Routing Engine 1:

Copy a File Using File Transfer Protocol which Requires a Password

You can use FTP with the file copy command for additional privacy. You will be prompted for a password. The password will display using * symbols when viewing interactive logs. Enter the following command to enable FTP:

In the following example, /config/juniper.conf is the local file and hostname is the FTP server:

Note:

Starting in Junos OS Evolved release 22.2R2, the password prompt has changed from Password for user@hostname: to Password:

Copy a File Using a Staging Directory

The following sample command copies a file using a staging directory

Release Information

Command introduced before Junos OS Release 7.4.

source-address option added in Junos OS Release 7.4.

staging-directory option added in Junos OS Release 17.3R1.