3

Why is the logrotate's bin path /usr/sbin on Debian (at least "wheezy”) knowing that we can actually use it without the root privilege?

2 Answers 2

6
+50

The path for logrotate is placed in /usr/sbin likely, because it is a system administration utility which is generally executed once all filesystems are mounted.

logrotate(8) - Linux man page

logrotate is designed to ease administration of systems that generate large numbers of log files.


Linux Foundation - Filesystem Hierarchy Standard - /sbin System binaries

Utilities used for system administration (and other root-only commands) are stored in /sbin, /usr/sbin, and /usr/local/sbin. /sbin contains binaries essential for booting, restoring, recovering, and/or repairing the system in addition to the binaries in /bin. Programs executed after /usr is known to be mounted (when there are no problems) are generally placed into /usr/sbin.

Note: Many utilities in the sbin directories can be used by regular users. Any user can run ifconfig to get information about the active network interfaces. Of course, using ifconfig to modify network interface settings would require additional permissions.

4
  • 2
    I think his question is more about bin vs sbin.
    – Daniel B
    Mar 2, 2017 at 16:24
  • logrotate is a system administration utility. System administration utilities go in sbin
    – Steven
    Mar 2, 2017 at 16:34
  • 1
    Indeed, why couldn't one use it to rotate logs produced by a user-ran application, user-owned files. Put otherways, what in logrotate implementation makes it either unfit or insecure for non-root usage ?
    – mveroone
    Mar 3, 2017 at 23:21
  • OK , I read your "Note" correctly this time. the binary is indeed 755 and executable by other users. Only in sbin because it's mainly used by root I guess. Bounty credited for first and most detailed answer
    – mveroone
    Mar 4, 2017 at 15:27
1

A user process can use logrotate in /usr/sbin, but only for its own logs. Root runs logrotate from cron to do it for all users. A suid bit on it is convenient, but less secure.

1
  • I haven't checked the binary file mode, indeed. Regular users can use it.
    – mveroone
    Mar 4, 2017 at 15:25

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .