LinuxBasics.org

The community that helps people to run Linux

rss

Make a Directory for A Group

Let’s suppose that you want a directory called ‘develdir’ to be available for a group of 2 users called ‘username1’ and ‘username2’. Those two users will be able to put files in the directory as well as read and edit all the files. Here is how to do this as root or using ‘sudo su’:

mkdir develdir
groupadd devel
addgroup username1 username2 devel
chgrp  devel develdir
chmod g+s develdir
umask 002 develdir
  1. make the directory
  2. make the group
  3. add users to the group
  4. change the group on the directory to the new group. The owner is the same as it was, but the group is now ‘devel’.
  5. put the suid bit on the group for the directory
  6. make all the files created in the directory have full privilege for owner and group so that the members of the group can work with them

If you need to keep permissions on a copied file, use ‘install -m 666’ or ‘cp -a’ to copy files.


Copyright (c) by the authors.
Prior to editing, authors agreed to license their contributions by the terms of the GPL.
See our licensing page for details.


Linux® is a registered trademark of Linus Torvalds.


 
  tutorials/advanced/realworld/make_a_group_directory.txt · Last modified: 2008/07/20 19:08

LinuxBasics.org

Start Linux-Course Tutorials Linux Links Security Blog Forum E-mail List Search Online Chat

Site-Info

Help Get in Touch Making of LBo

Wiki-Control

Powered by

Linux Apache DokuWiki Mailman RUTE ht://Dig