cd /etc/ssh/ rm ssh_host_*key* ssh-keygen -t ed25519 -f ssh_host_ed25519_key -N "" < /dev/null ssh-keygen -t rsa -b 4096 -f ssh_host_rsa_key -N "" < /dev/null ssh-keygen -M generate -O bits=4096 moduli-4096.candidates ssh-keygen -M screen -f moduli-4096.candidates moduli-4096 mv moduli moduli-`date +"%Y%m%d"`.bak mv moduli-4096 moduli # copier les configurations personnalisées comme ci-dessous dans /etc/ssh/sshd_config.d/ et /etc/ssh/ssh_config.d/ systemctl restart ssh.service