Categories: BlogRed 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

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).

  • useraddCreate User
  • userdelDelete User
  • usermodModify 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


Mr. SynMan

Recent Posts

Linux Device Management: Free Guide

Understand UDEV Folder /dev Understand D-BUS Device Commands List devices on PCI BUS lspci List devices on USB BUS lsusb…

6 months ago

Linux Pseudo File Systems: Free Guide

A pseudo file system does not exist on a physical hard disk,is created by the Kernel and only runs all…

6 months ago

Working with Kernel Modules

LPIC1 Category - 101.1 Determine and configure hardware settings uname command display information about the running Kernel. uname Display a…

6 months ago

Understand Linux ACLs

Linux ACLs can control the filesystem features and flags for each file or folder. Introducing ACLs in Linux ACLs Kernel…

10 months ago

How to Install Power DNS Red Hat Free

Learn how to Install Power DNS on Red Hat 7 using a command line. Configure your DNS Authoritive server and…

1 year ago

BIOS Interrupt Vector Table

BIOS Processor Instructions INTAddressTypeFunction Description00h0000:0000hProcessorDivide Error01h0000:0004hProcessorSingle Step02h0000:0008hProcessorNon-maskable interrupt03h0000:000ChProcessorBreakpoint instruction04h0000:0010hProcessorOverflow instruction05h0000:0014hBIOS ProcessorPrint screen Bound range exceeded06h0000:0018hProcessorInvalid opcode07h0000:001ChProcessorCoprocessor not available08h0000:0020hHardware ProcessorIRQ 0…

1 year ago