State: in_progress tags: linux system admin

setuid on executables

setuid is a permission bit that when set and is ran by an user that has execution permission it gets executed with permissions of the owner, for example: let’s say we have a file with the following permissions

drwxr-xr-x 10 abdelrahman users    4096 Jun 27 11:09  pytube

here we can see that others have the execution permission, when a user other than abdelrahman runs it, the file gets executed as if he was abdelrahman

setuid has the value 4 when setting it with chmod

setgid on directories

lets say we have a directory which is owned by a group called “programmers” and then comes a user with a group named “engineers”, when he creates a folder or a file inside the directory, the file’s group will be same group of the parent directory “programmers”

stickybit and its effects

stickybit is a bit tricky, let’s say we have directory which is owned by the group “programmers” and this group has read and write permission on all subdirectories. Now, if another user who is a part of the “programmers” group tries to delete the any subdirectory/file, it will be deleted, the stickybit prevents the deletion even if the user has r/w permission, only the owner can delete.

References

  1. SUID and SGID