440 CHAPTER 30 MANAGING USERS Creating a new user this way will automatically add him to the users group. However, the Ubuntu way of working is to give each user his own group based on his username. Therefore, you will always need to create a new group for the user before you create the user account itself, using the groupadd command, as follows: sudo groupadd Then you need to specify this group with the -g switch when creating a new user: sudo useradd -m -g For example, the following command creates a user called raymond and adds him to the group raymond: sudo useradd -m -g raymond raymond There s another more annoying issue relating to groups when you re creating a user account at the command line. Most users are members not only of their own group, but also of several system groups. These groups relate to various hardware and software functions. For example, membership of the audio group is required if the user wants to be able to use the sound card and hear audio. This is necessary because of the way Linux works. Therefore, you need to add new users to these groups if they re to make full use of the system. These groups are described as supplementary groups. Use the id command to display user and group information. On my test system, typing the following: id keir revealed the following groups: uid=1000(keir) gid=1000(keir) groups=1000(keir),4(adm),20(dialout),24(cdrom),25(floppy),29(audio),30(dip),44 (video),36(plugdev),104(lpadmin),105(scanner),106(admin) All those after my main group, 1000(keir), are supplementary groups. For a list of what they do, see Table 30-1. Table 30-1. System Groups Within Ubuntu Group Definition adm Used for system logging dialout Required for use of serial port devices, such as older modems cdrom Allows user to access CD/DVD-ROM floppy Allows user to access floppy disk drive audio Enables sound output for user dip Required for use of dial-up modems
This entry was posted
on Friday, March 21st, 2008 at 10:05 am and is filed under PHP5.
You can follow any responses to this entry through the RSS 2.0 feed.
You can leave a response, or trackback from your own site.