From f971cd363b6a84b11e02a5f63ac28b8b4b4aefe8 Mon Sep 17 00:00:00 2001 From: Felix Moessbauer Date: Mon, 27 Feb 2023 13:21:30 +0100 Subject: [PATCH] kas-container: copy host ssh config into home This patch fixes a regression introduced in 492b2c5. As the builder user is no longer created in the entrypoint, the data from the home skeleton is also not copied anymore. This breaks the ssh config (including known_hosts) when using kas-container with --ssh-dir, as the ssh dir is mounted into the skeleton, but not copied to the builders home. With this patch, we now explicitly copy the .ssh folder into the builder users home, in case it is mounted from the host. Signed-off-by: Felix Moessbauer Signed-off-by: Jan Kiszka --- container-entrypoint | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/container-entrypoint b/container-entrypoint index 28c800e..e56cf4e 100755 --- a/container-entrypoint +++ b/container-entrypoint @@ -51,6 +51,10 @@ else groupmod -o --gid "$GROUP_ID" builder usermod -o --uid "$USER_ID" --gid "$GROUP_ID" builder >/dev/null chown -R "$USER_ID":"$GROUP_ID" /builder + # copy host SSH config into home of builder + if [ -d /etc/skel/.ssh ]; then + cp -a /etc/skel/.ssh /builder/ + fi GOSU="gosu builder" fi