From 5f8524df5b20ce8d0e9daefb48eaa45a85382d5d Mon Sep 17 00:00:00 2001 From: Ayaz Salikhov Date: Mon, 21 Aug 2023 10:25:09 +0200 Subject: [PATCH] Use long options in useradd (#1978) --- images/docker-stacks-foundation/Dockerfile | 2 +- images/docker-stacks-foundation/start.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/images/docker-stacks-foundation/Dockerfile b/images/docker-stacks-foundation/Dockerfile index b9663deada..d3504eb15e 100644 --- a/images/docker-stacks-foundation/Dockerfile +++ b/images/docker-stacks-foundation/Dockerfile @@ -67,7 +67,7 @@ RUN sed -i 's/^#force_color_prompt=yes/force_color_prompt=yes/' /etc/skel/.bashr RUN echo "auth requisite pam_deny.so" >> /etc/pam.d/su && \ sed -i.bak -e 's/^%admin/#%admin/' /etc/sudoers && \ sed -i.bak -e 's/^%sudo/#%sudo/' /etc/sudoers && \ - useradd -l -m -s /bin/bash -N -u "${NB_UID}" "${NB_USER}" && \ + useradd --no-log-init --create-home --shell /bin/bash --uid "${NB_UID}" --no-user-group "${NB_USER}" && \ mkdir -p "${CONDA_DIR}" && \ chown "${NB_USER}:${NB_GID}" "${CONDA_DIR}" && \ chmod g+w /etc/passwd && \ diff --git a/images/docker-stacks-foundation/start.sh b/images/docker-stacks-foundation/start.sh index d1a0a3eab1..4ccd3792ed 100755 --- a/images/docker-stacks-foundation/start.sh +++ b/images/docker-stacks-foundation/start.sh @@ -101,7 +101,7 @@ if [ "$(id -u)" == 0 ] ; then fi # Recreate the desired user as we want it userdel "${NB_USER}" - useradd --home "/home/${NB_USER}" --uid "${NB_UID}" --gid "${NB_GID}" --groups 100 --no-log-init "${NB_USER}" + useradd --no-log-init --home "/home/${NB_USER}" --uid "${NB_UID}" --gid "${NB_GID}" --groups 100 "${NB_USER}" fi # Move or symlink the jovyan home directory to the desired users home