User Account Management
Posted in: Blog, Red Hat

User Account Management in Linux

User Account Management RHCSA – In Linux everything is represented by a file, all files are associated with a user. All users belong to a group with the

Today on this article about user account management i will try to explain how Red Hat manage the users and groups creation and management.

For instance on Linux everything is represented by a file, all files are associated with a user. All users belong to a group with the same name as the username of the user, one user can be on many groups.

We have three different ways to create users by manual editing system files and using command line tools like useradd the last way is from GUI.

Users home directory are located at /home/username and are created automatically based on a skeleton located at /etc/skel .

User Account Management
User Account Management

RHCSA Exams Topics

  • User Account Management
  • Administrative Control
  • User and Shell Configuration
  • Users and Network Authentication
  • Special Groups

User Account Management – Actions

On this mini tutorial i will covered some basic actions on Linux Systems related to user account management, as an system administrator there are some basic actions we can make like create, delete and modify users. You can check all options using man command (man useradd).

  • useradd – Create User
  • userdel – Delete User
  • usermod – Modify User Account
  • passwd – Define User Password
  • User Configs & Home Directory

User Account Management – Types of Users

Linux system have three basic types of users accounts each one of them have a UID range associated with it. We will learn how to verify and change user UIDs on our system.

Root User

The root user is created when the system is installed, this user has the UID equal to Zero (0) and have permissions to access all services and files on the system. For instance keep this account secure and avoid share the root password with anyone.

System Accounts

These type of accounts are used by system services like apache, mysql, squid or email service they have UIDs between 1 and 999.

Regular Accounts

Regular accounts are users with limited permissions defined by the system administrator to execute standard procedures the UID range associated with them are between 1000 and 65535.

User TypeUID RangeDescription

System Accounts vs Service Accounts

User Account Management – Create User

To create a new user on Linux we have two options, use the default options specified on /etc/skel directory and /etc/default/useradd or pass the specific configuration as a parameter to the useradd command. Before start adding users to the system check all parameters with #man useradd command.

Create user with the default options based on /etc/skel file properties.

# useradd poplab

Here we are passing the basic parameters to useradd command, -U create a group with the same name as user, -m create the home directory for the user based on /etc/skel file rules and for last he -s /bin/bash attach the bash shell to the user permitting remote logins.

# useradd -D -U -m -s /bin/bash poplab

RHCSA Add User to Group

After create a new user most of times we need to add it to a group or many groups, remember the parameter -a (Append).

# usermod -aG security,wheel poplab

RHCSA Define User Password

To define a username password we have the passwd command

# passwd poplab

RHCSA Delete User Account

If is necessary to delete a user from the system, just run:

# userdel poplab

User Account Management – User Info Commands

Sometimes we need to troubleshoot or create a new specific account, being able to verify all account information related to a user or a file is a bonus.

Sometimes we ask a few questions to ourselves on our daily work:

How to check the user and group id?

Print logged user and user group IDs

# id
# id poplab

Verify all data about the id command

# man id

How to check user information?

Display information about known users in the system
# lslogins

# lslogins poplab

Files Related to Users – RHCSA

  • /etc/passwd – User account information.
  • /etc/shadow – Secure user account information.
  • /home/username/.bashrc
  • /home/username/.bash_history
  • /home/username/.profile
  • /etc/default/useradd – Default values for account creation.
  • /etc/login.defs – Shadow password suite configuration.

Folders Related to Users

  • /home/username – User Home Directory
  • /etc/skel/ – Directory Containing default files

Test your Skills

Next Article – Red Hat Squid Proxy


Back to Top