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 \
tqdm \
pandas
# OpenSSH configuration
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
# Create non-root user
ARG UID=1000
ARG GID=1000
......@@ -50,19 +49,16 @@ ENV HOME /home/${USERNAME}
RUN groupadd -g ${GID} ${USERNAME} \
&& useradd -ms /bin/bash -u ${UID} -g ${GID} -G sudo ${USERNAME} \
&& echo "${USERNAME}:${USERNAME}" | chpasswd \
&& mkdir -p ${HOME}/data ${HOME}/.vscode-server ${HOME}/.ssh\
&& chown ${USERNAME}:${USERNAME} ${HOME}/data ${HOME}/.vscode-server ${HOME}/.ssh
&& mkdir -p ${HOME}/data ${HOME}/.vscode-server ${HOME}/.ssh \
&& chown -R ${USERNAME}:${USERNAME} ${HOME}
# Copy your public key to the container
COPY id_rsa.pub /home/${USERNAME}/.ssh/authorized_keys
RUN chown ${USERNAME}:${USERNAME} /home/${USERNAME}/.ssh/authorized_keys \
&& chmod 600 /home/${USERNAME}/.ssh/authorized_keys
VOLUME [ "${HOME}/data", "${HOME}/.ssh", "${HOME}/.vscode-server"]
# Expose SSH
EXPOSE 22
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment