Skip to content
Snippets Groups Projects
Commit f27df09c authored by Maciej Wielgosz's avatar Maciej Wielgosz
Browse files

updated key autherntication for oracle machine

parent bb0b72db
No related branches found
No related tags found
No related merge requests found
...@@ -36,11 +36,10 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ ...@@ -36,11 +36,10 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
tqdm \ tqdm \
pandas pandas
# OpenSSH configuration # OpenSSH configuration
RUN mkdir /var/run/sshd \ RUN mkdir /var/run/sshd \
&& sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd && sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd
# Create non-root user # Create non-root user
ARG UID=1000 ARG UID=1000
ARG GID=1000 ARG GID=1000
...@@ -50,19 +49,16 @@ ENV HOME /home/${USERNAME} ...@@ -50,19 +49,16 @@ ENV HOME /home/${USERNAME}
RUN groupadd -g ${GID} ${USERNAME} \ RUN groupadd -g ${GID} ${USERNAME} \
&& useradd -ms /bin/bash -u ${UID} -g ${GID} -G sudo ${USERNAME} \ && useradd -ms /bin/bash -u ${UID} -g ${GID} -G sudo ${USERNAME} \
&& echo "${USERNAME}:${USERNAME}" | chpasswd \ && echo "${USERNAME}:${USERNAME}" | chpasswd \
&& mkdir -p ${HOME}/data ${HOME}/.vscode-server ${HOME}/.ssh\ && mkdir -p ${HOME}/data ${HOME}/.vscode-server ${HOME}/.ssh \
&& chown ${USERNAME}:${USERNAME} ${HOME}/data ${HOME}/.vscode-server ${HOME}/.ssh && chown -R ${USERNAME}:${USERNAME} ${HOME}
# Copy your public key to the container # Copy your public key to the container
COPY id_rsa.pub /home/${USERNAME}/.ssh/authorized_keys COPY id_rsa.pub /home/${USERNAME}/.ssh/authorized_keys
RUN chown ${USERNAME}:${USERNAME} /home/${USERNAME}/.ssh/authorized_keys \ RUN chown ${USERNAME}:${USERNAME} /home/${USERNAME}/.ssh/authorized_keys \
&& chmod 600 /home/${USERNAME}/.ssh/authorized_keys && chmod 600 /home/${USERNAME}/.ssh/authorized_keys
VOLUME [ "${HOME}/data", "${HOME}/.ssh", "${HOME}/.vscode-server"] VOLUME [ "${HOME}/data", "${HOME}/.ssh", "${HOME}/.vscode-server"]
# Expose SSH # Expose SSH
EXPOSE 22 EXPOSE 22
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment