We generate an SSH key for the root user to perform backups of the SRX configuration to a remote server ("transfer-on-commit") in "password-less" mode. However, the ~root/.ssh directory, which contains the private and public keys, is deleted upon reboot.
In the configuration of SRX345 , customer can set up a configuration to copy the configuration to a remote server with each "commit" (configuration change).
---------------------
test@test-fw> show configuration system archivalconfiguration {transfer-on-commit;archive-sites {"scp://[email protected]/tftp/FW";----------------------
To enable passwordless "scp" to a server, we set up an SSH key and share the public key with the remote server.
----------------------root@test-fw% pwd/cf/rootroot@dsi-test-fw% ls -al .sshtotal 16drwx------ 2 root wheel 512 Apr 25 08:59 .drwxr-xr-x 3 root wheel 512 Apr 24 16:52 ..-rw------- 1 root wheel 411 Apr 25 08:59 id_ed25519-rw-r--r-- 1 root wheel 98 Apr 25 08:59 id_ed25519.pub----------------------
Problem :
This protocol works perfectly, but if the SRX reboots, .ssh directory in the root's home directory containing the private and public keys is deleted.
The issue is caused because of the /cf/root/ location since it is a volatile memory and every time when the device reboots, it clears the contents of the location.
This is now fixed using the PR
https://prsearch.juniper.net/problemreport/PR1819054