Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
howto:linux_non-root [2015/09/22 15:52] – created deuce | howto:linux_non-root [2023/03/09 10:40] (current) – add link to systemd unit file digital man | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Linux Non-root ====== | + | ====== |
- | A simple way that will allow Linux Synchronet to run completely as non-root is to explicitly allow the binary to bind low ports using the setcap command. | + | ===== systemd ===== |
+ | If you're running any kind of recent (last 2yrs+) systemd, just put this line in the '' | ||
+ | '' | ||
- | < | + | ===== setcap ===== |
+ | '' | ||
+ | |||
+ | $ sudo / | ||
+ | |||
+ | This will need to be re-ran any time the binary is rebuilt and can be automated by adding the '' | ||
+ | $ make RELEASE=1 setcap symlinks | ||
+ | |||
+ | To confirm the bind capabilities were set successfully, | ||
+ | $ sudo getcap `realpath / | ||
+ | / | ||
+ | ===== authbind ===== | ||
+ | |||
+ | An alternative may be to use authbind. | ||
+ | |||
+ | Install authbind using your favorite package manager for your Linux Distribution. | ||
+ | |||
+ | Configure it to grant access to the relevant ports, e.g. to allow 80, 21, 23,25, 110, etc 443 from all users and groups: | ||
+ | |||
+ | sudo touch / | ||
+ | |||
+ | sudo touch / | ||
+ | |||
+ | and so forth for all ports you are using below 1025 ... | ||
+ | |||
+ | sudo chmod 777 / | ||
+ | |||
+ | sudo chmod 777 / | ||
+ | |||
+ | and so forth for all ports you are using below 1025 | ||
+ | |||
+ | Now execute your command via authbind (optionally specifying --deep or other arguments, see the man page): | ||
+ | |||
+ | sudo authbind --deep / | ||
- | This must be ran on the binary itself (if / | ||
- | A better alternative may be authbind: | ||
- | [TODO] | ||
===== See Also ===== | ===== See Also ===== | ||
* [[: | * [[: | ||
- | {{tag>}} | + | {{tag>linux}} |