From 17558315e1b192f8497ed29580bc9cceff5f0385 Mon Sep 17 00:00:00 2001 From: antoniochavesgarcia Date: Thu, 27 Jun 2024 12:11:21 +0200 Subject: [PATCH] fix (JupyterHub): removed root permissions for chsh --- jupyterhub/base-cuda12.2-cudnn8-py3.11/Dockerfile | 5 +++++ jupyterhub/base-py3.11/Dockerfile | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/jupyterhub/base-cuda12.2-cudnn8-py3.11/Dockerfile b/jupyterhub/base-cuda12.2-cudnn8-py3.11/Dockerfile index 86f3fa5..8a3d245 100644 --- a/jupyterhub/base-cuda12.2-cudnn8-py3.11/Dockerfile +++ b/jupyterhub/base-cuda12.2-cudnn8-py3.11/Dockerfile @@ -33,6 +33,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ atop \ jq \ zsh \ + sed \ && \ apt-get clean && rm -rf /var/lib/apt/lists/* && \ echo "en_US.UTF-8 UTF-8" > /etc/locale.gen && \ @@ -93,6 +94,10 @@ RUN echo "auth requisite pam_deny.so" >> /etc/pam.d/su && \ # RUN chsh -s /bin/zsh +RUN sed -i 's/auth\s*sufficient\s*pam_shells.so/auth\s*required\s*pam_shells.so/g' /etc/pam.d/chsh +# Additional line to modify pam_rootok.so (usually not needed) +# RUN sed -i 's/auth\s*sufficient\s*pam_rootok.so/auth\s*required\s*pam_rootok.so/g' /etc/pam.d/chsh + USER ${NB_UID} RUN chsh -s /bin/zsh diff --git a/jupyterhub/base-py3.11/Dockerfile b/jupyterhub/base-py3.11/Dockerfile index 28249fd..cb8167f 100644 --- a/jupyterhub/base-py3.11/Dockerfile +++ b/jupyterhub/base-py3.11/Dockerfile @@ -33,6 +33,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ atop \ jq \ zsh \ + sed \ && \ apt-get clean && rm -rf /var/lib/apt/lists/* && \ echo "en_US.UTF-8 UTF-8" > /etc/locale.gen && \ @@ -93,6 +94,10 @@ RUN echo "auth requisite pam_deny.so" >> /etc/pam.d/su && \ # RUN chsh -s /bin/zsh +RUN sed -i 's/auth\s*sufficient\s*pam_shells.so/auth\s*required\s*pam_shells.so/g' /etc/pam.d/chsh +# Additional line to modify pam_rootok.so (usually not needed) +# RUN sed -i 's/auth\s*sufficient\s*pam_rootok.so/auth\s*required\s*pam_rootok.so/g' /etc/pam.d/chsh + USER ${NB_UID} RUN chsh -s /bin/zsh