Skip to content

Commit b359417

Browse files
committed
move chmod block
1 parent aebbc4a commit b359417

2 files changed

Lines changed: 14 additions & 9 deletions

File tree

ssh-container/Dockerfile

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
FROM ghcr.io/nearnodeflash/nnf-dm-copy-offload:0.1.19
22

33
# Build arguments for user UID/GID
4-
ARG USER_UID=1060
5-
ARG USER_GID=100
4+
ARG USER_UID=1234
5+
ARG USER_GID=1234
66

77
# Set environment variables
88
ENV USER_UID=${USER_UID}
@@ -38,13 +38,6 @@ RUN cat ${KEYS_DIR}mpiuser_key.pub > ${KEYS_DIR}/authorized_keys
3838
# Override any entrypoint from base image and set our own
3939
COPY entrypoint.sh /entrypoint.sh
4040
RUN chmod a+x /entrypoint.sh
41-
42-
# Set proper permissions on keys
43-
RUN chmod 600 ${KEYS_DIR}/ssh_host_rsa_key && \
44-
chmod 644 ${KEYS_DIR}/ssh_host_rsa_key.pub && \
45-
chmod 600 ${KEYS_DIR}/authorized_keys && \
46-
chmod 700 /home/mpiuser/.ssh && \
47-
chown -R ${USER_UID}:${USER_GID} /home/mpiuser
4841

4942
# USER mpiuser
5043
WORKDIR /home/mpiuser
@@ -55,6 +48,13 @@ RUN echo "HostKey $KEYS_DIR/ssh_host_rsa_key" > "$SESSION_DIR/sshd_config" && \
5548
echo "PermitRootLogin no" >> "$SESSION_DIR/sshd_config" && \
5649
echo "PasswordAuthentication no" >> "$SESSION_DIR/sshd_config"
5750

51+
# Set proper permissions on keys
52+
RUN chmod 600 ${KEYS_DIR}/ssh_host_rsa_key && \
53+
chmod 644 ${KEYS_DIR}/ssh_host_rsa_key.pub && \
54+
chmod 600 ${KEYS_DIR}/authorized_keys && \
55+
chmod 700 /home/mpiuser/.ssh && \
56+
chown -R ${USER_UID}:${USER_GID} /home/mpiuser
57+
5858
# Labels for identifying the UID/GID
5959
LABEL uid="${USER_UID}"
6060
LABEL gid="${USER_GID}"

ssh-container/entrypoint.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
#!/bin/sh
22

3+
echo "Starting SSH container entrypoint script..."
4+
5+
whoami
6+
id
7+
38
ls -la /home/mpiuser
49
ls -la /home/mpiuser/ssh-session
510

0 commit comments

Comments
 (0)