4 [ -f /etc/sysconfig/sshd ] && . /etc/sysconfig/sshd
6 # generate new key with empty password if it does not exist
8 local type="$1" keyfile="$2"
10 test -s $keyfile && return
12 /usr/bin/ssh-keygen -t $type -f $keyfile -N '' >&2
14 [ -x /sbin/restorecon ] && /sbin/restorecon $keyfile
17 # generate new keys with empty passwords if they do not exist
18 ssh_gen_key ed25519 /etc/ssh/ssh_host_ed25519_key
19 ssh_gen_key ecdsa /etc/ssh/ssh_host_ecdsa_key
20 ssh_gen_key rsa /etc/ssh/ssh_host_rsa_key
21 ssh_gen_key dsa /etc/ssh/ssh_host_dsa_key