O'Reilly logo

Fundamentals of Linux by Oliver Pelz

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

setgid

Now, let's learn about the setgid permission. This flag has two different meanings, which is important to know about and should be memorized. When set on a file, it has the same effect as the setuid permission, but here it will execute a command with the rights of the group owner instead of the file owner.

To set the setgid flag on the file, use the number 2 in the chmod command:

The second meaning of the setgid flag is very important and should be memorized because it can be a typical use case. If you set the setgid on a folder instead of a file, every new file, or folder, or subfolder created within this folder will automatically ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required