user3033648
user3033648

Reputation: 125

Why does mount --bind in linux require root privileges?

Even if you have all permissions for mount source/destination it requires root, why?

Upvotes: 8

Views: 4356

Answers (2)

Alternatively, you can use bindfs to do the same thing as with mount --bind but with the added bonus that bindfs won't require you root privileges, because it is a FUSE filesystem.

Upvotes: 7

gerrit zijlstra
gerrit zijlstra

Reputation: 754

That's simply because the underlying system call (see 'man 2 mount') requires CAP_SYS_ADMIN capability no matter what the mount options are.

Allowing a user to perform mount calls would probably be rather tricky regarding security.

If you want to allow certain mount operations you can use a tool like sudo by writing appropriate rules for it.

Upvotes: 4

Related Questions