View Single Post

  #9 (permalink)  
Old 04-18-2008
Chris Cox
 
Posts: n/a
Default Re: Why 'mount' utils nees a setuid bit?

xi4oyu wrote:
> As we all known , in most case , 'mount ' can only be used by root .
>
> But why does it needs a setuid bit by default ?
>
> Can a common user use 'mount' program successfully ?
>
> What changes must be made in a system without sudo utils .


Linux is a multi-user system. Devices can be used by
more than one user. So who gets to own the rights to
perform the operation?

Now... with that said, there could be a day when a
non-root user (but system wide user) is the "owner"
of the privs for doing a mount, but there will always
be some kind of system wide policeman. And it is
a policeman in that you can certainly have root
(for example) do an operation on your behalf (thus
the setuid bit) and allow a normal user to seemingly
perform a privileged operation.

Another possible alternative is to have user owned
devices... that is, a disk or partition that belongs
exclusively to me (nobody else can mount or manipulate
it). But again, devices in general are not so
personalized (but it is possible, I'm not talking
about just the "owner" option).

To answer your question about allowing a user to
mount (delegation of privs by the setuid root mount
program) see the "user", "owner", "group" options (man mount).
However, mount must maintain the setuid bit to allow
this (sorry).
Reply With Quote