How to regenerate ssh certificate on CentOS

For ssh1 protocol:

sudo ssh-keygen -f /etc/ssh/ssh_host_key -N '' -t rsa1

For ssh2 protocol:

sudo ssh-keygen -f /etc/ssh/ssh_host_rsa_key -N '' -t rsa

sudo ssh-keygen -f /etc/ssh/ssh_host_dsa_key -N '' -t dsa
Written on November 3, 2016