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

root SSH login does not work in some scenarios #8

Open
brentwritescode opened this issue Feb 12, 2020 · 0 comments
Open

root SSH login does not work in some scenarios #8

brentwritescode opened this issue Feb 12, 2020 · 0 comments

Comments

@brentwritescode
Copy link

brentwritescode commented Feb 12, 2020

I discovered that this line in the Dockerfile works:

RUN sed -i 's/PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config

However, for me the entry in the /etc/ssh/sshd_config file itself is still commented out (not sure if it's always a problem) and as a result still gets "access denied" when trying to SSH as root. i.e.:

$ grep -i "PermitRootLogin yes" /etc/ssh/sshd_config
#PermitRootLogin yes

An easy fix is to either update the existing sed command or add a second sed command such as:

RUN sed -i 's/#PermitRootLogin/PermitRootLogin/' /etc/ssh/sshd_config

If the entry is not commented out, the secondary sed command has no effect. Then I was able to successfully SSH once the file looked like this:

$ grep -i "PermitRootLogin yes" /etc/ssh/sshd_config
PermitRootLogin yes

Mostly posting here in case anyone else runs into this. I will submit a PR if I get a chance. Thanks!

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

No branches or pull requests

1 participant