Tips Linux Explorers   All Things Linux Forum   Great Linux Links   LinuxClues.com   Hometown   Email 



THE GROUPS COMMAND



Just as penguins live in large groups, we Linux users like to belong to a group too . . . . . <g>
If you want to see to what groups your user belongs to, there is a simple command "groups", See here how it works. When I give the command in Slackware I get:

CODE
$ groups
users audio video plugdev

So I belong to the group "users", "audio", "video" and "plugdev"

Or giving the same command as root:

CODE
# groups
root bin daemon sys adm disk wheel floppy

This shows that root belongs to 8 different groups.



Now imagine that you want to add yourself to the "audio" group . . . there are 2 simple ways to achieve that:

Either do
 
CODE
# usermod -G audio bruno


Or if the command usermod is not available on your system, just edit the /etc/group file and add your login name to to group . . . Here is an example of my Slackware 12.0 /etc/group file:

QUOTE
# cat /etc/group
root::0:root
bin::1:root,bin,daemon
daemon::2:root,bin,daemon
sys::3:root,bin,adm
adm::4:root,adm,daemon
tty::5:
disk::6:root,adm
lp::7:lp,bruno
mem::8:
kmem::9:
wheel::10:root
floppy::11:root
mail::12:mail
news::13:news
uucp::14:uucp
man::15:
audio::17:bruno
video::18:bruno
cdrom::19:bruno
games::20:
slocate::21:
utmp::22:
smmsp::25:smmsp
mysql::27:
rpc::32:
sshd::33:sshd
gdm::42:
shadow::43:
ftp::50:
apache:x:80:
messagebus:x:81:
haldaemon:x:82:
plugdev:x:83:bruno
power:x:84:bruno
pop::90:pop
scanner::93:
nobody::98:nobody
nogroup::99:
users::100:
console::101:


Each line has 4 parts separated by colons: The first part is the name of the group. The second part ( not in use here) is for storing a password to allow users of another group to log in, if a x is in this field, the shadow group passwords are used. The third part is the GID ( Group ID ) number. The fourth part lists the users that are member of that group separated by comma's. ( So there is where you want to add your name !! )

For more info on the /etc/group file type "man 5 group" in a terminal.


NOTE: If you want to add a new group ( like "penguins" ) you give the command "groupadd penguins" . . . LOL



Bruno


-- Aug 11 2006 ( Revised May 3 2008 ) --


Tips Linux Explorers   All Things Linux Forum   Great Linux Links   LinuxClues.com   Hometown   Email