Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision |
faq:nix [2018/02/13 12:41] – [Ports Below 1024 Without Root On Linux] Add reference to Linux non-root page deuce | faq:nix [2020/03/22 00:59] – Add SDL errors FAQ digital man |
---|
* [[#Disk space|How much disk space is required]]? | * [[#Disk space|How much disk space is required]]? |
* [[#TermType|What does an ''unknown terminal'' error indicate]]? | * [[#TermType|What does an ''unknown terminal'' error indicate]]? |
* [[#ports_below_1024_without_root_on_linux|How can I bind to ports below 1024 without being root on Linux]]? | |
| |
===== Flavors ===== | ===== Flavors ===== |
| |
**Answer:**\\ | **Answer:**\\ |
A fresh install (as of Feb-2009) requires about 70MBytes. | A fresh install (as of Mar-2020) from source code, requires about 500MBytes of space. |
Much of the space consumed is in the form of intermediate build files which | Much of the space consumed is in the form of intermediate build files which may be removed after the build is complete if space is a concern. |
may be removed after the build is complete if space is a concern. | |
| |
| |
To elaborate, [[util:SBBSecho]] uses ''tempnam'' for a specific purpose, which ''mkstemp'' does not do. Additionally ''mkstemp'' is not available in all the C libraries for all the platforms for which Synchronet is built. The //dangers// of ''tempnam'' do not apply to SBBSecho's use of the function. | To elaborate, [[util:SBBSecho]] uses ''tempnam'' for a specific purpose, which ''mkstemp'' does not do. Additionally ''mkstemp'' is not available in all the C libraries for all the platforms for which Synchronet is built. The //dangers// of ''tempnam'' do not apply to SBBSecho's use of the function. |
| |
===== Ports Below 1024 Without Root On Linux ===== | ===== SDL errors ===== |
**Question:**\\ | **Question:**\\ |
How can I bind to network ports below 1024 as a non-root user on Linux? | How do I work around SDL_main errors (e.g. ''No protocol specified'' followed by a ''segmentation fault'') that prevent Synchronet applications (e.g. [[util:SCFG]], [[util:EchoCFG]], [[monitor:umonitor]], etc.) built with SDL 1.2 from running? |
| |
**Answer:**\\ | **Answer:**\\ |
By default, Linux does not allow non-root processes to bind to ports below 1024. This was done as a security measure, although some argue that the reasons for this are obsolete. It is often a bad practice to run processes as root unless it's really necessary to do so, and perhaps even more so with an Internet-accessible server. Thus, it is often desirable to run servers on standard ports (below 1024) as a non-root user. You can do so with the setcap command. For example:\\ | Clean re-build all of Synchronet without SDL support (include ''WITHOUT_SDL=1'' on the ''make'' command-lines) or set the ''SDL_VIDEODRIVER'' environment variable to the value of ''dummy'' (e.g. ''EXPORT SDL_VIDEODRIVER=dummy'') before executing the programs. |
setcap cap_net_bind_service=+ep /sbbs/exec/sbbs | |
| |
For more information, see the following:\\ | |
[[howto:linux_non-root]]\\ | |
[[https://stackoverflow.com/questions/413807/is-there-a-way-for-non-root-processes-to-bind-to-privileged-ports-on-linux|StackOverflow: Is there a way for non-root processes to bind to “privileged” ports on Linux?]]\\ | |
[[https://www.jumpingbean.co.za/blogs/mark/run-application-port-below-1024-linux|How to bind to ports below 1024 without being root on Linux?]]\\ | |
[[https://www.staldal.nu/tech/2007/10/31/why-can-only-root-listen-to-ports-below-1024|Why can only root listen to ports below 1024?]] | |
| |
===== See Also ===== | ===== See Also ===== |