diff --git a/src/etc/one-context.d/loc-24-ssh_host_key##deb b/src/etc/one-context.d/loc-24-ssh_host_key##deb index 1063923..b9f4af4 100755 --- a/src/etc/one-context.d/loc-24-ssh_host_key##deb +++ b/src/etc/one-context.d/loc-24-ssh_host_key##deb @@ -17,6 +17,11 @@ #--------------------------------------------------------------------------- # if [ ! -f /etc/ssh/ssh_host_rsa_key ]; then - DEBIAN_FRONTEND=noninteractive dpkg-reconfigure openssh-server + if ssh-keygen -A; then + if type restorecon >/dev/null 2>&1; then + restorecon -R -v /etc/ssh/ + fi + else + DEBIAN_FRONTEND=noninteractive dpkg-reconfigure openssh-server + fi fi -