[an error occurred while processing this directive][an error occurred while processing this directive]

Copy Files between the Local Router and a Remote System

Action

You can copy a configuration file from a Routing Engine to a remote system in the network using the File Transfer Protocol (FTP) or secure copy protocol (scp) in any one of the following ways:

  • To use anonymous FTP to copy a local file to a remote system, enter the following command:
    root@host> file copy filename ftp://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.confftp://hostname/juniper.confReceiving ftp: //hostname/juniper.conf (2198 bytes): 100% 
    2198 bytes transferred in 0.0 seconds (2.69 MBps)
  • To use FTP where a valid username and password are required, enter the following command:
    root@host> file copy filename ftp://user:password@hostname/filename

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

    root@host> file copy /config/juniper.conf ftp://user:testing123@hostname/juniper.conf
    Receiving ftp: //user:testing123@hostname/juniper.conf (2198 bytes): 100%
    2198 bytes transferred in 0.0 seconds (2.69 MBps)
  • To use FTP where you require more privacy and are prompted for a password, enter the following command:
    root@host> file copy filename ftp://user@hostname/filename

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

    root@host> file copy /config/juniper.conf ftp://user@hostname/juniper.conf
    Password for user@hostname: ******
    Receiving ftp: //user@hostname/juniper.conf (2198 bytes): 100%
    2198 bytes transferred in 0.0 seconds (2.69 MBps)
  • To use scp to copy a local file to a remote system, enter the following command:
    root@host> file copy filename scp://user@hostname/path/filename

    In the following example, /config/juniper.conf is the local file, user is the username, and ssh-host is the scp server:

    root@host> file copy /config/juniper.conf scp://user@ssh-host/tmp/juniper.conf
    user@ssh-host's password: ******
    juniper.conf         100% |*********************************************************************************|  2198       00:00

Note: You cannot use scp or ssh to copy a file in the worldwide version of the JUNOS software.


Published: 2010-01-25

[an error occurred while processing this directive]