Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Setuid
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== Sticky bit with SGID === '''3171''' on a directory named 'blog' owned by the group 'engineers' and the user 'root' A user named 'torvalds' who belongs primarily to the group 'torvalds' but secondarily to the group 'engineers' creates a file or directory named 'thoughts' inside the directory 'blog'. A user named 'wozniak' who also belongs to the group 'engineers' cannot delete, rename, or move the file or directory named 'thoughts', because he is not the owner and the sticky bit is set. However, if 'thoughts' is a file, then 'wozniak' can edit it. '''Sticky bit has the final decision.''' If sticky bit and SGID had not been set, the user 'wozniak' could rename, move, or delete the file named 'thoughts' because the directory named 'blog' allows read and write by group, and wozniak belongs to the group, and the default 0002 [[umask]] allows new files to be edited by group. Sticky bit and SGID could be combined with something such as a read-only umask or an append only attribute.<syntaxhighlight lang="console"> [ torvalds /home/shared/ ] $ groups torvalds torvalds : torvalds engineers [ torvalds /home/shared/ ] $ stat -c "%a %U:%G %n" ./blog/ 3171 root:engineers ./blog/ [ torvalds /home/shared/ ] $ echo 'NEW FILE' > ./blog/thoughts [ torvalds /home/shared/ ] $ su - wozniak Password: [ wozniak ~/ ] $ cd /home/shared/blog [ wozniak /home/shared/blog/ ] $ groups wozniak wozniak : wozniak engineers [ wozniak /home/shared/blog/ ] $ stat -c "%a %U:%G %n" ./thoughts 664 torvalds:engineers ./thoughts [ wozniak /home/shared/blog/ ] $ rm thoughts rm: cannot remove ‘thoughts’: Operation not permitted [ wozniak /home/shared/blog/ ] $ mv thoughts /home/wozniak/ mv: cannot move ‘thoughts’ to ‘/home/wozniak/thoughts’: Operation not permitted [ wozniak /home/shared/blog/ ] $ mv thoughts pondering mv: cannot move ‘thoughts’ to ‘pondering’: Operation not permitted [ wozniak /home/shared/blog/ ] $ echo 'REWRITE!' > thoughts [ wozniak /home/shared/blog/ ] $ cat thoughts REWRITE! </syntaxhighlight>
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)