Skip to content

Commit

Permalink
remove password based login for root
Browse files Browse the repository at this point in the history
  • Loading branch information
AI-WAIFU committed May 14, 2023
1 parent a683a88 commit b192e18
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,7 @@ RUN apt-get update -y && \
pip install gpustat

### SSH
# Set password
ENV PASSWORD=password
RUN mkdir /var/run/sshd && \
echo "root:${PASSWORD}" | chpasswd && \
# Allow root login with password
sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config && \
# Prevent user being kicked off after login
sed -i 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' /etc/pam.d/sshd && \
echo 'AuthorizedKeysFile .ssh/authorized_keys' >> /etc/ssh/sshd_config && \
Expand Down

0 comments on commit b192e18

Please sign in to comment.