From a4d434f22df175f6e337fef8f099a197b574f64b Mon Sep 17 00:00:00 2001
From: Josh Spicer <joshspicer@github.com>
Date: Wed, 25 May 2022 12:53:54 -0700
Subject: sync with jammy updates (#21)

sync with jammy updates (https://github.com/microsoft/vscode-dev-containers/commit/053a0557211c98e5b9f0e8ccf755f6f143b05ef4) and other minor additions since copy over
---
 src/sshd/install.sh | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

(limited to 'src/sshd')

diff --git a/src/sshd/install.sh b/src/sshd/install.sh
index eb33a09..3e8d2ec 100644
--- a/src/sshd/install.sh
+++ b/src/sshd/install.sh
@@ -75,6 +75,13 @@ elif [ "${NEW_PASSWORD}" != "skip" ]; then
     echo "${USERNAME}:${NEW_PASSWORD}" | chpasswd
 fi
 
+if [ $(getent group ssh) ]; then
+  echo "'ssh' group already exists."
+else
+  echo "adding 'ssh' group, as it does not already exist."
+  groupadd ssh
+fi
+
 # Add user to ssh group
 if [ "${USERNAME}" != "root" ]; then
     usermod -aG ssh ${USERNAME}
@@ -166,4 +173,4 @@ echo -e "Done!\n\n- Port: ${SSHD_PORT}\n- User: ${USERNAME}"
 if [ "${EMIT_PASSWORD}" = "true" ]; then
     echo "- Password: ${NEW_PASSWORD}"
 fi
-echo -e "\nForward port ${SSHD_PORT} to your local machine and run:\n\n  ssh -p ${SSHD_PORT} -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o GlobalKnownHostsFile=/dev/null ${USERNAME}@localhost\n"
+echo -e "\nForward port ${SSHD_PORT} to your local machine and run:\n\n  ssh -p ${SSHD_PORT} -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o GlobalKnownHostsFile=/dev/null ${USERNAME}@localhost\n"
\ No newline at end of file
-- 
cgit v1.2.3