Sunday, 7 January 2018

MULTIPLE WAYS TO FIND USER ACCOUNT AND LOGIN DETAILS IN LINUX

User Commands

To find the lists of users in the Linux and to find on which group the user belongs to.
#cat /etc/passwd
#users
Output
The below output lists all the users and the user who has currently logged in to the system.











Group Commands
To lists all the groups and on which group’s the users belong to.
#cat /etc/group
#groups ec2-user





id Command
id is a tool which is used to find the user id and group id of the users in the system.
#id ec2-user


Finger 
Finger is a command line utility to get the complete detail about the user in the Linux, The details include users’ real name, shell, home directory etc.,
To get this feature We need to install finger command using the command:
#yum install finger -y
Output
The below output shows the user’s Login name, Shell type, Home directory, Time of Login etc.,




grep Command
grep is a pattern searching tool available in all the Linux systems.
If you want to find the specific information, You can use grep to filter according to our need.
#cat /etc/passwd |grep ec2-user
#rpm -qa |grep finger
Output
To filter the specific user info or the particular rpm in the Linux.



lslogins Command
To lists only the know users in the Linux system.
From user id 1-999 It is reserved for system users.The users we create starts with uid 1000. Those users are referred as known users.
#lslogins -u
-u flag is used to list only the known user accounts.
Output

 
login Command
who command is used to find the users who are logged in to the system and the terminals they are connecting from.
w command is used to lists all the logged in users and the what they are doing.
last (or) last -a command is used to list the last logged in users information.
#who
#w
Output

#last [or] last -a

No comments:

Step-by-step OpenLDAP Installation and Configuration on server

This tutorial describes how to install and configure an OpenLDAP server and also an OpenLDAP client. Step by Step Installation and Conf...