LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 04-17-2007, 05:55 PM   #1
rosepower
LQ Newbie
 
Registered: Nov 2005
Location: Portugal
Distribution: Slackware 12 / Testing Other distros
Posts: 24

Rep: Reputation: 15
Doubt when creating a user and checking /etc/group and /etc/passwd


Hi,

I've been having some doubts regarding the creation of users in slackware, and in general linux as well.

I installed Slackware, performed all the configuration that i think i need to do, so that the system performs like i want. And every thing went fine. I then used the script adduser to create my personal account on the system. I only entered my login and user name, the rest i accepted the default options.

Every thing is working fine but there is something troubling me:

When i run the command "id" i get this:
uid=1000(ricardo) gid=100(users) groups=11(floppy),17(audio),18(video),19(cdrom),100(users)

But when i check the /etc/group file my name is nowhere in the 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:root
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::90op
scanner::93:
nobody::98:nobody
nogroup::99:
users::100:
console::101:

Should i not see my name in front of the groups i belong to, like audio, video, etc ???

Since i come from a windows background, there are still some concepts that i find hard to get into my head.

Best regards
 
Old 04-17-2007, 06:01 PM   #2
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
you are not a group ... user and group are two different things

Last edited by H_TeXMeX_H; 04-17-2007 at 06:03 PM.
 
Old 04-17-2007, 06:06 PM   #3
erklaerbaer
Member
 
Registered: Mar 2006
Posts: 381

Rep: Reputation: 30
what beats me though, is why you are in any group at all.
could it be, that that is /etc/groups-(a backup file) and not /etc/group?


(read slackbook.org)
 
Old 04-17-2007, 06:26 PM   #4
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
my '/etc/group' is exactly the same ... reading 'man group' it says no one keeps this file up-to-date ... so don't worry about it
 
Old 04-17-2007, 06:31 PM   #5
rosepower
LQ Newbie
 
Registered: Nov 2005
Location: Portugal
Distribution: Slackware 12 / Testing Other distros
Posts: 24

Original Poster
Rep: Reputation: 15
Hi again,

Maybe i'm mixing things, but when i create a user that user is added to /etc/passwd like this file that i have in my system (the last one is the user i created):

root:x:0:0::/root:/bin/bash
bin:x:1:1:bin:/bin:
daemon:x:2:2:daemon:/sbin:
adm:x:3:4:adm:/var/log:
lp:x:4:7:lp:/var/spool/lpd:
sync:x:5:0:sync:/sbin:/bin/sync
shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown
halt:x:7:0:halt:/sbin:/sbin/halt
mail:x:8:12:mail:/:
news:x:9:13:news:/usr/lib/news:
uucp:x:10:14:uucp:/var/spool/uucppublic:
operator:x:11:0perator:/root:/bin/bash
games:x:12:100:games:/usr/games:
ftp:x:14:50::/home/ftp:
smmsp:x:25:25:smmsp:/var/spool/clientmqueue:
mysql:x:27:27:MySQL:/var/lib/mysql:/bin/bash
rpc:x:32:32:RPC portmap user:/:/bin/false
sshd:x:33:33:sshd:/:
gdm:x:42:42:GDM:/var/state/gdm:/bin/bash
pop:x:90:90:POP:/:
nobody:x:99:99:nobody:/:
ricardo:x:1000:100:Ricardo R,,,:/home/ricardo:/bin/bash

Now for the /etc/group file, i believe this is the form:
group name : group password : group ID: users

So if this is true in the /etc/group file, and according to the output of the id command, i should see something like this:
floppy::11:root,ricardo
audio::17:ricardo
video::18:ricardo
cdrom::19:ricardo
users::100:ricardo

regards
 
Old 04-17-2007, 06:34 PM   #6
rosepower
LQ Newbie
 
Registered: Nov 2005
Location: Portugal
Distribution: Slackware 12 / Testing Other distros
Posts: 24

Original Poster
Rep: Reputation: 15
@H_TeXMeX_H

Sorry i was writing as you replied.

What you said makes me wondering. If the group file, where you are supposed to add members to the groups is not up-to-date, how does the computer know wich groups i belong to ???

Have to check the script for adding the user !!!

Regards
 
Old 04-17-2007, 08:09 PM   #7
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141

Rep: Reputation: 168Reputation: 168
You should be seeing your user name against the extra groups that you're a member of. This is from one of my boxes:
Code:
$ id
uid=1000(steve) gid=102(steve) groups=18(video),102(steve),117(cvs_st)
$ grep steve /etc/group
video::18:disk,steve
steve:x:102:
cvs_st:x:117:steve,cvsadmin
Could it be as erklaerbaer suggested that you're looking in /etc/group- instead of /etc/group?

Last edited by gilead; 04-18-2007 at 01:55 PM.
 
Old 04-18-2007, 03:24 AM   #8
rosepower
LQ Newbie
 
Registered: Nov 2005
Location: Portugal
Distribution: Slackware 12 / Testing Other distros
Posts: 24

Original Poster
Rep: Reputation: 15
Hi,

Well, that was the result of "cat /etc/group", so i think it's correct.

I'll try the grep command later when i get home this evening.

Regards
 
Old 04-18-2007, 09:49 AM   #9
rworkman
Slackware Contributor
 
Registered: Oct 2004
Location: Tuscaloosa, Alabama (USA)
Distribution: Slackware
Posts: 2,559

Rep: Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351
See /etc/login.defs for this line:
CONSOLE_GROUPS floppy:audio:video:cdrom

When you log in on a console, you are automatically added to these groups - that's why you don't see yourself listed on them in /etc/group.

You don't see yourself listed in the "users" group because that is your primary group. If you create a new user, and when it asks if you want to invite/add the user to any other groups, specify "wheel" or some other group, then look at /etc/group and you'll see that the user is listed beside that group name.

Have a look at login.defs(5) for more information.
 
Old 04-18-2007, 05:56 PM   #10
rosepower
LQ Newbie
 
Registered: Nov 2005
Location: Portugal
Distribution: Slackware 12 / Testing Other distros
Posts: 24

Original Poster
Rep: Reputation: 15
Hi,

Yep, that was it. Thanks a lot !!!

Always learning

Regards
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
NAGIOS/Suse.9 : Creating User/group siobhan_2004 Linux - Newbie 1 08-04-2004 03:49 PM
creating file /aquota.user and /aquota.group?? deepika Linux - Newbie 1 10-09-2003 03:15 AM
creating file /aquota.user and /aquota.group?? deepika Linux - Newbie 1 07-29-2003 11:02 AM
passwd group, what else do I need? khutze Linux - Software 0 02-13-2003 05:49 PM
xinetd startup script checking for writeable /etc/passwd ? markus1982 Linux - Security 11 10-16-2002 08:15 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 10:43 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration