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

Logging - where? #68

Open
Swallowtail23 opened this issue May 15, 2021 · 2 comments
Open

Logging - where? #68

Swallowtail23 opened this issue May 15, 2021 · 2 comments

Comments

@Swallowtail23
Copy link

I'm running with the systemd unit file as distributed.
In /etc/endlessh/config I have LogLevel 1.
Systemd file has (default) StandardOutput set to journal... yet journalctl records nothing upon start stop or connection. I tried setting to StandardOutput=file:/var/log/endlessh.log and StandardError the same, but nothing gets written.

If I start endlessh from a command line instead of the systemd unit with "endlessh -v >>/var/log/endlessh.log 2>>/var/log/endlessh.log" it does write to the log... but that doesn't help with running as a systemd unit.

I assume I'm missing something obvious, but how should I have this configured to monitor attempted connections/duration when running from a systemd file?

@svdmitrij
Copy link

svdmitrij commented Jul 27, 2021

Try to use -s option.
My working config

...
ExecStart=/usr/local/bin/endlessh -s
...
SyslogIdentifier=endlessh
#ConfigurationDirectory=endlessh
InaccessiblePaths=/var
...

@ghost
Copy link

ghost commented Aug 31, 2022

Pretty sure that endlessh outputs directly to syslog. A while back I had journalctl redirect all endlessh logs to its own file. Can't really help you since I switched to OpenBSD but you could try /var/log/syslog

leegarrett pushed a commit to leegarrett/endlessh that referenced this issue Feb 14, 2025
, skeeto#100)

Without this change, the systemd unit would fail like this:
# systemctl start endlessh
# journalctl -u endlessh -b
Feb 14 11:08:58 batou systemd[1]: Started endlessh.service - Endlessh SSH Tarpit.
Feb 14 11:08:58 batou systemd[1]: endlessh.service: Main process exited, code=exited, status=226/NAMESPACE
Feb 14 11:08:58 batou systemd[1]: endlessh.service: Failed with result 'exit-code'.
Feb 14 11:09:28 batou systemd[1]: endlessh.service: Scheduled restart job, restart counter is at 1.
Feb 14 11:09:28 batou systemd[1]: Stopped endlessh.service - Endlessh SSH Tarpit.
Feb 14 11:09:28 batou systemd[1]: Started endlessh.service - Endlessh SSH Tarpit.
Feb 14 11:09:28 batou systemd[1]: endlessh.service: Main process exited, code=exited, status=226/NAMESPACE
Feb 14 11:09:28 batou systemd[1]: endlessh.service: Failed with result 'exit-code'.
Feb 14 11:09:58 batou systemd[1]: endlessh.service: Scheduled restart job, restart counter is at 2.
Feb 14 11:09:58 batou systemd[1]: Stopped endlessh.service - Endlessh SSH Tarpit.
Feb 14 11:09:58 batou systemd[1]: Started endlessh.service - Endlessh SSH Tarpit.
Feb 14 11:09:58 batou systemd[1]: endlessh.service: Main process exited, code=exited, status=226/NAMESPACE
Feb 14 11:09:58 batou systemd[1]: endlessh.service: Failed with result 'exit-code'.
Feb 14 11:10:28 batou systemd[1]: endlessh.service: Scheduled restart job, restart counter is at 3.
Feb 14 11:10:28 batou systemd[1]: Stopped endlessh.service - Endlessh SSH Tarpit.
Feb 14 11:10:28 batou systemd[1]: Started endlessh.service - Endlessh SSH Tarpit.
Feb 14 11:10:29 batou systemd[1]: endlessh.service: Main process exited, code=exited, status=226/NAMESPACE
Feb 14 11:10:29 batou systemd[1]: endlessh.service: Failed with result 'exit-code'.
Feb 14 11:10:59 batou systemd[1]: endlessh.service: Scheduled restart job, restart counter is at 4.
Feb 14 11:10:59 batou systemd[1]: Stopped endlessh.service - Endlessh SSH Tarpit.
Feb 14 11:10:59 batou systemd[1]: endlessh.service: Start request repeated too quickly.
Feb 14 11:10:59 batou systemd[1]: endlessh.service: Failed with result 'exit-code'.
Feb 14 11:10:59 batou systemd[1]: Failed to start endlessh.service - Endlessh SSH Tarpit.

With this change, starting endlessh.service succeeds:
# systemctl start endlessh
# journalctl -u endlessh -b
[...]
Feb 14 11:15:08 batou systemd[1]: Started endlessh.service - Endlessh SSH Tarpit.

This change was tested on Debian trixie, up-to-date as of 2025-02-14.
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

2 participants