Skip to content

Commit

Permalink
fix (JupyterHub): removed root permissions for chsh
Browse files Browse the repository at this point in the history
  • Loading branch information
antoniochavesgarcia committed Jun 27, 2024
1 parent 1770169 commit 1755831
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions jupyterhub/base-cuda12.2-cudnn8-py3.11/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 && \
Expand Down Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions jupyterhub/base-py3.11/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 && \
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 1755831

Please sign in to comment.