home

Supported platforms

Vyatta documentation

Learn how to install, configure, and operate the Vyatta Network Operating System (Vyatta NOS) and Orchestrator, which help drive our virtual networking and physical platforms portfolio.

copy file <from-file> to <to-file>

Copies a file or directory from one file system location to another, or a file to or from a remote system.
Note: On a local file system, you can copy a file or directory using this command. On a remote system, you can only copy a file (using the FTP, TFTP, SCP, or SFTP protocols).
file <from-file>
The source location of the file or folder from which you want to copy. The source location can be on a remote system, but only if <to-file> is on a local file system.
to <to-file>
The destination location of the file or folder to which you want to copy. The destination location can be on a remote system, but only only if <from-file> is on a local file system.
[user <username>]
Optional. The username to use for the remote system, if a remote system has been specified in <from-file> or <to-file>. Alternatively, you can encode the username in the remote system URL.
[password <password>]
Optional. The password to use for the remote system, if a remote system has been specified in <from-file> or <to-file>. Alternatively, you can encode the password in the remote system URL.
[source-interface <interface-name>]

Optional. The interface to use for file copy transfers for the remote system, if a remote system has been specified in <from-file> or <to-file>.

Note: If you do not specify this argument, Vyatta NOS uses the source interface from the set security ssh-client source-interface option in the system configuration.
[skip-host-validation]

Optional. If a remote system has been specified in <from-file> or <to-file>, Vyatta NOS skips ssh-known-hosts validation for this command.

Warning: Using this argument decreases the security of the Vyatta NOS system and exposes the system to potential attacks.

Local file system

To specify a location on a local file system, use the name of the system image, and the directory path to the location.

For example:

  • To specify the /config directory of the currently running system, use running://config/
  • To specify the /config directory of a system image called test-image1, use test-image1://config/
Note:

This command is typically used for configuration files and directories — by default, CLI command completion refers to the /config directory of any known system image.

However, you can specify any location that you want, instead of the /config directory.

Remote system

To specify a location on a remote system, use the URL with the required protocol, address, and the directory path to the location.

For example, to specify the /data directory on a remote system with address 192.168.0.10, using the SCP protocol, use scp://192.168.0.10/data/.

Note: You can copy a file either to or from a remote system using this command. You cannot copy a file between remote systems.
Attention: If you want to copy a file to or from a remote system, add the SSH public host key of the remote system with set security ssh-known-hosts.

To authenticate with a remote system, you can supply a username and password as command line arguments, or encoded in the remote system URL. If you do not supply a username and password, then Vyatta NOS prompts you for them.

File system locations

A list of file system and remote locations and the corresponding arguments required to specify them.

Vyatta NOS supports the following protocols and formats for specifying a location:

LocationFormat
FTP serverftp://<user>:<password>@<host>/<file>
SCP serverscp://<user>:<password>@<host>/<file>
SFTP serversftp://<user>:<password>@<host>/<file>
TFTP servertftp://<host>/<file>
System image<image-name>://<file>

Where the arguments in each location format are specified as follows:

<user>
Specifies the username on the host.
<password>
Specifies the password associated with the username.
<host>
Specifies the host name or IP address of the server.
<file>
Specifies the path and file name of the target file.
<image-name>
Specifies the name of a system image.