aboutsummaryrefslogtreecommitdiff
path: root/src/sshd/install.sh
diff options
context:
space:
mode:
Diffstat (limited to 'src/sshd/install.sh')
-rw-r--r--src/sshd/install.sh9
1 files changed, 8 insertions, 1 deletions
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