{"id":506,"date":"2024-05-11T03:15:23","date_gmt":"2024-05-11T03:15:23","guid":{"rendered":"https:\/\/vpswebhostingindia.in\/blog\/?p=506"},"modified":"2024-05-13T13:43:13","modified_gmt":"2024-05-13T13:43:13","slug":"view-user-account-info-and-login-detail","status":"publish","type":"post","link":"https:\/\/vpswebhostingindia.in\/blog\/view-user-account-info-and-login-detail\/","title":{"rendered":"Finding multiple Ways to view User Account Info and Login Details in Linux server"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\" id=\"introduction\">Introduction<\/h2>\n\n\n\n<p>In this article we will learn Find multiple Ways to User Account Info and Login Details in&nbsp;<a href=\"https:\/\/en.wikipedia.org\/wiki\/Linux\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">Linux<\/a><\/p>\n\n\n\n<div class=\"wp-block-rank-math-toc-block\" id=\"rank-math-toc\"><h2>Table of Contents<\/h2><nav><ul><li><a href=\"#introduction\">Introduction<\/a><ul><li><a href=\"#why-do-we-need-user-account-information\">Why do we need user account information?<\/a><\/li><li><a href=\"#what-is-the-user-account-information\">What is the user account information?<\/a><\/li><\/ul><\/li><li><a href=\"#ways-to-view-user-account-info\">Ways to view User Account Info<\/a><\/li><li><a href=\"#id-command\">id Command\u200b<\/a><\/li><li><a href=\"#groups-command\">groups Command\u200b<\/a><\/li><li><a href=\"#getent-command\">getent Command\u200b<\/a><\/li><li><a href=\"#grep-command\">grep Command\u200b<\/a><\/li><li><a href=\"#lslogins-command\">lslogins Command\u200b<\/a><\/li><li><a href=\"#users-command\">users Command\u200b<\/a><\/li><li><a href=\"#who-command\">who Command\u200b<\/a><\/li><li><a href=\"#w-command\">w Command\u200b<\/a><\/li><li><a href=\"#last-or-lastb-commands\">last or lastb commands\u200b<\/a><\/li><li><a href=\"#lastlog-command\">lastlog Command\u200b<\/a><\/li><\/ul><\/nav><\/div>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"why-do-we-need-user-account-information\">Why do we need user account information?<\/h3>\n\n\n\n<p>Before addressing the question of what, let us discuss why we need user account information. Well, we all know that Linux is a multiuser platform. Therefore, we must manage these users properly to keep the system productive, organized, and functional.&nbsp;<\/p>\n\n\n\n<p>The system administrator must know all the users using the system to manage them and their permissions. Therefore, tracking all the users is a significant job. We can use multiple tools,&nbsp;which we will look at in depth in this article. We also know that everything in Linux is a file, and all of the information about users is contained in the \u201c\/etc\/passwd\u201d file. The respective hash passwords are present in&nbsp;the \u201c\/etc\/shadow\u201d file.&nbsp;<\/p>\n\n\n\n<p>In a nutshell, it is an essential job of system administrators to monitor the users in the system. To do this task, we have many monitoring commands like d, group, whoami, finger, getent, grep, lslogins, users, who, lastb, lastlog, w, and more.&nbsp;<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"what-is-the-user-account-information\">What is the user account information?<\/h3>\n\n\n\n<p>The user account information contains various information like the user name, the time of login, last time of login, account expiry date, password expiry date, idle time, login time, email address, plan, project, pgpkey, and countless more information! It only depends on what you are capable of asking Linux.<\/p>\n\n\n\n<p>Let us look at some user information look-up commands:<\/p>\n\n\n\n<p>This article will demonstrate multiple&nbsp;helpful methods that can be used to locate information regarding users on a <a href=\"https:\/\/vpswebhostingindia.in\/\">Linux system<\/a>. In this section, we will cover commands that can be used to retrieve information on a user&#8217;s account, show login data, and find out what people are doing on the system.<\/p>\n\n\n\n<p>The commands that allow us to find a user&#8217;s account information will be covered first, followed by an explanation of the commands that allow us to access login information.<\/p>\n\n\n\n<p>Follow the below steps to Find multiple Ways to User Account Info and Login Details in&nbsp;Linux<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"ways-to-view-user-account-info\">Ways to view User Account Info<\/h2>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"id-command\">id Command<a href=\"https:\/\/utho.com\/docs\/Linux\/find-multiple-ways-to-user-account-info-and-login-details-in-linux\/#id-command\" rel=\"nofollow noopener\" target=\"_blank\">\u200b<\/a><\/h2>\n\n\n\n<p>id is a straightforward command line application that displays accurate and useful user and group IDs in the format described below.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># id befriend <\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"658\" height=\"80\" src=\"https:\/\/vpswebhostingindia.in\/blog\/wp-content\/uploads\/2024\/05\/image-20.png\" alt=\"\" class=\"wp-image-523\" srcset=\"https:\/\/vpswebhostingindia.in\/blog\/wp-content\/uploads\/2024\/05\/image-20.png 658w, https:\/\/vpswebhostingindia.in\/blog\/wp-content\/uploads\/2024\/05\/image-20-300x36.png 300w\" sizes=\"auto, (max-width: 658px) 100vw, 658px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"groups-command\">groups Command<a href=\"https:\/\/utho.com\/docs\/Linux\/find-multiple-ways-to-user-account-info-and-login-details-in-linux\/#groups-command\" rel=\"nofollow noopener\" target=\"_blank\">\u200b<\/a><\/h2>\n\n\n\n<p>This is an example of how the groups command may be used to display all of the groups to which a user belongs.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># groups befriend<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"396\" height=\"73\" src=\"https:\/\/vpswebhostingindia.in\/blog\/wp-content\/uploads\/2024\/05\/image-21.png\" alt=\"\" class=\"wp-image-524\" srcset=\"https:\/\/vpswebhostingindia.in\/blog\/wp-content\/uploads\/2024\/05\/image-21.png 396w, https:\/\/vpswebhostingindia.in\/blog\/wp-content\/uploads\/2024\/05\/image-21-300x55.png 300w\" sizes=\"auto, (max-width: 396px) 100vw, 396px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"getent-command\">getent Command<a href=\"https:\/\/utho.com\/docs\/Linux\/find-multiple-ways-to-user-account-info-and-login-details-in-linux\/#getent-command\" rel=\"nofollow noopener\" target=\"_blank\">\u200b<\/a><\/h2>\n\n\n\n<p>The getent tool is a command line programme that can retrieve entries from Name Service Switch (NSS) libraries that are stored in a particular system database.<\/p>\n\n\n\n<p>Follow the steps below using the passwd database and the username to obtain information about a user&#8217;s account.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># getent passwd befriend<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"570\" height=\"72\" src=\"https:\/\/vpswebhostingindia.in\/blog\/wp-content\/uploads\/2024\/05\/image-22.png\" alt=\"Ways to User Account Info\" class=\"wp-image-525\" srcset=\"https:\/\/vpswebhostingindia.in\/blog\/wp-content\/uploads\/2024\/05\/image-22.png 570w, https:\/\/vpswebhostingindia.in\/blog\/wp-content\/uploads\/2024\/05\/image-22-300x38.png 300w\" sizes=\"auto, (max-width: 570px) 100vw, 570px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"grep-command\">grep Command<a href=\"https:\/\/utho.com\/docs\/Linux\/find-multiple-ways-to-user-account-info-and-login-details-in-linux\/#grep-command\" rel=\"nofollow noopener\" target=\"_blank\">\u200b<\/a><\/h2>\n\n\n\n<p>grep command is a strong example looking through device available on the vast majority Linux frameworks. You can utilize it to find data about a particular client from the framework accounts record:\/etc\/passwd as displayed underneath.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># grep -i befriend \/etc\/passwd <\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"585\" height=\"77\" src=\"https:\/\/vpswebhostingindia.in\/blog\/wp-content\/uploads\/2024\/05\/image-23.png\" alt=\"\" class=\"wp-image-526\" srcset=\"https:\/\/vpswebhostingindia.in\/blog\/wp-content\/uploads\/2024\/05\/image-23.png 585w, https:\/\/vpswebhostingindia.in\/blog\/wp-content\/uploads\/2024\/05\/image-23-300x39.png 300w\" sizes=\"auto, (max-width: 585px) 100vw, 585px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"lslogins-command\">lslogins Command<a href=\"https:\/\/utho.com\/docs\/Linux\/find-multiple-ways-to-user-account-info-and-login-details-in-linux\/#lslogins-command\" rel=\"nofollow noopener\" target=\"_blank\">\u200b<\/a><\/h2>\n\n\n\n<p>lslogins command shows data about known users in the framework, the &#8211; u flag just shows user accounts.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># lslogins -u <\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"840\" height=\"192\" src=\"https:\/\/vpswebhostingindia.in\/blog\/wp-content\/uploads\/2024\/05\/image-24.png\" alt=\"\" class=\"wp-image-527\" srcset=\"https:\/\/vpswebhostingindia.in\/blog\/wp-content\/uploads\/2024\/05\/image-24.png 840w, https:\/\/vpswebhostingindia.in\/blog\/wp-content\/uploads\/2024\/05\/image-24-300x69.png 300w, https:\/\/vpswebhostingindia.in\/blog\/wp-content\/uploads\/2024\/05\/image-24-768x176.png 768w\" sizes=\"auto, (max-width: 840px) 100vw, 840px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"users-command\">users Command<a href=\"https:\/\/utho.com\/docs\/Linux\/find-multiple-ways-to-user-account-info-and-login-details-in-linux\/#users-command\" rel=\"nofollow noopener\" target=\"_blank\">\u200b<\/a><\/h2>\n\n\n\n<p>The users command displays the usernames of any and all users who are currently logged on to the system in this format.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># users <\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"358\" height=\"96\" src=\"https:\/\/vpswebhostingindia.in\/blog\/wp-content\/uploads\/2024\/05\/image-13.png\" alt=\"\" class=\"wp-image-516\" srcset=\"https:\/\/vpswebhostingindia.in\/blog\/wp-content\/uploads\/2024\/05\/image-13.png 358w, https:\/\/vpswebhostingindia.in\/blog\/wp-content\/uploads\/2024\/05\/image-13-300x80.png 300w\" sizes=\"auto, (max-width: 358px) 100vw, 358px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"who-command\">who Command<a href=\"https:\/\/utho.com\/docs\/Linux\/find-multiple-ways-to-user-account-info-and-login-details-in-linux\/#who-command\" rel=\"nofollow noopener\" target=\"_blank\">\u200b<\/a><\/h2>\n\n\n\n<p>The who command is used to display a list of users who are currently logged on to the system, along with the terminals from which they are connecting.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># who -u <\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"803\" height=\"47\" src=\"https:\/\/vpswebhostingindia.in\/blog\/wp-content\/uploads\/2024\/05\/image-17.png\" alt=\"\" class=\"wp-image-520\" srcset=\"https:\/\/vpswebhostingindia.in\/blog\/wp-content\/uploads\/2024\/05\/image-17.png 803w, https:\/\/vpswebhostingindia.in\/blog\/wp-content\/uploads\/2024\/05\/image-17-300x18.png 300w, https:\/\/vpswebhostingindia.in\/blog\/wp-content\/uploads\/2024\/05\/image-17-768x45.png 768w\" sizes=\"auto, (max-width: 803px) 100vw, 803px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"w-command\">w Command<a href=\"https:\/\/utho.com\/docs\/Linux\/find-multiple-ways-to-user-account-info-and-login-details-in-linux\/#w-command\" rel=\"nofollow noopener\" target=\"_blank\">\u200b<\/a><\/h2>\n\n\n\n<p>The w command displays all users that are currently logged on to the system as well as the tasks that they are performing.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># w <\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"817\" height=\"127\" src=\"https:\/\/vpswebhostingindia.in\/blog\/wp-content\/uploads\/2024\/05\/image-25.png\" alt=\"\" class=\"wp-image-528\" srcset=\"https:\/\/vpswebhostingindia.in\/blog\/wp-content\/uploads\/2024\/05\/image-25.png 817w, https:\/\/vpswebhostingindia.in\/blog\/wp-content\/uploads\/2024\/05\/image-25-300x47.png 300w, https:\/\/vpswebhostingindia.in\/blog\/wp-content\/uploads\/2024\/05\/image-25-768x119.png 768w\" sizes=\"auto, (max-width: 817px) 100vw, 817px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"last-or-lastb-commands\">last or lastb commands<a href=\"https:\/\/utho.com\/docs\/Linux\/find-multiple-ways-to-user-account-info-and-login-details-in-linux\/#last-or-lastb-commands\" rel=\"nofollow noopener\" target=\"_blank\">\u200b<\/a><\/h2>\n\n\n\n<p>The output of the last and lastb commands is a list of the most recently logged-in users on the system.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># last <\/code><\/pre>\n\n\n\n<p>or<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># last -a <\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"832\" height=\"652\" src=\"https:\/\/vpswebhostingindia.in\/blog\/wp-content\/uploads\/2024\/05\/image-27.png\" alt=\"\" class=\"wp-image-530\" srcset=\"https:\/\/vpswebhostingindia.in\/blog\/wp-content\/uploads\/2024\/05\/image-27.png 832w, https:\/\/vpswebhostingindia.in\/blog\/wp-content\/uploads\/2024\/05\/image-27-300x235.png 300w, https:\/\/vpswebhostingindia.in\/blog\/wp-content\/uploads\/2024\/05\/image-27-768x602.png 768w\" sizes=\"auto, (max-width: 832px) 100vw, 832px\" \/><\/figure>\n\n\n\n<p>Use the -p option in the following way to display a list of all the users who were online at a particular time and date.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># last -ap now <\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"445\" height=\"81\" src=\"https:\/\/vpswebhostingindia.in\/blog\/wp-content\/uploads\/2024\/05\/image-28.png\" alt=\"\" class=\"wp-image-531\" srcset=\"https:\/\/vpswebhostingindia.in\/blog\/wp-content\/uploads\/2024\/05\/image-28.png 445w, https:\/\/vpswebhostingindia.in\/blog\/wp-content\/uploads\/2024\/05\/image-28-300x55.png 300w\" sizes=\"auto, (max-width: 445px) 100vw, 445px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"lastlog-command\">lastlog Command<a href=\"https:\/\/utho.com\/docs\/Linux\/find-multiple-ways-to-user-account-info-and-login-details-in-linux\/#lastlog-command\" rel=\"nofollow noopener\" target=\"_blank\">\u200b<\/a><\/h2>\n\n\n\n<p>The lastlog command can be used to determine the particulars of a recent login for all users or for a specific user, as seen below:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># lastlog<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"799\" height=\"484\" src=\"https:\/\/vpswebhostingindia.in\/blog\/wp-content\/uploads\/2024\/05\/image-29.png\" alt=\"lastlog command\" class=\"wp-image-532\" srcset=\"https:\/\/vpswebhostingindia.in\/blog\/wp-content\/uploads\/2024\/05\/image-29.png 799w, https:\/\/vpswebhostingindia.in\/blog\/wp-content\/uploads\/2024\/05\/image-29-300x182.png 300w, https:\/\/vpswebhostingindia.in\/blog\/wp-content\/uploads\/2024\/05\/image-29-768x465.png 768w\" sizes=\"auto, (max-width: 799px) 100vw, 799px\" \/><\/figure>\n\n\n\n<pre class=\"wp-block-code\"><code># lastlog -u username <\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"705\" height=\"82\" src=\"https:\/\/vpswebhostingindia.in\/blog\/wp-content\/uploads\/2024\/05\/image-30.png\" alt=\"\" class=\"wp-image-533\" srcset=\"https:\/\/vpswebhostingindia.in\/blog\/wp-content\/uploads\/2024\/05\/image-30.png 705w, https:\/\/vpswebhostingindia.in\/blog\/wp-content\/uploads\/2024\/05\/image-30-300x35.png 300w\" sizes=\"auto, (max-width: 705px) 100vw, 705px\" \/><\/figure>\n\n\n\n<p>On a Linux computer, we have discussed a variety of methods that can be used to locate information about users and login data.<\/p>\n\n\n\n<p>This article shows several ways to find Linux user information. We&#8217;ll discuss commands to get user account information, login data, and system activity in this section.<\/p>\n\n\n\n<p>I really hope that you&#8217;ve got all of those steps down to Find multiple Ways to User Account Info and Login Details in Linux<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction In this article we will learn Find multiple Ways to User Account Info and Login Details in&nbsp;Linux Why do we need user account information? Before addressing the question of what, let us discuss why we need user account information. Well, we all know that Linux is a multiuser platform. Therefore, we must manage these [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":538,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"rank_math_lock_modified_date":false,"_eb_attr":"","footnotes":""},"categories":[17,37],"tags":[],"class_list":["post-506","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-vps","category-linux"],"_links":{"self":[{"href":"https:\/\/vpswebhostingindia.in\/blog\/wp-json\/wp\/v2\/posts\/506","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/vpswebhostingindia.in\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/vpswebhostingindia.in\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/vpswebhostingindia.in\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/vpswebhostingindia.in\/blog\/wp-json\/wp\/v2\/comments?post=506"}],"version-history":[{"count":4,"href":"https:\/\/vpswebhostingindia.in\/blog\/wp-json\/wp\/v2\/posts\/506\/revisions"}],"predecessor-version":[{"id":539,"href":"https:\/\/vpswebhostingindia.in\/blog\/wp-json\/wp\/v2\/posts\/506\/revisions\/539"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/vpswebhostingindia.in\/blog\/wp-json\/wp\/v2\/media\/538"}],"wp:attachment":[{"href":"https:\/\/vpswebhostingindia.in\/blog\/wp-json\/wp\/v2\/media?parent=506"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/vpswebhostingindia.in\/blog\/wp-json\/wp\/v2\/categories?post=506"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/vpswebhostingindia.in\/blog\/wp-json\/wp\/v2\/tags?post=506"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}