feat: connect through ssh

This commit is contained in:
Justin Lin committed 2024-10-13 15:59:01 +08:00
1 parent 4c292fd6ba
commit a6720cfe39
5 files changed
+192 -43

No files matched your search

+1 -2
View File
@@ -25,13 +25,12 @@ COPY ./quests/.includes/zshrc /etc/zsh/zshrc
ENV USERNAME=commander
RUN adduser --disabled-password --gecos '' --shell /bin/zsh ${USERNAME}
COPY ./quests/sshd_config /etc/ssh/sshd_config
COPY ./ssh_pubkey /home/${USERNAME}/.ssh/authorized_keys
RUN chmod 600 /home/${USERNAME}/.ssh/authorized_keys \
&& chmod 700 /home/${USERNAME}/.ssh \
&& chown -R ${USERNAME}:${USERNAME} /home/${USERNAME}/.ssh
RUN apt-get install -y net-tools
RUN service ssh start
EXPOSE 22