I installed on Ubuntu 22.04 tarpit-endlessh (apt install endlessh) and made the following settings in /etc/endlessh/config:
port 22
Delay 10000
MaxLineLength 32
MaxClients 4096
LogLevel 0
BindFamily 0
ss -tulpen | grep ssh
shows me that endlessh it is set to port 2222.
Why is port 2222 being watched even though I have port 22 set in endlessh config?
And there is only a empty endlessh.service file in /etc/systemd/system/
Instead the non-empty endlessh.service file is in /lib/systemd/system/
Here /etc/systemd/system/endlessh.service I made these changes:
If you want Endlessh to bind on ports < 1024
- run:
setcap 'cap_net_bind_service=+ep' /usr/local/bin/endlessh
- uncomment following line
AmbientCapabilities=CAP_NET_BIND_SERVICE
- comment following line
#PrivateUsers=true
However this did not work:
setcap 'cap_net_bind_service=+ep' /usr/local/bin/endlessh
I get this:
Failed to set capabilities on file `/usr/local/bin/endlessh' (No such file or directory)
The value of the capability argument is not permitted for a file. Or the file is not a regular (non-symlink) file
Edit: After
systemctl daemon-reload
it monitors Port 22 now. Although this command still don't work:
setcap 'cap_net_bind_service=+ep' /usr/local/bin/endlessh
Why most Tutorials about Endlessh write to compile it from git instead to install it easily with apt install endlessh?