Step 2: 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:root@host>file copyfilenameftp://hostname/filenameIn the following example,
/config/juniper.confis the local file andhostnameis the FTP server:root@host>file copy /config/juniper.conf ftp://hostname/juniper.confReceiving ftp: //hostname/juniper.conf (2198 bytes): 100%2198 bytes transferred in 0.0 seconds (2.69 MBps)root@host>file copyfilenameftp://user:password@hostname/filenameIn the following example,
/config/juniper.confis the local file,useris the username,testing123is the password, andhostnameis the FTP server:root@host>file copy /config/juniper.conf ftp://user:testing123@hostname/juniper.confReceiving 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 copyfilenameftp://user@hostname/filenameIn the following example,
/config/juniper.confis the local file,useris the username, andhostnameis the FTP server:root@host>file copy /config/juniper.conf ftp://user@hostname/juniper.confPassword for user@hostname:******Receiving ftp: //user@hostname/juniper.conf (2198 bytes): 100%2198 bytes transferred in 0.0 seconds (2.69 MBps)root@host>file copyfilenamescp://user@hostname/path/filenameIn the following example,
/config/juniper.confis the local file,useris the username, andssh-hostis the scp server:root@host>file copy /config/juniper.conf scp://user@ssh-host/tmp/juniper.confuser@ssh-host's password:******juniper.conf 100% |******************************************************** *************************| 2198 00:00
NOTE: You cannot use
scporsshto copy a file in the worldwide version of the JUNOS software.