Description | This article describes how to regenerate FortiGate built-in SSH keys for PKI admin authentication. |
Scope | FortiGate. |
Solution |
It is possible to list the current keys with the command below:
fnsysctl ls -l /etc/ssh/ Note the timestamp of the files.
To regenerate new keys run this command:
execute ssh-regen-keys
It will restart the SSH service, therefore all SSH connections to the FortiGate will be dropped.
To reconnect again, on some systems, it can be required to clean the old key from the PC hosts folder. In Linux, it is possible to do it as follows:
ssh-keygen -f "/home/user/.ssh/known_hosts" -R "<Fortigate_IP>"
Connect again and confirm the new timestamps:
fnsysctl ls -l /etc/ssh/
Note: The moduli file in this directory will not have its timestamp changed upon running the command. |