SlideShare a Scribd company logo
Linux - User
Administration
Samuel OJO
Introduction
In this section, I will discuss in detail about user
administration in Linux.
There are three main types of user accounts on a
Linux Server:
Root, System and User Accounts
ROOT ACCOUNT
This is also called superuser and would
have complete control of the Linux
system. A superuser can run any
commands without any restriction. This
user should therefore not be used to
access the system directly, it should be
assumed as a system administrator.
SYSTEM ACCOUNTS
•System accounts are those needed for the
operation of system-specific components,
for example mail accounts and
the sshd accounts. These accounts are
usually needed for some specific function
on your Linux system, and any
modifications to them could adversely
affect the system.
USER ACCOUNTS
User accounts provide interactive access to the system
for users and groups. General users are typically
assigned to these accounts and usually have limited
access to critical system files and directories.
Linux uses Group Account which logically groups a
number of accounts. Every account would be a part of
another group account. A group plays important role in
handling file permissions and process management.
MANAGING USERS AND GROUPS IN LINUX
There are four main user administration files −
1. /etc/passwd − Keeps the user account and password
information. This file holds the majority of information about
accounts on the Unix system.
2. /etc/shadow − Holds the encrypted password of the
corresponding account. Not all the systems support this file.
3. /etc/group − This file contains the group information for
each account.
4. /etc/gshadow − This file contains secure group account
information.
BASIC USER ADMINISTRATION COMMANDS
1 Useradd: - Adds accounts to the system
2 Usermod: - Modifies account attributes
3 Userdel: - Deletes accounts from the system
4 Groupadd: - Adds groups to the system
5 Groupmod: - Modifies group attributes
6 Groupdel: - Removes groups from the system
CREATE A GROUP
groupadd [-g gid [-o]] [-r] [-f] groupname --OR-- groupadd local_admin
1 -g GID - - The numerical value of the group's ID
2 -o -- This option permits to add group with non-unique GID
3 -r -- This flag instructs groupadd to add a system account
4 -f -- This option causes to just exit with success status
5 groupname --- Actual group name to be created
$ groupadd developers
MODIFY A GROUP
To modify a group, use
the groupmod syntax −
$ groupmod -n new_group_name old_group_name
$ groupmod -n sysadmin local_admin
$ groupmod -g 484 sysadmin
DELETE A GROUP
We will quickly look at how to delete a group. To delete
an existing group, all you need is the groupdel
command and the group name, e.g:
$ groupdel local_admin
This removes only the group, not the files associated with
that group. The files are still accessible by their owners.
CREATE AN ACCOUNT
1 -d homedir
Specifies home directory for the account
2 -g groupname
Specifies a group account for this account
3 -m
Creates the home directory if it doesn't exist
4 -s shell
Specifies the default shell for this account
5 -u userid
You can specify a user id for this account
6 accountname
Actual account name to be created
useradd -d homedir -g groupname -m -s shell -u userid accountname
If you do not specify any parameter, then the system makes use of the
default values. The useradd command modifies the /etc/passwd,
/etc/shadow, and /etc/group files and creates a home directory.
This is the example that creates an account samojo, setting its home
directory to /home/samojo and the group as sysadmin. This user would
have Korn Shell assigned to it
$ useradd -d /home/samojo -g sysadmin -s /bin/ksh samojo
Before issuing the above command, make sure you already have the
sysadmin group created using the groupadd command.
Once an account is created you can set its password using
the passwd command. E.g passwd samojo
MODIFY AN ACCOUNT
The usermod command enables you to make changes to
an existing account from the command line. It uses the
same arguments as the useradd command, plus the -l
argument, which allows you to change the account name.
Eg, to change the account name samojo to samojo00 and
to change home directory accordingly
$ usermod -d /home/samojo00 -m -l samojo samojo00
DELETE AN ACCOUNT
The userdel command can be used to delete an existing user. This
is a very dangerous command if not used with caution.
There is only one argument or option available for the
command .r, for removing the account's home directory and mail
file. Eg, to remove account samojo00, type the command:
$ userdel -r samojo00
If you want to keep the home directory for backup purposes, omit
the -r option. You can remove the home directory as needed at a
later time
Ad

More Related Content

What's hot (20)

User management
User managementUser management
User management
Mufaddal Haidermota
 
Introduction 2 linux
Introduction 2 linuxIntroduction 2 linux
Introduction 2 linux
Papu Kumar
 
Filepermissions in linux
Filepermissions in linuxFilepermissions in linux
Filepermissions in linux
Subashini Pandiarajan
 
Introduction to Linux
Introduction to Linux Introduction to Linux
Introduction to Linux
Harish R
 
Linux command ppt
Linux command pptLinux command ppt
Linux command ppt
kalyanineve
 
File permission of linux
File permission of linuxFile permission of linux
File permission of linux
Md Meherab Hossen
 
File permissions
File permissionsFile permissions
File permissions
Varnnit Jain
 
Linux basics part 1
Linux basics part 1Linux basics part 1
Linux basics part 1
Lilesh Pathe
 
Sa1 chapter-5-managing-local-linux-users-and-groups-v2 (4)
Sa1 chapter-5-managing-local-linux-users-and-groups-v2 (4)Sa1 chapter-5-managing-local-linux-users-and-groups-v2 (4)
Sa1 chapter-5-managing-local-linux-users-and-groups-v2 (4)
Chinthaka Deshapriya (RHCA)
 
File permission in linux
File permission in linuxFile permission in linux
File permission in linux
Prakash Poudel
 
Operating systems linux
Operating systems linuxOperating systems linux
Operating systems linux
william_morg
 
Linux systems - Linux Commands and Shell Scripting
Linux systems - Linux Commands and Shell ScriptingLinux systems - Linux Commands and Shell Scripting
Linux systems - Linux Commands and Shell Scripting
Emertxe Information Technologies Pvt Ltd
 
Linux File System
Linux File SystemLinux File System
Linux File System
Anil Kumar Pugalia
 
Lesson 2 Understanding Linux File System
Lesson 2 Understanding Linux File SystemLesson 2 Understanding Linux File System
Lesson 2 Understanding Linux File System
Sadia Bashir
 
Networking in linux
Networking in linuxNetworking in linux
Networking in linux
Varnnit Jain
 
User and groups administrator
User  and  groups administratorUser  and  groups administrator
User and groups administrator
Aisha Talat
 
Linux Basic Commands
Linux Basic CommandsLinux Basic Commands
Linux Basic Commands
Hanan Nmr
 
Unix/Linux Basic Commands and Shell Script
Unix/Linux Basic Commands and Shell ScriptUnix/Linux Basic Commands and Shell Script
Unix/Linux Basic Commands and Shell Script
sbmguys
 
Linux Networking Commands
Linux Networking CommandsLinux Networking Commands
Linux Networking Commands
tmavroidis
 
Introduction to linux
Introduction to linuxIntroduction to linux
Introduction to linux
Stephen Ahiante
 
Introduction 2 linux
Introduction 2 linuxIntroduction 2 linux
Introduction 2 linux
Papu Kumar
 
Introduction to Linux
Introduction to Linux Introduction to Linux
Introduction to Linux
Harish R
 
Linux command ppt
Linux command pptLinux command ppt
Linux command ppt
kalyanineve
 
Linux basics part 1
Linux basics part 1Linux basics part 1
Linux basics part 1
Lilesh Pathe
 
Sa1 chapter-5-managing-local-linux-users-and-groups-v2 (4)
Sa1 chapter-5-managing-local-linux-users-and-groups-v2 (4)Sa1 chapter-5-managing-local-linux-users-and-groups-v2 (4)
Sa1 chapter-5-managing-local-linux-users-and-groups-v2 (4)
Chinthaka Deshapriya (RHCA)
 
File permission in linux
File permission in linuxFile permission in linux
File permission in linux
Prakash Poudel
 
Operating systems linux
Operating systems linuxOperating systems linux
Operating systems linux
william_morg
 
Lesson 2 Understanding Linux File System
Lesson 2 Understanding Linux File SystemLesson 2 Understanding Linux File System
Lesson 2 Understanding Linux File System
Sadia Bashir
 
Networking in linux
Networking in linuxNetworking in linux
Networking in linux
Varnnit Jain
 
User and groups administrator
User  and  groups administratorUser  and  groups administrator
User and groups administrator
Aisha Talat
 
Linux Basic Commands
Linux Basic CommandsLinux Basic Commands
Linux Basic Commands
Hanan Nmr
 
Unix/Linux Basic Commands and Shell Script
Unix/Linux Basic Commands and Shell ScriptUnix/Linux Basic Commands and Shell Script
Unix/Linux Basic Commands and Shell Script
sbmguys
 
Linux Networking Commands
Linux Networking CommandsLinux Networking Commands
Linux Networking Commands
tmavroidis
 

Similar to User Administration in Linux (20)

Unix Administration 3
Unix Administration 3Unix Administration 3
Unix Administration 3
Information Technology
 
sun solaris
sun solarissun solaris
sun solaris
Ashis Das (CSE,MBA,RHCSA,RHCE)
 
A Complete Guide to “useradd” Command in Linux with Examples _ Hostbillo
A Complete Guide to “useradd” Command in Linux with Examples _ HostbilloA Complete Guide to “useradd” Command in Linux with Examples _ Hostbillo
A Complete Guide to “useradd” Command in Linux with Examples _ Hostbillo
KiyanaSharma1
 
How To Manage Linux User on RHEL 7
How To Manage Linux User on RHEL 7How To Manage Linux User on RHEL 7
How To Manage Linux User on RHEL 7
VCP Muthukrishna
 
User and group administration in Linux
User and group administration in LinuxUser and group administration in Linux
User and group administration in Linux
Mohammed Yazdani
 
ASO-1-Introduction of system administration.pdf
ASO-1-Introduction of system administration.pdfASO-1-Introduction of system administration.pdf
ASO-1-Introduction of system administration.pdf
Obaid49
 
4_Users_and_File_Permission_and_Directory_Commands
4_Users_and_File_Permission_and_Directory_Commands4_Users_and_File_Permission_and_Directory_Commands
4_Users_and_File_Permission_and_Directory_Commands
Gautam Raja
 
User Management Command Cheat Sheet.pdf
User Management Command Cheat Sheet.pdfUser Management Command Cheat Sheet.pdf
User Management Command Cheat Sheet.pdf
LinuxTeck
 
chapter11.. linux. Managing Users . ppt
chapter11.. linux.  Managing Users . pptchapter11.. linux.  Managing Users . ppt
chapter11.. linux. Managing Users . ppt
no22rah1
 
Week7 downloading and installing software (1).ppt
Week7 downloading and installing software (1).pptWeek7 downloading and installing software (1).ppt
Week7 downloading and installing software (1).ppt
no22rah1
 
Week7. linux. operating. system. .ppt
Week7.  linux.  operating.  system. .pptWeek7.  linux.  operating.  system. .ppt
Week7. linux. operating. system. .ppt
no22rah1
 
Addmi 06-security mgmt
Addmi 06-security mgmtAddmi 06-security mgmt
Addmi 06-security mgmt
odanyboy
 
7 - User Administration in Red Hat
7 - User Administration in Red Hat7 - User Administration in Red Hat
7 - User Administration in Red Hat
Shafaan Khaliq Bhatti
 
Linux+Command+Line+&+Shell+Scripting+Masterclass+-+Final.pptx
Linux+Command+Line+&+Shell+Scripting+Masterclass+-+Final.pptxLinux+Command+Line+&+Shell+Scripting+Masterclass+-+Final.pptx
Linux+Command+Line+&+Shell+Scripting+Masterclass+-+Final.pptx
newscribduserly
 
70 640 Lesson05 Ppt 041009
70 640 Lesson05 Ppt 04100970 640 Lesson05 Ppt 041009
70 640 Lesson05 Ppt 041009
Coffeyville Community College
 
Presentation1
Presentation1Presentation1
Presentation1
Engr Zardari Saddam
 
System Administeration Basics
System Administeration  BasicsSystem Administeration  Basics
System Administeration Basics
Bahaa Salama
 
Users and groups in Linux
Users and groups in LinuxUsers and groups in Linux
Users and groups in Linux
Knoldus Inc.
 
Basic linux day 5
Basic linux day 5Basic linux day 5
Basic linux day 5
Saikumar Daram
 
Your Practical Guide to Creating Users and Groups in Centos 07 .pdf
Your Practical Guide to Creating Users and Groups in Centos 07 .pdfYour Practical Guide to Creating Users and Groups in Centos 07 .pdf
Your Practical Guide to Creating Users and Groups in Centos 07 .pdf
Host It Smart
 
A Complete Guide to “useradd” Command in Linux with Examples _ Hostbillo
A Complete Guide to “useradd” Command in Linux with Examples _ HostbilloA Complete Guide to “useradd” Command in Linux with Examples _ Hostbillo
A Complete Guide to “useradd” Command in Linux with Examples _ Hostbillo
KiyanaSharma1
 
How To Manage Linux User on RHEL 7
How To Manage Linux User on RHEL 7How To Manage Linux User on RHEL 7
How To Manage Linux User on RHEL 7
VCP Muthukrishna
 
User and group administration in Linux
User and group administration in LinuxUser and group administration in Linux
User and group administration in Linux
Mohammed Yazdani
 
ASO-1-Introduction of system administration.pdf
ASO-1-Introduction of system administration.pdfASO-1-Introduction of system administration.pdf
ASO-1-Introduction of system administration.pdf
Obaid49
 
4_Users_and_File_Permission_and_Directory_Commands
4_Users_and_File_Permission_and_Directory_Commands4_Users_and_File_Permission_and_Directory_Commands
4_Users_and_File_Permission_and_Directory_Commands
Gautam Raja
 
User Management Command Cheat Sheet.pdf
User Management Command Cheat Sheet.pdfUser Management Command Cheat Sheet.pdf
User Management Command Cheat Sheet.pdf
LinuxTeck
 
chapter11.. linux. Managing Users . ppt
chapter11.. linux.  Managing Users . pptchapter11.. linux.  Managing Users . ppt
chapter11.. linux. Managing Users . ppt
no22rah1
 
Week7 downloading and installing software (1).ppt
Week7 downloading and installing software (1).pptWeek7 downloading and installing software (1).ppt
Week7 downloading and installing software (1).ppt
no22rah1
 
Week7. linux. operating. system. .ppt
Week7.  linux.  operating.  system. .pptWeek7.  linux.  operating.  system. .ppt
Week7. linux. operating. system. .ppt
no22rah1
 
Addmi 06-security mgmt
Addmi 06-security mgmtAddmi 06-security mgmt
Addmi 06-security mgmt
odanyboy
 
Linux+Command+Line+&+Shell+Scripting+Masterclass+-+Final.pptx
Linux+Command+Line+&+Shell+Scripting+Masterclass+-+Final.pptxLinux+Command+Line+&+Shell+Scripting+Masterclass+-+Final.pptx
Linux+Command+Line+&+Shell+Scripting+Masterclass+-+Final.pptx
newscribduserly
 
System Administeration Basics
System Administeration  BasicsSystem Administeration  Basics
System Administeration Basics
Bahaa Salama
 
Users and groups in Linux
Users and groups in LinuxUsers and groups in Linux
Users and groups in Linux
Knoldus Inc.
 
Your Practical Guide to Creating Users and Groups in Centos 07 .pdf
Your Practical Guide to Creating Users and Groups in Centos 07 .pdfYour Practical Guide to Creating Users and Groups in Centos 07 .pdf
Your Practical Guide to Creating Users and Groups in Centos 07 .pdf
Host It Smart
 
Ad

Recently uploaded (20)

Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptxIncreasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Anoop Ashok
 
Generative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in BusinessGenerative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in Business
Dr. Tathagat Varma
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025
Splunk
 
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
 
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep DiveDesigning Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
ScyllaDB
 
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul
 
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdfComplete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Software Company
 
Heap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and DeletionHeap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and Deletion
Jaydeep Kale
 
Big Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur MorganBig Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur Morgan
Arthur Morgan
 
TrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business ConsultingTrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business Consulting
Trs Labs
 
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded DevelopersLinux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Toradex
 
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
organizerofv
 
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
Alan Dix
 
Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.
hpbmnnxrvb
 
Technology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data AnalyticsTechnology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data Analytics
InData Labs
 
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptxDevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
Justin Reock
 
How analogue intelligence complements AI
How analogue intelligence complements AIHow analogue intelligence complements AI
How analogue intelligence complements AI
Paul Rowe
 
Build Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For DevsBuild Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For Devs
Brian McKeiver
 
Linux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdfLinux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdf
RHCSA Guru
 
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptxIncreasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Anoop Ashok
 
Generative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in BusinessGenerative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in Business
Dr. Tathagat Varma
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025
Splunk
 
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
 
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep DiveDesigning Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
ScyllaDB
 
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul
 
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdfComplete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Software Company
 
Heap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and DeletionHeap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and Deletion
Jaydeep Kale
 
Big Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur MorganBig Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur Morgan
Arthur Morgan
 
TrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business ConsultingTrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business Consulting
Trs Labs
 
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded DevelopersLinux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Toradex
 
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
organizerofv
 
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
Alan Dix
 
Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.
hpbmnnxrvb
 
Technology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data AnalyticsTechnology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data Analytics
InData Labs
 
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptxDevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
Justin Reock
 
How analogue intelligence complements AI
How analogue intelligence complements AIHow analogue intelligence complements AI
How analogue intelligence complements AI
Paul Rowe
 
Build Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For DevsBuild Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For Devs
Brian McKeiver
 
Linux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdfLinux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdf
RHCSA Guru
 
Ad

User Administration in Linux

  • 2. Introduction In this section, I will discuss in detail about user administration in Linux. There are three main types of user accounts on a Linux Server: Root, System and User Accounts
  • 3. ROOT ACCOUNT This is also called superuser and would have complete control of the Linux system. A superuser can run any commands without any restriction. This user should therefore not be used to access the system directly, it should be assumed as a system administrator.
  • 4. SYSTEM ACCOUNTS •System accounts are those needed for the operation of system-specific components, for example mail accounts and the sshd accounts. These accounts are usually needed for some specific function on your Linux system, and any modifications to them could adversely affect the system.
  • 5. USER ACCOUNTS User accounts provide interactive access to the system for users and groups. General users are typically assigned to these accounts and usually have limited access to critical system files and directories. Linux uses Group Account which logically groups a number of accounts. Every account would be a part of another group account. A group plays important role in handling file permissions and process management.
  • 6. MANAGING USERS AND GROUPS IN LINUX There are four main user administration files − 1. /etc/passwd − Keeps the user account and password information. This file holds the majority of information about accounts on the Unix system. 2. /etc/shadow − Holds the encrypted password of the corresponding account. Not all the systems support this file. 3. /etc/group − This file contains the group information for each account. 4. /etc/gshadow − This file contains secure group account information.
  • 7. BASIC USER ADMINISTRATION COMMANDS 1 Useradd: - Adds accounts to the system 2 Usermod: - Modifies account attributes 3 Userdel: - Deletes accounts from the system 4 Groupadd: - Adds groups to the system 5 Groupmod: - Modifies group attributes 6 Groupdel: - Removes groups from the system
  • 8. CREATE A GROUP groupadd [-g gid [-o]] [-r] [-f] groupname --OR-- groupadd local_admin 1 -g GID - - The numerical value of the group's ID 2 -o -- This option permits to add group with non-unique GID 3 -r -- This flag instructs groupadd to add a system account 4 -f -- This option causes to just exit with success status 5 groupname --- Actual group name to be created $ groupadd developers
  • 9. MODIFY A GROUP To modify a group, use the groupmod syntax − $ groupmod -n new_group_name old_group_name $ groupmod -n sysadmin local_admin $ groupmod -g 484 sysadmin
  • 10. DELETE A GROUP We will quickly look at how to delete a group. To delete an existing group, all you need is the groupdel command and the group name, e.g: $ groupdel local_admin This removes only the group, not the files associated with that group. The files are still accessible by their owners.
  • 11. CREATE AN ACCOUNT 1 -d homedir Specifies home directory for the account 2 -g groupname Specifies a group account for this account 3 -m Creates the home directory if it doesn't exist 4 -s shell Specifies the default shell for this account 5 -u userid You can specify a user id for this account 6 accountname Actual account name to be created useradd -d homedir -g groupname -m -s shell -u userid accountname
  • 12. If you do not specify any parameter, then the system makes use of the default values. The useradd command modifies the /etc/passwd, /etc/shadow, and /etc/group files and creates a home directory. This is the example that creates an account samojo, setting its home directory to /home/samojo and the group as sysadmin. This user would have Korn Shell assigned to it $ useradd -d /home/samojo -g sysadmin -s /bin/ksh samojo Before issuing the above command, make sure you already have the sysadmin group created using the groupadd command. Once an account is created you can set its password using the passwd command. E.g passwd samojo
  • 13. MODIFY AN ACCOUNT The usermod command enables you to make changes to an existing account from the command line. It uses the same arguments as the useradd command, plus the -l argument, which allows you to change the account name. Eg, to change the account name samojo to samojo00 and to change home directory accordingly $ usermod -d /home/samojo00 -m -l samojo samojo00
  • 14. DELETE AN ACCOUNT The userdel command can be used to delete an existing user. This is a very dangerous command if not used with caution. There is only one argument or option available for the command .r, for removing the account's home directory and mail file. Eg, to remove account samojo00, type the command: $ userdel -r samojo00 If you want to keep the home directory for backup purposes, omit the -r option. You can remove the home directory as needed at a later time

Editor's Notes

  • #7: Check all the above files using the cat command.
  • #8: You can use Manpage Help to check complete syntax for each command mentioned here.
  • #9: If you do not specify any parameter, then the system makes use of the default values. Following example creates a local_admin group with default values, which is very much acceptable for most of the administrators.
  • #13: When you type passwd accountname, it gives you an option to change the password, provided you are a superuser. Otherwise, you can change just your password using the same command but without specifying your account name.