Description

This article explains the use of "secure copy"(scp) method to archive or backup configuration to a remote device when executing a commit operation

Symptoms

The transfer-on-commit command in JUNOS uses different methods to archive configuration to a remote host such as ftp, scp etc.  This article specifically mentions how to use the scp method. This article also assumes that the ssh protocol is enabled in the configuration of the EX Switch.

Solution

The following configuration is used to set the EX use to archive the configuration using scp.

Switch# set system archival configuration transfer-on-commit

Switch# set system archival configuration archive-sites "scp://user@remote-host-ip:/path/filename" password "password"


After entering the above command, please enter the carriage-return and you will be prompted by the following message to add the public key of the remote host ip. The prompt will appear only if it was first time the remote ip is used for archival on the EX Switch.  Please answer "yes" at the prompt

{master:1}[edit system archival configuration]
Switch@user# set archive-sites "scp://[email protected]:/path/filename" password "password"
The authenticity of host '10.85.33.22 (10.85.33.22)' can't be established.
RSA key fingerprint is 24:60:ab:1b:6d:4e:10:e2:ea:9c:0f:af:17:49:38:cc.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '10.85.33.22' (RSA) to the list of known hosts
.

The public key of the remote host (10.85.33.22 in the above example) can be viewed using the command

Switch# show security
ssh-known-hosts {
host 10.85.33.22 {
rsa-key  B3NzaC1yc2EAAAABIwAAAQEA..(truncated)
}
}

Once the key is added, EX archives the configuration, every time the configuration is committed.

Related Information