CentOS Stream 9: Add User Accounts

step-1

Initial Settings

To add user accounts on CentOS Stream Server, Configure like follows.

Step [1] For example, Add [centos] user.


[root@bizantum ~]# useradd centos
[root@bizantum ~]# passwd centos
Changing password for user centos.
New UNIX password:              # input any password you'd like to set
Retype new UNIX password:       # confirm
passwd: all authentication tokens updated successfully.

Step [2] If you'd like to switch to root account from a user added above, use [su] command to do so.


bizantum login: centos         # login username
password:                      # input user password
[centos@bizantum ~]$ su -      # switch to root
Password:                      # input root password
[root@bizantum ~]#

Step [3] If you'd like to limit users to run [su] command, configure like follows. On the example below, only users in [wheel] group can run [su] command.


[root@bizantum ~]# usermod -aG wheel centos
[root@bizantum ~]# vi /etc/pam.d/su
#%PAM-1.0
auth            sufficient      pam_rootok.so
# Uncomment the following line to implicitly trust users in the "wheel" group.
#auth           sufficient      pam_wheel.so trust use_uid
# Uncomment the following line to require a user to be in the "wheel" group.
# uncomment the following line
auth            required        pam_wheel.so use_uid
auth            substack        system-auth
auth            include         postlogin
account         sufficient      pam_succeed_if.so uid = 0 use_uid quiet
account         include         system-auth
password        include         system-auth
session         include         system-auth
session         include         postlogin
session         optional        pam_xauth.so

# verify settings with a user who is not in allowed group
[redhat@bizantum ~]$ su -
Password:
su: Permission denied     # denied normally

Step [3] If you'd like to remove a user accounts, Set like follows.


# remove a user [centos] (only removed user account)
[root@bizantum ~]# userdel centos
# remove a user [centos] (removed user account and his home directory both)
[root@bizantum ~]# userdel -r centos

Comments

Popular posts from this blog

Cyber Security: ISO 27001 Overview
Introduction ISO 27001 is an international standard for information security management systems (ISMS). It provides a framework for managing sensitive company information to ensure it remains secure. Understanding ISO 27001 is crucial for organizations aiming to protect their information assets.
Comprehensive Guide to Windows Subsystem for Linux (WSL): Benefits, Setup, and Usage
Introduction Windows Subsystem for Linux (WSL) is a compatibility layer for running Linux binary executables natively on Windows 10, Windows 11, and Windows Server. It allows users to run a GNU/Linux environment directly on Windows, including most command-line tools, utilities, and applications.
Ultimate Guide to COBIT: Framework, Benefits, Implementation, and Impact
Introduction COBIT (Control Objectives for Information and Related Technologies) is a globally recognized framework for managing and governing enterprise IT. It provides comprehensive guidelines for organizations to achieve their objectives through the effective use of IT.
Understanding ISO/IEC 20000: A Comprehensive Guide to IT Service Management
Introduction ISO/IEC 20000 is an international standard for IT Service Management (ITSM). It provides a framework for managing and delivering IT services that meet business needs and customer requirements. The standard ensures consistent and high-quality IT service delivery through a set of processes and best practices.
Top SEO Tools for Digital Marketing: A Comprehensive Guide
Introduction In today's digital landscape, search engine optimization (SEO) is a critical component for any business looking to enhance its online presence and drive organic traffic. With the myriad of SEO tools available, navigating the digital marketing space can seem daunting. To streamline your efforts and achieve optimal results, it's essential to leverage the right tools that cater to your specific needs.
Debian 12 Bookworm: Install Kubeadm
Introduction In this article, we will explore the what, who, where, when, why, and how of Kubeadm functionality on the Debian 12 Bookworm platform, so let's get started.