Rob McGee wrote to Dan Clough <=-
Re: Re: Bot-Gate v2.3
By: Dan Clough to Rob McGee on Sun Jul 19 2026 08:07 am
One question I have - it won't bind to port 23 when started as a normal user (Linux), which is expected. So I started it with 'sudo' and it's OK. Is that the proper way, or would it be better/possible to do the 'set cap...' thing with the script itself, to allow a normal user to start it?
So awesome its working and you like it :)
Yep, that is normal Linux behavior. Ports below 1024, including telnet port 23, are privileged ports, so a normal user can't find to them by default.
Running it with sudo works, but for long-term use I'd prefer not to run the whole BotGate process as root.
Yep, agreed.
There are two cleaner ways to handle it:
1. Quick/simple way:
sudo setcap 'cap_net_bind_service=+ep' $(readlink -f $(which python3))
That lets python3 bind to low ports like 23 while still running the script as a normal user.
The tradeoff is that this capability applies to that python3 binary, not only to BotGate. So any Python script run through that interpreter would also be able to bind to low ports.
Understood, and this is how I'll do it. No real "security concerns"
with this, as I'm the only user on a private server that it runs on.
2. Cleaner service way:
Run BotGate as a normal user under systemd and add this to the
service unit:
AmbientCapabilities=CAP_NET_BIND_SERVICE
CapabilityBoundingSet=CAP_NET_BIND_SERVICE
That grants the low-port bind permission only to that service
instead of giving it to python3 globally.
Yes, but this option won't work for me, as I use Slackware Linux (no
systemd). ;-)
Hope that helps! BTW, i never ran into this as I use ports 23230 and
2112. This helped me as I can now update the docs :)
It certainly does help, thank you!
One last question - It's not a HUGE problem, but when I run the script
to start BotGate, it then sits there and displays log output as it runs,
which is fine in itself, but... I would rather not have the terminal
window "tied up" with that. I tried adding the '&' to the end of the
command line, but it didn't seem to exit back to the prompt until I hit
Enter, and then a little later I found that the BotGate wasn't running
any more (so couldn't log on to the BBS). Is there a way to start the
BotGate but exit back to the command prompt?
Thanks again!
... Gone crazy, be back later, please leave message.
=== MultiMail/Linux v0.52
--- SBBSecho 3.37-Linux
* Origin: Palantir * palantirbbs.ddns.net * Pensacola, FL * (1:135/115)