Managing users and groups has traditionally been tedious. Red Hat Linux has a few tools and conventions that make user and groups easier to manage, and more useful.
The easiest way to manage users and groups is through linuxconf (see Chapter 8. However, you can also use adduser to create a new user from the command line.
Table 112 lists the standard users set up by the installation
process (this is essentially the
/etc/passwd file). The group id (GID) in this table is the primary group for the user. See section 11.3.3 for details on how groups are used.
Table 113 lists the standard groups as set up by the installation process (this is essentially the /etc/group file).
Red Hat Linux uses a user private group (UPG) scheme, which makes UNIX groups much easier to use. The UPG scheme does not add or change anything in the standard UNIX way of handling groups. It simply offers a new convention for handling groups. Whenever you create a new user, by default, he or she has a unique group. The scheme works as follows:
Most computing sites like to create a group for each major project and assign people to the groups they need to be in. Managing files traditionally has been difficult, though, because when someone creates a file it is owned by the primary group he or she belongs to. When a single person works on multiple projects, it becomes hard to make the files owned by the group that is associated with that project. In the UPG scheme, groups are automatically assigned to files on a project-by-project basis, which makes managing group projects very simple.
Let's say you have a big project called devel, with many people editing the devel files in a devel directory. Make a group called devel, chgrp the devel directory to devel, and add the all the devel users to the devel group. Now, all the devel users will be able to edit the devel files and create new files in the devel directory, and these files will always retain their devel group. Thus, they will always be edit-able by other devel users.
If you have multiple projects like devel, and users who are working on multiple projects, these users will never have to change their umask or group when they move from project to project. The setgid bit on each project's main directory ``selects'' the proper group.
Since each user's HOME directory is owned by the user and their private group, it is safe to set the setgid bit on the HOME directory. However, by default, files are created with the primary group of the user, so the setgid bit would be redundant.
Since the UPG scheme is new, many people have questions about it, and they wonder why it is necessary. The following is the rationale for the scheme.
chown -R root.emacs /usr/lib/emacs/site-lisp
and you add the proper users to the group.
chmod 775 /usr/lib/emacs/site-lisp
chmod 2775 /usr/lib/emacs/site-lisp
which causes everything in the directory to be created with the ``emacs'' group.
At this point, by making the default umask 002 and giving everyone a private default group, you can easily set up groups that users can take advantage of without doing any magic. Just create the group, add the users, and do the above chown and chmod on the group's directories.