User Management In Ubuntu (2) group management group settings make user management more convenient. The system administrator can grant or revoke permissions (revoke) to a group, removing the hassle of setting permissions for each user. In addition, you can set group permissions to create a public workspace for users in the group and manage their access to peripherals. Different Linux systems use different ideas to set group management. In Ubuntu, The UPG (user private group) mechanism is used. By default, a group name with the same name as the user name is set for each user. Group information in the system is stored in the/etc/group file. Www.2cto.com cindy @ cindy-ThinkPad-X200 :~ $ Cat/etc/grouproot: x: 0: daemon: x: 1: bin: x: 2: sys: x: 3: adm: x: 4: cindytty: x: 5: disk: x: 6: lp: x: 7: mail: x: 8: news: x: 9: uucp: x: 10: man: x: 12: proxy: x: 13: kmem: x: 15: dialout: x: 20: fax: x: 21: voice: x: 22: cdrom: x: 24: cindyfloppy: x: 25: tape: x: 26: sudo: x: 27: cindyaudio: x: 29: pulsedip: x: 30: cindywww-data: x: 33: backup: x: 34: operator: x: 37: list: x: 38: irc: x: 39: src: x: 40: gnats: x: 41: shadow: x: 42: utmp: x: 43: video: x: 44: sasl: x: 45: plugdev: x: 46: cind Ystaff: x: 50: www.2cto.com games: x: 60: users: x: 100: nogroup: x: 65534: libuuid: x: 101: crontab: x: 102: syslog: x: 103: fuse: x: 104: messagebus: x: 105: bluetooth: x: 106: Weight: x: 107: colord: x: 108: lpadmin: x: 109: cindyssl-cert: x: 110: lightdm: x: 111: nopasswdlogin: x: 112: netdev: x: 113: whoopsie: x: 114: mlocate: x: 115: ssh: x: 116: avahi-autoipd: x: 117: avahi: x: 118: pulse: x: 119: pulse-access: x: 120: utempter: x: 121: rtkit: x: 122: saned: x: 123: c Indy: x: 1000: sambashare: x: 124: cindywinbindd_priv: x: 125: mysql: x: 126: sunny: x: 1001: this file contains a list of all groups in the system. We can see that most of the groups are services (mail, news, etc.) and devices (floppy, disk, etc ). As mentioned above, these system device groups have ownership and control over their associated files. Add a regular user to a device group so that the regular user has the permission to use the device if the Group Administrator authorizes the regular user. That is to say, add the user cindy to the cdrom group so that cindy can use the optical drive device. Www.2cto.com the group management tool Ubuntu provides command line tools to manage groups, and also provides GUI tools to manage groups. In comparison, the command line tool is more powerful and flexible. Common Group Management command line tools include: groupadd -- create a new group groupdel -- delete an existing group groupmod -- create a group name or GID, but do not add or delete members in the group gpasswd -- create a group password. Each group can have a group password and group administrator. Use parameter-A to specify A user as the Group Administrator. Useradd-G -- Parameter-G Add the user to a group usermod-G when creating the user -- allow you to add an offline user to the group grpck -- check the/etc/group file, to prevent spelling mistakes, the following is a simple example to illustrate how to use the group management command line tool. There is now a DVD-RW device (/dev/dx0) that the system administrator wants to give regular users access to this device sunny. You can take the following steps: 1) Use the groupadd command to create a group dvdrwsudo groupadd dvdrw 2) use the chgrp command to DVD-RW the device (/dev/bq0) change the group attribute of to dvdrw www.2cto.com sudo chgrp dvdrw/dev/MCM 0 3) Use The usermod command to add authorized users to this group sudo usermod-G dvdrw sunny 4) use gpasswd to specify sunny as the Group Administrator so that he can add new users to this group sudo gpasswd-A sunny now has access to the DVD-RW driver, both superuser and sunny have the ability to add new users to this group, Because sunny is the group administrator. The system also provides a group management GUI tool, which can be found in system Settings> user accounts. As shown in:
Author lqhbupt