Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

9. Managing Files and Partitions > 9.7. Setting Up a Shared Directory with setg...

9.7. Setting Up a Shared Directory with setgid and the Sticky Bit

Problem

Your users need a directory for sharing files, and you want all the shared files to belong to the same group.

Solution

Use the setgid bit to automatically set the shared group ownership on files.

This is how to set it with octal notation:

               # chmod -v 2775 
               /shared-directory

You can also use symbolic notation:

               # chmod -v +s 
               /shared-directory

Keep in mind that +s sets both the setgid and setuid bits, which could be a security problem if executables or scripts are stored in this directory. chmod 2775 sets only the setgid bit.

Warning

setuid


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint