LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   users list in /etc/group (https://www.linuxquestions.org/questions/slackware-14/users-list-in-etc-group-381608/)

Milosevic 11-09-2005 06:43 PM

users list in /etc/group
 
Hi, i'm having some problems to understand the role of the /etc/group file. According to the slackware book, it was supposed to have a list of groups... something like:

cvs::102:chris,logan,david,root // This is just an example

The fields are group name, group password, group ID, and group members, separated by commas. But take a look at the following lines.


milosevic@slackws:~$ id
uid=1000(milosevic) gid=100(users) groups=100(users),11(floppy),17(audio),18(video),19(cdrom)

Now look at the /etc/group file:

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
mem::8:
kmem::9:
wheel::10:root
floppy::11:
mail::12:mail
news::13:news
uucp::14:uucp
man::15:
audio::17:
video::18:
cdrom::19:
games::20:
slocate::21:
utmp::22:
smmsp::25:smmsp
mysql::27:
rpc::32:
sshd::33:sshd
gdm::42:
shadow::43:
ftp::50:
pop::90:pop
scanner::93:
nobody::98:nobody
nogroup::99:
users::100:
console::101:


As you can see, the id command tells me i'm in the group floppy, but i'm not. I wanna know why this is going on. Besides, if i change the floppy::11: to
floppy::11:milosevic , i am still not able to mount the floppy drive, why?

Txs.

slackhack 11-09-2005 06:52 PM

what's in /etc/fstab for your floppy drive? probably only the owner can mount it.

Milosevic 11-09-2005 07:04 PM

/dev/fd0 /mnt/floppy auto noauto 0 0

MMYoung 11-09-2005 08:47 PM

Quote:

Originally posted by Milosevic
/dev/fd0 /mnt/floppy auto noauto 0 0
Add user to the noauto section, i.e. noauto,user and if you want to open it as read/write add rw. Something like this:
Code:

/dev/fd0        /mnt/floppy      auto      noauto,user,rw      0  0
Also the /etc/group file should show you as members of whatever groups you added your username to when you created the user with the -G this,that,other,group. For instance:
Code:

useradd username -m -G floppy,cdrom,audio -s /bin/bash
This will create username the -m will create the home directory and the -G will add the user to the three groups, seperated by commas and no spaces, listed and will specify bash as the shell.

BTW, here is my /etc/group file, edited to just show the groups I'm in:
Code:

sys::3:root,bin,adm,mmyoung,test
disk::6:root,adm,mmyoung,test
wheel::10:root,mmyoung,test
floppy::11:root,mmyoung,test
audio::17:mmyoung,test
video::18:mmyoung,test
cdrom::19:mmyoung,test
games::20:mmyoung,test
users::100:mmyoung,test

HTH,
MMYoung

MQMan 11-10-2005 12:33 AM

As a follow on question:
Quote:

uid=1000(milosevic) gid=100(users) groups=100(users),11(floppy),17(audio),18(video),19(cdrom)
How are the extra groups, floppy, audio,video, and cdrom getting assigned to the usedid, becasue they 'aint in /etc/group. I ask because I'm seeing the same behaviour on my box, and I'm interested to know where they're being set.

Cheers,
Eddie

keefaz 11-10-2005 10:42 AM

Look at /etc/login.defs :
Code:

#
# List of groups to add to the user's supplementary group set
# when logging in on the console (as determined by the CONSOLE
# setting).  Default is none.
#
# Use with caution - it is possible for users to gain permanent
# access to these groups, even when not logged in on the console.
# How to do it is left as an exercise for the reader...
#
CONSOLE_GROUPS      floppy:audio:video:cdrom


MQMan 11-10-2005 11:30 AM

Thanks. Always wondered where they came from. :D :D :D

Cheers,
Eddie


All times are GMT -5. The time now is 05:32 PM.