0% found this document useful (0 votes)
3 views10 pages

Chapter 4[Managing User Accounts in Ubuntu]

Chapter 4 covers managing user accounts in Ubuntu, detailing how to create, modify, and delete user accounts using both graphical tools and command line commands like useradd, usermod, and userdel. It also discusses group management, explaining the creation and modification of groups, the importance of group IDs, and how to manage group memberships. The chapter emphasizes the relationship between users and groups, including the default settings for user and group accounts.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views10 pages

Chapter 4[Managing User Accounts in Ubuntu]

Chapter 4 covers managing user accounts in Ubuntu, detailing how to create, modify, and delete user accounts using both graphical tools and command line commands like useradd, usermod, and userdel. It also discusses group management, explaining the creation and modification of groups, the importance of group IDs, and how to manage group memberships. The chapter emphasizes the relationship between users and groups, including the default settings for user and group accounts.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 10

Chapter 4

MANAGING USER
ACCOUNTS IN UBUNTU
Content:
• User Management
• Group Management
User Management
Creating User Accounts

Creating users in Gnome (GUI) is provide to create a normal user by using the
graphical tool, The user creation graphical tools are available in Graphical setting.
User Management
Click add user,
User Management

Type username and password, The password should have 8 values by letter &
number, punctuation and symbols, else you can create at first login, You can make
this user as admin
User Management

Adding users with useradd

• The useradd username command creates a new user named username. It


sets up the user's home directory and account information, and creates a
private group for the user named username. At this point the account does
not have a valid password set, and the user cannot log in until a password is
set.
• The useradd --help command displays the basic options that can be used to
override the defaults. In most cases, the same options can be used with the
usermod command to modify an existing user.
• Some defaults, such as the range of valid UID numbers and default password
aging rules, are read from the /etc/login.defs file. Values in this file are only
used when creating new users. A change to this file does not affect existing
users.
User Management
Setting user defaults

The useradd command determines the default values for new accounts by
reading the /etc/login.defs and /etc/default/useradd files.

Although login.defs is different on different Linux systems, the following is an


example containing many of the settings that you might find in a login.defs file:

UID_MIN 1000
UID_MAX 60000
SYS_UID_MIN 200
SYS_UID_MAX 999
GID_MIN 1000
GID_MAX 60000
SYS_GID_MIN 201
SYS_GID_MAX 999
CREATE_HOME yes
User Management
Modifying users with usermod

The usermod command provides a simple and straightforward method for


changing account parameters.

The following are examples of the usermod command:

# usermod -s /bin/csh chris


# usermod -Ga sales,marketing, chris

Deleting users with userdel

• The userdel username command removes the details of username


from /etc/passwd, but leaves the user's home directory intact.
• The userdel -r username command removes the details of username
from /etc/passwd and also deletes the user's home directory.
Group Management
Understanding Group Accounts

• A group is a collection of users that need to share access to files and other system
resources. Groups can be used to grant access to files to a set of users instead of just a
single user.
• Like users, groups have group names to make them easier to work with. Internally, the
system distinguishes groups by the unique identification number assigned to them, the
group ID or GID.
• The mapping of group names to GIDs is defined in databases of group account
information. By default, systems use the /etc/group file to store information about local
groups.

Each line in the /etc/group file contains information about one group. Each group entry is
divided into four colon-separated fields. Here is an example of a line from /etc/group:

group011): x2): 100003): user01,user02,user034)


• Group name for this group (group01).
• Obsolete group password field. This field should always be x.
• The GID number for this group (10000).
• A list of users who are members of this group
Group Management
Using group accounts

Every user has exactly one primary group. For local users, this is the group listed by GID
number in the /etc/passwd file. By default, this is the group that will own new files created
by the user.

Normally, when you create a new regular user, a new group with the same name as that
user is created. That group is used as the primary group for the new user, and that user is
the only member of this User Private Group.

Users may also have supplementary groups. Membership in supplementary groups is


determined by the /etc/group file.

The id command can also be used to find out about group membership for a user.

[user03@host ~]$ id
uid=1003(user03) gid=1003(user03) groups=1003(user03),10(wheel),10000(group01)
context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
Group Management
Creating group accounts

The groupadd command creates groups. Without options the groupadd command uses
the next available GID from the range specified in the /etc/login.defs file while creating the
groups.

The -g option specifies a particular GID for the group to use.


[user01@host ~]$ sudo groupadd -g 10000 group01
[user01@host ~]$ tail /etc/group
...output omitted...
group01:x:10000:

The -r option creates a system group using a GID from the range of valid system GIDs listed
in the /etc/login.defs file.

To change a group later, use the groupmod command, as in the following example:

# groupmod -g 330 jokers


# groupmod -n jacks jokers

You might also like