After a Junos upgrade an SSH certificate might change. If it happens the new certificate can be obtained as follows.
Here are the steps to achieve this:
Generate SSH Key on the Switch:
Log into the switch with the root user and generate the SSH key using the following command:
user@host% ssh-keygen
This will generate the SSH key with the RSA algorithm and a key length of 2048 by default. You can also specify a stronger key length or a different algorithm if needed.
Transfer the SSH Key to the Server:
Locate the generated SSH key on the switch, typically found at /root/.ssh/id_rsa.pub.