-
Notifications
You must be signed in to change notification settings - Fork 284
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
Unable to start endlessh on port 22 #39
Comments
I have little idea how the systemd stuff works, and I haven't personally
tested util/endless.service, so I can't say what would cause this error.
There's a comment about binding privileged ports in the service file.
Socket activation, per the PR, would be nice if systemd is flexible
enough about it.
|
Could this be caused by SELinux being active? |
I think I found the reason but do not have a solution. I'm using Ubuntu thus there is no SELinux and the systemd service still won't start on any port < 1024.
And adding
should do the trick but doesn't. |
After doing
and rebooting my system EndleSSH starts on boot on port 22. |
I think I solved this. You completely overlooked the blatantly commented "documentation" in the service file to begin with. Lets take a look at it again. Around the middle there are these lines.
Well it blatantly tells us what do do right here. Edit the service with |
Can confirm, it worked using the instructions in the service file. Also didn't look into the service file 🙈 |
I can confirm that the following comment by @Directory solved endlessh setup for me after installing the debian package. That said, it would be nice if the default endlessh port was 22, not really much point in setting it as a non-default port IMHO. If this package could become a standard server security hardening method I think this could really serve as a deterrent to casual port scanning.
|
What is missing in the docs that the daemon needs to be reloaded |
I get this error |
@Pickled-Aries-75 did you remember to run |
For anyone else running Debian wondering how to apply the directions above, I got it working after changing a few paths. setcap 'cap_net_bind_service=+ep' /usr/bin/endlessh
sed -i 's|#AmbientCapabilities|AmbientCapabilities|g' /lib/systemd/system/endlessh.service
sed -i 's|PrivateUsers|#PrivateUsers|g' /lib/systemd/system/endlessh.service
systemctl daemon-reload
systemctl restart endlessh.service
systemctl status endlessh.service The service unit location was throwing me off for a bit, but the changes above resulted in: > systemctl status endlessh.service
● endlessh.service - Endlessh SSH Tarpit
Loaded: loaded (/lib/systemd/system/endlessh.service; disabled; vendor preset: enabled)
Active: active (running) since Sat 2022-04-02 16:32:39 PDT; 5s ago
Docs: man:endlessh(1)
Main PID: 2013 (endlessh)
Tasks: 1 (limit: 2340)
Memory: 184.0K
CPU: 25ms
CGroup: /system.slice/endlessh.service
└─2013 /usr/bin/endlessh
Apr 02 16:32:39 - systemd[1]: Started Endlessh SSH Tarpit. |
@Mist-Hunter , don't edit the file in /lib. That file can be overwritten on package updates. Either use "systemctl edit" or copy the systemd unit file to /etc/systemd/system and edit the copy. Using systemctl edit you can create a "drop-in" file in /etc that overrides just the settings you want to change, so that changes in the distribution unit file will be picked up when you update and your overrides will be applied to the new unit file. https://flatcar-linux.org/docs/latest/setup/systemd/drop-in-units/ |
By this instruction I make it works on Debian 11 on 22 port
Like this
|
I found that I didn't need to run the |
When trying to start endlessh on port 22, on a machine using systemd,
the service fails to start due to getting
EACCESS
on thebind(2)
callto open the socket.
As
endlessh
only reportsfatal: Permission denied
, I took a recordingof the process' activity under
strace
, running as the systemd service:I was unable to find immediately what causes this, though I expect it is related
to the security-related settings in
endless.service
.I didn't search very hard, though, as I have a more satisfying solution via
socket activation...
The text was updated successfully, but these errors were encountered: