From bdb4c0dc223a13dbdccaf1001ea2b9722d29bddf Mon Sep 17 00:00:00 2001 From: Ho Kim Date: Mon, 11 Nov 2024 13:46:34 +0000 Subject: [PATCH] fix(vine/desktop): store ssh host keys on PVC --- templates/vine/desktop/Dockerfile.ubuntu | 3 +-- templates/vine/desktop/scripts/init-desktop-ssh.sh | 3 ++- templates/vine/templates/session/user-session.yaml.j2 | 3 +++ 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/templates/vine/desktop/Dockerfile.ubuntu b/templates/vine/desktop/Dockerfile.ubuntu index 3fa98e7b..ce6ceebb 100644 --- a/templates/vine/desktop/Dockerfile.ubuntu +++ b/templates/vine/desktop/Dockerfile.ubuntu @@ -247,6 +247,7 @@ RUN apt-get update && apt-get install -y \ zsh-completions \ zsh-syntax-highlighting \ # Backup SSH Configuration + && rm -rf /etc/ssh/ssh_host_* \ && cp -r /etc/ssh /etc/.ssh \ # Cleanup && apt-get clean all \ @@ -468,8 +469,6 @@ RUN apt-get update && apt-get install -y \ # Visual Editors android-studio \ code \ - # Backup SSH Configurations - && cp -r /etc/ssh /etc/.ssh \ # DBus Configuration && sed -i '/^root \+messagebus .*$/ d' /var/lib/dpkg/statoverride \ ## blueman-applet diff --git a/templates/vine/desktop/scripts/init-desktop-ssh.sh b/templates/vine/desktop/scripts/init-desktop-ssh.sh index 63ccf053..100b29bc 100755 --- a/templates/vine/desktop/scripts/init-desktop-ssh.sh +++ b/templates/vine/desktop/scripts/init-desktop-ssh.sh @@ -20,9 +20,10 @@ fi # Generate host SSH keys if [ ! -f "/etc/ssh/ssh_host_ed25519_key.pub" ]; then - cp -r /etc/.ssh/* /etc/ssh + sudo cp -r /etc/.ssh/* /etc/ssh sudo ssh-keygen -q -A fi +sudo rm -rf /etc/.ssh # Generate user SSH keys if [ ! -f "${HOME}/.ssh/id_ed25519" ]; then diff --git a/templates/vine/templates/session/user-session.yaml.j2 b/templates/vine/templates/session/user-session.yaml.j2 index d29a4cac..e400142f 100644 --- a/templates/vine/templates/session/user-session.yaml.j2 +++ b/templates/vine/templates/session/user-session.yaml.j2 @@ -279,6 +279,9 @@ spec: # - name: scripts # mountPath: /opt/scripts # readOnly: true + - name: home + mountPath: /etc/ssh + subPath: ssh - name: tmp mountPath: /tmp - name: vine