0

The man page for mount indicates:

suid    Allow set-user-ID or set-group-ID bits to take effect.

nosuid  Do not allow set-user-ID or set-group-ID bits to take effect.

but no indication that one or the other of these options is the default.

At the same time, I cannot find anything about the suid or nosuid status of my root filesystem:

  • If I execute the command $ mount I get:

/dev/sda2 on / type ext4 (rw,relatime,errors=remount-ro,data=ordered).

  • I don't see any suid or nosuid option inside the file /etc/fstab.

  • In /proc/mounts it only indicates:

/dev/sda2 / ext4 rw,relatime,errors=remount-ro,data=ordered 0 0.

  • I cannot find anything in the man pages of mkfs.ext4 or tune2fs, or in the file /etc/mke2fs.conf.

So my questions are:

  • How is the status suid or nosuid chosen when a filseystem is mounted?
  • Where can one find the suid or nosuid status of a mounted filesystem?
0

suid is the default. The explicit suid option is only needed for the case where you want to remount a file system or override the options from /etc/fstab.

This isn't part of your question, but notice that the nosuid option also affects file capabilities -- they will be ignored on filesystems mounted that way.

  • Would you have a reference for suid being the default? I did not manage to find the information. Is it referenced in some man pages? – The Quark May 23 at 21:37
  • 2
    the nosuid option is an artifact of the mount utility -- the mount(2) system call only has a MS_NOSUID option, there is no MS_SUID. – mosvy May 23 at 21:44
  • 1
    man page says: defaults Use the default options: rw, suid, dev, exec, auto, nouser, and async. – Jasen May 23 at 21:53
  • And it is documented under the defaults meta-option in the manpage of the mount(8) utility. – mosvy May 23 at 21:59
  • it should've been "the suid option is an artifact" in the comment above, sorry. – mosvy May 23 at 22:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.