Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove password based login for root #936

Merged
merged 2 commits into from
May 14, 2023
Merged

Conversation

AI-WAIFU
Copy link
Contributor

Removes password based login for root, this should fix the security issues we've been having.

@AI-WAIFU AI-WAIFU requested a review from a team as a code owner May 14, 2023 20:48
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 && \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

echo 'PasswordAuthentication yes' >> /etc/ssh/sshd_config && \
should this stay?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, because right now our current infra assumes that you can log in with a password. I need to change that before removing this line.

@ShivanshuPurohit ShivanshuPurohit merged commit 9a18727 into main May 14, 2023
2 checks passed
@ShivanshuPurohit ShivanshuPurohit deleted the remove-default-password branch May 14, 2023 21:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants