Linux User Management Unveiled: A guide to mastering user control
Gauri Yadav
Docker Captain @Docker.Inc ? Google Program Mentor ? Cloud Intern @Gavedu ? DevSecOps Culture ? Kubernetes ? 3x Azure Certified ? Technical Speaker ??
What is a Linux user?
Linux user is an account or an entity that provides interactive access to the system and allows one to create or modify files and perform several other operations.
Types of Linux users?
A system user account aka privileged account is created by the operating system during its installation and is used for operating system-defined purposes. They have user id's predefined (100-999).
This range can be verified in the file /etc/login.defs.
cat /etc/login.defs | grep -i SYS_UID_MIN
cat /etc/login.defs | grep -i SYS_UID_MAX
The regular user accounts has ids begin from 1000 onwards.
cat /etc/login.defs | grep -i UID_MIN | grep -v -E '^\#'
cat /etc/login.defs | grep -i UID_MAX | grep -v -E '^\#'
Q1 How to create user?
useradd <user_name>
Q2 How to check user is present or not?
grep <user_name> /etc/passwd
Q3 How to setup a user password?
passwd <user_name>
Q4 How to delete a user?
userdel <user_name>
Properties of Linux User Accounts
领英推荐
Q1 What is /etc/passwd file?
When you create a local user account, the user’s login information and all other details are stored in the /etc/passwd file.
Q2 What is /etc/shadow file?
it is a crucial component of Unix-like operating systems that stores password hashes and associated user account security information. It is a critical part of the system's security infrastructure, protecting user credentials and enforcing security policies.
Analyzing syntax of user properties
Q1 What is the syntax for displaying a user property in Linux?
The syntax is ->
username:password:UID:GID:name:homedirectory:shell
Modifying an Existing user's properties
Q1 How to update the comment part of Linux user?
- Before adding comment
usermod -c <"comment"> <username>
- After adding comment
Q2 How to change user home directory ?
- Before changing directory
usermod -d <dir> <user_name>
- After changing directory
So, whether you're a seasoned Linux pro or just beginning your Linux journey, take a moment to appreciate the elegance of the Linux User Management. It's the foundation of a world where you have the power to control and customize your computing environment.
With that, happy Linux learning, and may your Linux directory explorations be filled with joy and success!