This article describes the procedure to generate SSH RSA/DSA keys on EX-Series switches and ways to retain them.
During the upgrade/downgrade process, the SSH RSA/DSA keys will be deleted. The solution section explains how to retain the keys after upgrade/downgrade.
We have to enable SSH service on the switch using the following command:
root@Juniper# set system services ssh
root@Juniper>start shell root@Juniper% ssh-keygen -t rsa Generating public/private rsa key pair. Enter file in which to save the key (/root/.ssh/id_rsa): Created directory '/root/.ssh'. Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /root/.ssh/id_rsa. Your public key has been saved in /root/.ssh/id_rsa.pub.
91:6e:b9:52:fd:14:85:1e:8c:40:9a:7c:2d:c7:d4:0d root@SW_Jaffa_Monitor_104 % ssh-keygen -t rsa/dsa
root@Juniper#set system login user <userid> uid 2000 root@Juniper#set system login user <userid> class super-user root@Juniper#set system login user <userid> authentication load-key-file /root/.ssh/id_rsa.pub
root@Juniper#set system login user <userid> authentication load-key-file /root/.ssh/id_rsa.pub