Doubt when creating a user and checking /etc/group and /etc/passwd
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: Slackware 12 / Testing Other distros
Posts: 24
Rep:
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.
Distribution: Slackware 12 / Testing Other distros
Posts: 24
Original Poster
Rep:
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):
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
Distribution: Slackware 12 / Testing Other distros
Posts: 24
Original Poster
Rep:
@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 ???
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.