Your Linux users may not be raging bulls, but keeping them happy is always a challenge as it involves managing their accounts, monitoring their access rights, tracking down the solutions to problems they run into, and keeping them informed about important changes on the systems they use. Here are some of the tasks and tools that make the job a little easier.
Adding and removing accounts is the easier part of managing users, but there are still a lot of options to consider. Whether you use a desktop tool or go with command line options, the process is largely automated. You can set up a new user with a command as simple as adduser jdoe and a number of things will happen. John’s account will be created using the next available UID and likely populated with a number of files that help to configure his account. When you run the adduser command with a single argument (the new username), it will prompt for some additional information and explain what it is doing.
$ sudo adduser jdoe Adding user `jdoe' ... Adding new group `jdoe' (1001) ... Adding new user `jdoe' (1001) with group `jdoe' ... Creating home directory `/home/jdoe' ... Copying files from `/etc/skel' … Enter new UNIX password: Retype new UNIX password: passwd: password updated successfully Changing the user information for jdoe Enter the new value, or press ENTER for the default Full Name : John Doe Room Number : Work Phone : Home Phone : Other : Is the information correct? [Y/n] Y
As you can see, adduser adds the user's information (to the /etc/passwd and /etc/shadow files), creates the new home directory and populates it with some files from /etc/skel, prompts for you to assign the initial password and identifying information, and then verifies that it’s got everything right. If you answer “n” for no at the final "Is the information correct?" prompt, it will run back through all of your previous answers, allowing you to change any that you might want to change.
Once an account is set up, you might want to verify that it looks as you’d expect. However, a better strategy is to ensure that the choices being made "automagically" match what you want to see before you add your first account. The defaults are defaults for good reason, but it’s useful to know where they’re defined in case you want some to be different – for example, if you don’t want home directories in /home, you don’t want user UIDs to start with 1000, or you don’t want the files in home directories to be readable by everyone on the system.
Sign up for Computerworld eNewsletters.