Skip to content
This repository was archived by the owner on Jan 16, 2024. It is now read-only.

Commit d847784

Browse files
committed
B #223: Generate SSH host keys with ssh-keygen -A
1 parent bb2df2a commit d847784

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/etc/one-context.d/loc-24-ssh_host_key##deb

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@
1717
#--------------------------------------------------------------------------- #
1818

1919
if [ ! -f /etc/ssh/ssh_host_rsa_key ]; then
20-
DEBIAN_FRONTEND=noninteractive dpkg-reconfigure openssh-server
20+
if ssh-keygen -A; then
21+
if type restorecon >/dev/null 2>&1; then
22+
restorecon -R -v /etc/ssh/
23+
fi
24+
else
25+
DEBIAN_FRONTEND=noninteractive dpkg-reconfigure openssh-server
26+
fi
2127
fi
22-

0 commit comments

Comments
 (0)