From 2364b2a7bfd55ff1bd3d127792e5af4bda469930 Mon Sep 17 00:00:00 2001 From: Benjamin Howe Date: Sun, 7 Apr 2024 21:49:32 +0100 Subject: [PATCH 1/3] Display SSH host public keys --- root/etc/s6-overlay/s6-rc.d/init-openssh-server-config/run | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/root/etc/s6-overlay/s6-rc.d/init-openssh-server-config/run b/root/etc/s6-overlay/s6-rc.d/init-openssh-server-config/run index e5ba882..da9a24a 100755 --- a/root/etc/s6-overlay/s6-rc.d/init-openssh-server-config/run +++ b/root/etc/s6-overlay/s6-rc.d/init-openssh-server-config/run @@ -41,6 +41,10 @@ if [[ ! -L /etc/ssh ]]; then ssh-keygen -A fi +# display SSH host public key(s) +echo "SSH host public key(s):" +cat /etc/ssh/ssh_host_*.pub + # custom port if [[ -n "${LISTEN_PORT}" ]]; then sed -i "s/^#Port [[:digit:]]\+/Port ${LISTEN_PORT}"/ /etc/ssh/sshd_config From d7d02c883842ecdc51593981b08c8268943d43ef Mon Sep 17 00:00:00 2001 From: Benjamin Howe Date: Fri, 3 May 2024 11:37:48 +0100 Subject: [PATCH 2/3] Switch from `/etc/ssh` to `/config/ssh_host_keys` --- root/etc/s6-overlay/s6-rc.d/init-openssh-server-config/run | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/root/etc/s6-overlay/s6-rc.d/init-openssh-server-config/run b/root/etc/s6-overlay/s6-rc.d/init-openssh-server-config/run index da9a24a..dd560b3 100755 --- a/root/etc/s6-overlay/s6-rc.d/init-openssh-server-config/run +++ b/root/etc/s6-overlay/s6-rc.d/init-openssh-server-config/run @@ -43,7 +43,7 @@ fi # display SSH host public key(s) echo "SSH host public key(s):" -cat /etc/ssh/ssh_host_*.pub +cat /config/ssh_host_keys/ssh_host_*.pub # custom port if [[ -n "${LISTEN_PORT}" ]]; then From 3617142e294618a11bbe6ee50c28c9c9d830ce76 Mon Sep 17 00:00:00 2001 From: Benjamin Howe Date: Fri, 3 May 2024 19:37:26 +0100 Subject: [PATCH 3/3] Add changelog entry --- readme-vars.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/readme-vars.yml b/readme-vars.yml index b2c3c3e..a5844fd 100644 --- a/readme-vars.yml +++ b/readme-vars.yml @@ -76,6 +76,7 @@ app_setup_block: | The keys generated by this script are only displayed on your console output, so make sure to save them somewhere after generation. # changelog changelogs: + - {date: "04.05.24:", desc: "Display the SSH host public keys every time the container starts."} - {date: "09.03.24:", desc: "Rebase to Alpine 3.19."} - {date: "12.06.23:", desc: "Rebase to Alpine 3.18, deprecate armhf. As announced [here](https://www.linuxserver.io/blog/a-farewell-to-arm-hf)"} - {date: "05.03.23:", desc: "Rebase to Alpine 3.17."}