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

sshd logs #11

Open
danieleades opened this issue May 15, 2020 · 1 comment · May be fixed by #15
Open

sshd logs #11

danieleades opened this issue May 15, 2020 · 1 comment · May be fixed by #15

Comments

@danieleades
Copy link

i'm trying to debug an SSH authentication issue. How can I get server-side logs?

@501st-alpha1
Copy link

I ran into this issue too, and couldn't find anything under /var/log in the container, and nothing showed on the output when running the container in the foreground.

I think the cause of this issue is the same as hinted at in this Unix.SE question: Alpine doesn't come with rsyslog or other necessary services by default, while sshd tries to log to rsyslog by default.

I didn't want to deal with installing extra services, so I tried to find another way to do it. I found this ServerFault answer:

Use -e command-line option

I tried setting that as the command for the container by starting as docker run ... gitolite sshd -D -e, but it wasn't working. Then I realized that this repo's docker-entrypoint.sh overwrites the arguments passed to sshd:

if [ "${1}" = 'sshd' ]; then
set -- /usr/sbin/sshd -D

Editing that line and adding -e to the end finally fixed the issue; I now see logs from sshd in the Docker output.

501st-alpha1 added a commit to 501st-alpha1/docker-gitolite that referenced this issue May 27, 2022
As mentioned in jgiannuzzi#11, sshd tries to log to rsyslog, which isn't
installed in Alpine by default, so this lets the logs be sent to
standard out instead, where it can be managed by Docker.
@501st-alpha1 501st-alpha1 linked a pull request May 27, 2022 that will close this issue
gbence pushed a commit to gbence/docker-gitolite that referenced this issue Sep 5, 2023
As mentioned in jgiannuzzi#11, sshd tries to log to rsyslog, which isn't
installed in Alpine by default, so this lets the logs be sent to
standard out instead, where it can be managed by Docker.
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 a pull request may close this issue.

2 participants