[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: Users and groups



On Sat, 8 Dec 2001, Alexander Shaw wrote:

> Hi all,
>
> I have a funny feeling that this is going to be an embarrassingly simple
> question, yet I can't seem to find an answer .....
>
> I've been trying to create a new user with the user manager, but not
> allowing it to create it's own group. This means that it is automatically
> added to the group users. When I assign it to the actual groups I want it to
> belong to this is fine, except that I cannot remove it from the users group
> as this seems to be configured as a default. How do I change the default
> group from users to what I would like it to be?

Hi Alex,

You are probably looking for a way to do it using the user manager, but:

man usermod says:
SYNOPSIS
       usermod [-c comment] [-d home_dir [ -m]]
               [-e expire_date] [-f inactive_time]
               [-g initial_group] [-G group[,...]]
               [-l login_name] [-p passwd]
               [-s shell] [-u uid [ -o]] [-L|-U] login


So this should change just the default group:

# /usr/sbin/usermod -g default_group username

or this will change all the groups:

# /usr/sbin/usermod -g default_group -G group2,group3,group4 username


You can see the list of groups that a user is in:

# /usr/bin/groups username

The first on the list is the default/initial group.


You can switch the default group that you are in, to one of the other
groups that you have permission to be in:

$ newgrp groupname


Hope this helps,
Arend







[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]