file copy
Syntax
file copy source destination <source-addresssource-address> <staging-directory directory-location>
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.
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.
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 |
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
- Copy a File Using File Transfer Protocol which Requires a Password
- Copy a File Using a Staging Directory
Copy a File from the Local Device to a Personal Computer
user@host> file copy /var/tmp/rpd.core.4 mypc:/c/junipero/tmp ...transferring.file...... | 0 KB | 0.3 kB/s | ETA: 00:00:00 | 100%
Copy a Configuration File between Routing Engines
The following sample command copies a configuration file from Routing Engine 0 to Routing Engine 1:
user@host> file copy /config/juniper.conf re1:/var/tmp/copied-juniper.conf
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.
Enter
the following command to enable FTP:
root@host> file copy filename ftp://user@hostname/filename
In the following example, /config/juniper.conf is the local file and hostname is the FTP server:
root@host> file copy /config/juniper.conf ftp://user@hostname/juniper.conf Password: Receiving ftp: //user@hostname/juniper.conf (2198 bytes): 100% 2198 bytes transferred in 0.0 seconds (2.69 MBps)
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
user@host> file copy re1:/var/tmp/junos-install-x.log /root/ staging-directory /var/tmp/tmp1
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.