Mini project: user and group management
For example, imagine that we want to allow every user who is a software developer at our company to read a given file – let’s call it document.txt
. We can simply create a developers
group and add all of our developer users to that group.
Then, when we’re setting ownership and permissions for document.txt
, we can reference the developers
group instead of trying to keep track of every single user who might be a member of that group individually.
Creating a user
On a Linux system that has the adduser
command installed, you can use it to interactively create a user named dave
. If you don’t, the package is usually named useradd
(see Chapter 9, Managing Installed Software for more details on installing packages).
Running the command with a username as the only argument will give you a wizard-style user creation process. Notice that we’re using sudo here, since only root
can add or delete users: