You are not logged in.

#1 2010-02-01 13:09:46

thms
Member
Registered: 2010-02-01
Posts: 120

Question about users and groups

Hi,

my first post here is about users, their groups and default permissions.

I created a user thomas according to the beginners guide.

# useradd -m -G users,audio,lp,optical,storage,video,wheel,power -s /bin/bash thomas

Now, the new user also belongs to the group thomas(gid=1000) - is this ok? Every file or folder I create is owned by thomas. I always thought that these new files automatically belong to the group users by default, but the group is also thomas. Is this the default behaviour and I was wrong all the time?

Thanks!

Offline

#2 2010-02-01 13:13:52

Acecero
Member
Registered: 2008-06-21
Posts: 1,373

Re: Question about users and groups

The default behavior is setup up so any new file you make belongs to the same user in both users and group. However you can set up your user to have the files automatically belong to the users group if you have files you want to share with other users in the same system.

Offline

#3 2010-02-01 13:14:09

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,396
Website

Re: Question about users and groups

I believe that is the default behaviour.

Offline

#4 2010-02-01 13:15:17

Cilyan
Member
From: Toulouse (FR)
Registered: 2006-08-27
Posts: 97
Website

Re: Question about users and groups

useradd --help
-g, --gid GROUP name or ID of the primary group of the new account
-N, --no-user-group do not create a group with the same name as the user

You may set these options.

useradd -m -g users -G audio,lp,optical,storage,video,wheel,power -N -s /bin/bash thomas

Offline

#5 2010-02-01 13:36:52

thms
Member
Registered: 2010-02-01
Posts: 120

Re: Question about users and groups

Thanks for the swift replies.

I assume this doesn't work if the user already exists?

Last edited by thms (2010-02-01 13:37:12)

Offline

Board footer

Powered by FluxBB