Skip to content

Commit

Permalink
Merge pull request #194 from zmiklank/remove_nologin
Browse files Browse the repository at this point in the history
use /bin/bash instead of /sbin/nologin as default shell for default user as s2i-core did
  • Loading branch information
phracek authored Nov 10, 2023
2 parents e75c762 + 700e707 commit abb7aa1
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 8 deletions.
3 changes: 1 addition & 2 deletions 2.4-micro/Dockerfile.c8s
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,7 @@ COPY 2.4-micro/core-scripts/usr /usr
WORKDIR ${HOME}

# Add default user and prepare httpd
RUN useradd -u 1001 -r -g 0 -d ${HOME} -s /sbin/nologin \
-c "Default Application User" default && \
RUN useradd -u 1001 -r -g 0 -d ${HOME} -c "Default Application User" default && \
chown -R 1001:0 ${APP_ROOT} && \
httpd -v | grep -qe "Apache/$HTTPD_VERSION" && echo "Found VERSION $HTTPD_VERSION" && \
/usr/libexec/httpd-prepare
Expand Down
3 changes: 1 addition & 2 deletions 2.4-micro/Dockerfile.c9s
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,7 @@ COPY 2.4-micro/core-scripts/usr /usr
WORKDIR ${HOME}

# Add default user and prepare httpd
RUN useradd -u 1001 -r -g 0 -d ${HOME} -s /sbin/nologin \
-c "Default Application User" default && \
RUN useradd -u 1001 -r -g 0 -d ${HOME} -c "Default Application User" default && \
chown -R 1001:0 ${APP_ROOT} && \
httpd -v | grep -qe "Apache/$HTTPD_VERSION" && echo "Found VERSION $HTTPD_VERSION" && \
/usr/libexec/httpd-prepare
Expand Down
3 changes: 1 addition & 2 deletions 2.4-micro/Dockerfile.fedora
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,7 @@ COPY 2.4-micro/core-scripts/usr /usr
WORKDIR ${HOME}

# Add default user and prepare httpd
RUN useradd -u 1001 -r -g 0 -d ${HOME} -s /sbin/nologin \
-c "Default Application User" default && \
RUN useradd -u 1001 -r -g 0 -d ${HOME} -c "Default Application User" default && \
chown -R 1001:0 ${APP_ROOT} && \
httpd -v | grep -qe "Apache/$HTTPD_VERSION" && echo "Found VERSION $HTTPD_VERSION" && \
/usr/libexec/httpd-prepare
Expand Down
2 changes: 1 addition & 1 deletion 2.4-micro/root/usr/share/container-scripts/httpd/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ generate_container_user() {
export USER_ID=$(id -u)
export GROUP_ID=$(id -g)
cp ${HTTPD_CONTAINER_SCRIPTS_PATH}/passwd.template ${passwd_output_dir}/passwd
echo "default:x:${USER_ID}:${GROUP_ID}:Default Application User:${HOME}:/sbin/nologin" >> ${passwd_output_dir}/passwd
echo "default:x:${USER_ID}:${GROUP_ID}:Default Application User:${HOME}:/bin/bash" >> ${passwd_output_dir}/passwd
export LD_PRELOAD=libnss_wrapper.so
export NSS_WRAPPER_PASSWD=${passwd_output_dir}/passwd
export NSS_WRAPPER_GROUP=/etc/group
Expand Down
2 changes: 1 addition & 1 deletion 2.4/root/usr/share/container-scripts/httpd/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ generate_container_user() {
export USER_ID=$(id -u)
export GROUP_ID=$(id -g)
cp ${HTTPD_CONTAINER_SCRIPTS_PATH}/passwd.template ${passwd_output_dir}/passwd
echo "default:x:${USER_ID}:${GROUP_ID}:Default Application User:${HOME}:/sbin/nologin" >> ${passwd_output_dir}/passwd
echo "default:x:${USER_ID}:${GROUP_ID}:Default Application User:${HOME}:/bin/bash" >> ${passwd_output_dir}/passwd
export LD_PRELOAD=libnss_wrapper.so
export NSS_WRAPPER_PASSWD=${passwd_output_dir}/passwd
export NSS_WRAPPER_GROUP=/etc/group
Expand Down

0 comments on commit abb7aa1

Please sign in to comment.