SlideShare a Scribd company logo
LIST
USERS IN
LINUX
Linux - Everywhere
in Tech world
Prepared by: Satish Kumar
Founder, LinuxConcept
LINUXCONCEPT
LINUXCONCEPT
LINUXCONCEPT
https://linuxconcept.com/how-to-list-users-in-linux/
Have you ever ever needed to checklist all customers in
your Linux system or to depend the variety of customers
within the system? There are instructions to create a
consumer, delete a consumer, checklist logged in
customers, however what’s the command to checklist all
customers in Linux?
This tutorial will present you the best way to checklist
customers in Linux techniques.
Get a Record of All Customers utilizing the
/etc/passwd File
Native consumer data is saved within the /etc/passwd
file. Every line on this file represents login data for one
consumer. To open the file you’ll be able to both use cat
or less :
$ less /etc/passwd


LINUXCONCEPT
https://linuxconcept.com/how-to-list-users-in-linux/
LINUXCONCEPT
Person title.
Encrypted password (x signifies that the password is saved
within the /etc/shadow file).
Person ID quantity (UID).
Person’s group ID quantity (GID).
Full title of the consumer (GECOS).
Person dwelling listing.
Login shell (defaults to /bin/bash).
Every line within the file has seven fields delimited by colons
that include the next data:
If you wish to show solely the username you need to use both
awk or cut instructions to print solely the primary area
containing the username:
$ awk -F: '{ print $1}' /etc/passwd
$ cut -d: -f1 /etc/passwd
Output:
root
daemon
bin
sys
sync
...
...
sshd
anwen
satish
layla
https://linuxconcept.com/how-to-list-users-in-linux/
LINUXCONCEPT
GET A RECORD OF ALL CUSTOMERS UTILIZING THE
GETENT COMMAND
The getent command shows entries from databases configured
in /etc/nsswitch.conf file, together with the passwd database,
which can be utilized to question an inventory of all
customers.
To get an inventory of all Linux userr, enter the next
command:
$ getent passwd
https://linuxconcept.com/how-to-list-users-in-linux/
As you’ll be able to see, the output is similar as when
displaying the content material of the /etc/passwd file. If
you’re utilizing LDAP for consumer authentication, the getent
will show all Linux customers from each /etc/passwd file and
LDAP database.
You can even use awk or reduce to print solely the primary
area containing the username:
$ getent passwd | awk -F: '{ print $1}'
$ getent passwd | cut -d: -f1
Examine whether or not a consumer exists within the Linux
system
Now that we all know the best way to checklist all customers,
to verify whether or not a consumer exists in our Linux field
we, can merely filter the customers’ checklist by piping the
checklist to the grep command.
For instance, to search out out if a consumer with title jack
exists in our Linux system we will use the next command:
$ getent passwd | grep satish


LINUXCONCEPT
https://linuxconcept.com/how-to-list-users-in-linux/
LINUXCONCEPT
If the consumer exists, the command above will print the
consumer’s login data. No output which means the consumer
doesn’t exist.
We will additionally verify whether or not a consumer exists
with out utilizing the grep command as proven beneath:
$ getent passwd jack
Identical as earlier than, if the consumer exists, the command
will show the consumer’s login data.
If you wish to learn the way many customers accounts you
might have in your system, pipe the getent passwd output to
the wc command:
$ getent passwd | wc -l
Output:
35
As you’ll be able to see from the output above, my Linux
system has 35 consumer accounts.
https://linuxconcept.com/how-to-list-users-in-linux/
LINUXCONCEPT
SYSTEM AND REGULAR CUSTOMERS
There isn’t any actual technical distinction between the
system and common (regular) customers. Usually system
customers are created when putting in the OS and new
packages. In some instances, you’ll be able to create a system
consumer that will probably be utilized by some purposes.
Regular customers are the customers created by the
foundation or one other consumer with sudo privileges.
Normally, a traditional consumer has an actual login shell and
a house listing.
Every consumer has a numeric consumer ID known as UID. If
not specified when creating a brand new consumer with the
useradd command, the UID will probably be routinely chosen
from the /etc/login.defs file relying on the UID_MIN and
UID_MIN values.
To verify the UID_MIN and UID_MIN values in your system, you
need to use the next command:
$ grep -E '^UID_MIN|^UID_MAX' /etc/login.defs
Output:
UID_MIN 1000
UID_MAX 60000
https://linuxconcept.com/how-to-list-users-in-linux/
LINUXCONCEPT
From the output above, we will see that every one regular
customers ought to have a UID between 1000 and 60000.
Realizing the minimal and maximal worth permit us to
question an inventory of all regular customers in our system.
The command beneath will checklist all regular customers in
our Linux system:
$ getent passwd {1000..60000}
Output:
anwen:x:1000:1000:Anwen,,,:/dwelling/anwen:/bin/bash
bailey:x:1001:1001:,,,:/dwelling/bailey:/bin/bash
satish:x:1002:1002:Satish Kumar,,,:/dwelling/satish:/bin/bash
kumar:x:1003:1003:Kumar
Raj,,,:/dwelling/kumar:/usr/sbin/nologin
Your system UID_MIN and UID_MIN values could also be
totally different so the extra generic model of the command
above can be:
$ eval getent passwd {$(awk '/^UID_MIN/ {print $2}'
/etc/login.defs)..$(awk '/^UID_MAX/ {print $2}'
/etc/login.defs)}
If you wish to print solely the usernames simply pipe the
output to the cut command:
$ eval getent passwd {$(awk '/^UID_MIN/ {print $2}' /and
so forth/login.defs)..$(awk '/^UID_MAX/ {print $2}' /and so
forth/login.defs)} | reduce -d: -f1
https://linuxconcept.com/how-to-list-users-in-linux/
LINUXCONCEPT
Conclusion
On this tutorial, you realized the best way to checklist and
filter customers in your Linux system and what are the
primary variations between system and regular Linux
customers.
The identical instructions apply for any Linux distribution,
together with Ubuntu, CentOS, RHEL, Debian, and Linux Mint.
https://linuxconcept.com/how-to-list-users-in-linux/
LINUXCONCEPT
THANK YOU
You can check our website https://linuxconcept.com for
more similar information on Linux or opensource
technologies.
https://linuxconcept.com/how-to-list-users-in-linux/

More Related Content

Similar to List users in linux

Install websphere message broker 8 RHEL 6 64 bits
Install websphere message broker 8 RHEL 6 64 bitsInstall websphere message broker 8 RHEL 6 64 bits
Install websphere message broker 8 RHEL 6 64 bits
Manuel Vega
 
Intrusion Discovery Cheat Sheet for Linux
Intrusion Discovery Cheat Sheet for LinuxIntrusion Discovery Cheat Sheet for Linux
Intrusion Discovery Cheat Sheet for Linux
Muhammad FAHAD
 
Linux advanced privilege escalation
Linux advanced privilege escalationLinux advanced privilege escalation
Linux advanced privilege escalation
Jameel Nabbo
 
Hands_on_multipath_p1.pdf
Hands_on_multipath_p1.pdfHands_on_multipath_p1.pdf
Hands_on_multipath_p1.pdf
Hossein Mehrara
 
Firebird
FirebirdFirebird
Firebird
Chinsan Huang
 
Server hardening
Server hardeningServer hardening
Server hardening
Teja Babu
 
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)
 
Windows post exploitation
Windows post exploitationWindows post exploitation
Windows post exploitation
yarden hanan
 
Character_Device_drvier_pc
Character_Device_drvier_pcCharacter_Device_drvier_pc
Character_Device_drvier_pcRashila Rr
 
Post exploitation using powershell
Post exploitation using powershellPost exploitation using powershell
Post exploitation using powershell
Mihir Shah
 
Chapter 3 Using Unix Commands
Chapter 3 Using Unix CommandsChapter 3 Using Unix Commands
Chapter 3 Using Unix Commands
MeenalJabde
 
User and groups administrator
User  and  groups administratorUser  and  groups administrator
User and groups administrator
Aisha Talat
 
Intrusion Discovery on Windows
Intrusion Discovery on WindowsIntrusion Discovery on Windows
Intrusion Discovery on Windows
dkaya
 
Introduction to Unix
Introduction to UnixIntroduction to Unix
Introduction to UnixSudharsan S
 
Ubuntu Practice and Configuration
Ubuntu Practice and ConfigurationUbuntu Practice and Configuration
Ubuntu Practice and Configuration
Manoj Sahu
 
Linux lecture
Linux lectureLinux lecture
Linux lecture
Paktia University
 
3 level cert tomcat
3 level cert tomcat3 level cert tomcat
3 level cert tomcat
Suraj Pratap
 

Similar to List users in linux (20)

Install websphere message broker 8 RHEL 6 64 bits
Install websphere message broker 8 RHEL 6 64 bitsInstall websphere message broker 8 RHEL 6 64 bits
Install websphere message broker 8 RHEL 6 64 bits
 
Intrusion Discovery Cheat Sheet for Linux
Intrusion Discovery Cheat Sheet for LinuxIntrusion Discovery Cheat Sheet for Linux
Intrusion Discovery Cheat Sheet for Linux
 
Linux advanced privilege escalation
Linux advanced privilege escalationLinux advanced privilege escalation
Linux advanced privilege escalation
 
Hands_on_multipath_p1.pdf
Hands_on_multipath_p1.pdfHands_on_multipath_p1.pdf
Hands_on_multipath_p1.pdf
 
Firebird
FirebirdFirebird
Firebird
 
Server hardening
Server hardeningServer hardening
Server hardening
 
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)
 
Windows post exploitation
Windows post exploitationWindows post exploitation
Windows post exploitation
 
Character_Device_drvier_pc
Character_Device_drvier_pcCharacter_Device_drvier_pc
Character_Device_drvier_pc
 
Linux
Linux Linux
Linux
 
Post exploitation using powershell
Post exploitation using powershellPost exploitation using powershell
Post exploitation using powershell
 
Chapter 3 Using Unix Commands
Chapter 3 Using Unix CommandsChapter 3 Using Unix Commands
Chapter 3 Using Unix Commands
 
Linux
LinuxLinux
Linux
 
User and groups administrator
User  and  groups administratorUser  and  groups administrator
User and groups administrator
 
Linuxppt
LinuxpptLinuxppt
Linuxppt
 
Intrusion Discovery on Windows
Intrusion Discovery on WindowsIntrusion Discovery on Windows
Intrusion Discovery on Windows
 
Introduction to Unix
Introduction to UnixIntroduction to Unix
Introduction to Unix
 
Ubuntu Practice and Configuration
Ubuntu Practice and ConfigurationUbuntu Practice and Configuration
Ubuntu Practice and Configuration
 
Linux lecture
Linux lectureLinux lecture
Linux lecture
 
3 level cert tomcat
3 level cert tomcat3 level cert tomcat
3 level cert tomcat
 

Recently uploaded

Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
Celine George
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Thiyagu K
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
TechSoup
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
Jheel Barad
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
DhatriParmar
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
Balvir Singh
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
EduSkills OECD
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
SACHIN R KONDAGURI
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
DeeptiGupta154
 
678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf
CarlosHernanMontoyab2
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
Jisc
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
kaushalkr1407
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
JosvitaDsouza2
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
Pavel ( NSTU)
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
beazzy04
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
timhan337
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
BhavyaRajput3
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
Levi Shapiro
 

Recently uploaded (20)

Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
 
678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
 

List users in linux

  • 1. LIST USERS IN LINUX Linux - Everywhere in Tech world Prepared by: Satish Kumar Founder, LinuxConcept LINUXCONCEPT LINUXCONCEPT LINUXCONCEPT https://linuxconcept.com/how-to-list-users-in-linux/
  • 2. Have you ever ever needed to checklist all customers in your Linux system or to depend the variety of customers within the system? There are instructions to create a consumer, delete a consumer, checklist logged in customers, however what’s the command to checklist all customers in Linux? This tutorial will present you the best way to checklist customers in Linux techniques. Get a Record of All Customers utilizing the /etc/passwd File Native consumer data is saved within the /etc/passwd file. Every line on this file represents login data for one consumer. To open the file you’ll be able to both use cat or less : $ less /etc/passwd LINUXCONCEPT https://linuxconcept.com/how-to-list-users-in-linux/
  • 3. LINUXCONCEPT Person title. Encrypted password (x signifies that the password is saved within the /etc/shadow file). Person ID quantity (UID). Person’s group ID quantity (GID). Full title of the consumer (GECOS). Person dwelling listing. Login shell (defaults to /bin/bash). Every line within the file has seven fields delimited by colons that include the next data: If you wish to show solely the username you need to use both awk or cut instructions to print solely the primary area containing the username: $ awk -F: '{ print $1}' /etc/passwd $ cut -d: -f1 /etc/passwd Output: root daemon bin sys sync ... ... sshd anwen satish layla https://linuxconcept.com/how-to-list-users-in-linux/
  • 4. LINUXCONCEPT GET A RECORD OF ALL CUSTOMERS UTILIZING THE GETENT COMMAND The getent command shows entries from databases configured in /etc/nsswitch.conf file, together with the passwd database, which can be utilized to question an inventory of all customers. To get an inventory of all Linux userr, enter the next command: $ getent passwd https://linuxconcept.com/how-to-list-users-in-linux/
  • 5. As you’ll be able to see, the output is similar as when displaying the content material of the /etc/passwd file. If you’re utilizing LDAP for consumer authentication, the getent will show all Linux customers from each /etc/passwd file and LDAP database. You can even use awk or reduce to print solely the primary area containing the username: $ getent passwd | awk -F: '{ print $1}' $ getent passwd | cut -d: -f1 Examine whether or not a consumer exists within the Linux system Now that we all know the best way to checklist all customers, to verify whether or not a consumer exists in our Linux field we, can merely filter the customers’ checklist by piping the checklist to the grep command. For instance, to search out out if a consumer with title jack exists in our Linux system we will use the next command: $ getent passwd | grep satish LINUXCONCEPT https://linuxconcept.com/how-to-list-users-in-linux/
  • 6. LINUXCONCEPT If the consumer exists, the command above will print the consumer’s login data. No output which means the consumer doesn’t exist. We will additionally verify whether or not a consumer exists with out utilizing the grep command as proven beneath: $ getent passwd jack Identical as earlier than, if the consumer exists, the command will show the consumer’s login data. If you wish to learn the way many customers accounts you might have in your system, pipe the getent passwd output to the wc command: $ getent passwd | wc -l Output: 35 As you’ll be able to see from the output above, my Linux system has 35 consumer accounts. https://linuxconcept.com/how-to-list-users-in-linux/
  • 7. LINUXCONCEPT SYSTEM AND REGULAR CUSTOMERS There isn’t any actual technical distinction between the system and common (regular) customers. Usually system customers are created when putting in the OS and new packages. In some instances, you’ll be able to create a system consumer that will probably be utilized by some purposes. Regular customers are the customers created by the foundation or one other consumer with sudo privileges. Normally, a traditional consumer has an actual login shell and a house listing. Every consumer has a numeric consumer ID known as UID. If not specified when creating a brand new consumer with the useradd command, the UID will probably be routinely chosen from the /etc/login.defs file relying on the UID_MIN and UID_MIN values. To verify the UID_MIN and UID_MIN values in your system, you need to use the next command: $ grep -E '^UID_MIN|^UID_MAX' /etc/login.defs Output: UID_MIN 1000 UID_MAX 60000 https://linuxconcept.com/how-to-list-users-in-linux/
  • 8. LINUXCONCEPT From the output above, we will see that every one regular customers ought to have a UID between 1000 and 60000. Realizing the minimal and maximal worth permit us to question an inventory of all regular customers in our system. The command beneath will checklist all regular customers in our Linux system: $ getent passwd {1000..60000} Output: anwen:x:1000:1000:Anwen,,,:/dwelling/anwen:/bin/bash bailey:x:1001:1001:,,,:/dwelling/bailey:/bin/bash satish:x:1002:1002:Satish Kumar,,,:/dwelling/satish:/bin/bash kumar:x:1003:1003:Kumar Raj,,,:/dwelling/kumar:/usr/sbin/nologin Your system UID_MIN and UID_MIN values could also be totally different so the extra generic model of the command above can be: $ eval getent passwd {$(awk '/^UID_MIN/ {print $2}' /etc/login.defs)..$(awk '/^UID_MAX/ {print $2}' /etc/login.defs)} If you wish to print solely the usernames simply pipe the output to the cut command: $ eval getent passwd {$(awk '/^UID_MIN/ {print $2}' /and so forth/login.defs)..$(awk '/^UID_MAX/ {print $2}' /and so forth/login.defs)} | reduce -d: -f1 https://linuxconcept.com/how-to-list-users-in-linux/
  • 9. LINUXCONCEPT Conclusion On this tutorial, you realized the best way to checklist and filter customers in your Linux system and what are the primary variations between system and regular Linux customers. The identical instructions apply for any Linux distribution, together with Ubuntu, CentOS, RHEL, Debian, and Linux Mint. https://linuxconcept.com/how-to-list-users-in-linux/
  • 10. LINUXCONCEPT THANK YOU You can check our website https://linuxconcept.com for more similar information on Linux or opensource technologies. https://linuxconcept.com/how-to-list-users-in-linux/