Linux - Difference between sticky bit suid sgid, What is sticky bit, SUID, SGID

Difference between sticky bit suid sgid

what is "sticky bit", "SUID" , "SGID"?

1) Sticky bit was used on executable in Linux (which was used more often)so that they would remain in the memory more time after the initial execution, hoping they would be needed in the near future. But since today we have more sophisticated memory accessing techniques and the bottleneck related to primary memory is diminishing, the sticky bit is not used today for this. Instead, it is used on folders, to imply that a file or folder created inside a stickybit-enabled folder could only be deleted by the creator itself. A nice implementation of sticky bit is the /tmp folder, where every user has write permission but only users who own a file can delete them. Remember files inside a folder which has write permission can be deleted even if the file doesnt have write permission. The sticky bit comes useful here.

2) As of SUID or SetUID bit, the executable which has the SUID set runs with the ownership of the program owner. That is, if you own an executable, and another person issues the executable, then it runs with your permission and not his. The default is that a program runs with the ownership of the person executing the binary.

3) The SGID bit is the same as of SUID, only the case is that it runs with the permission of the group. Another use is it can be set on folders, making any files or folders created inside the SGID set folder to have a common group ownership.

The topic on Linux - Difference between sticky bit suid sgid is posted by - Math

Hope you have enjoyed, Linux - Difference between sticky bit suid sgidThanks for your time

Tech Bluff